dev: build using plain-ish build.rs#571
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
f38a093 to
7401f89
Compare
0c807f0 to
73494e9
Compare
73494e9 to
8d2c29d
Compare
8d2c29d to
e3f7ebe
Compare
e3f7ebe to
1ce7024
Compare
1ce7024 to
785092b
Compare
785092b to
5d193d1
Compare
a943e80 to
47e3b4f
Compare
47e3b4f to
df8a030
Compare
3927b1e to
c41f0f0
Compare
There was a problem hiding this comment.
Actionable comments posted: 6
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/build-release-candidate.yml:
- Line 51: Replace the mutable tag for the GitHub Action usage so the workflow
no longer references actions/cache/restore@v5; update the `uses` reference to
the action's immutable full commit SHA (e.g.,
`actions/cache/restore@<full-commit-sha>`) to pin the exact release, ensuring
any invocation of the actions/cache/restore step uses the commit SHA instead of
the `v5` tag.
In @.github/workflows/cadmus-docs.yml:
- Line 76: The workflow currently references the reusable action with a floating
tag "actions/cache/restore@v5"; replace that reference with a full immutable
commit SHA (e.g. actions/cache/restore@<full-commit-sha>) to prevent
supply-chain drift by finding the corresponding commit in the actions/cache
repository and using its SHA in place of "`@v5`".
In @.github/workflows/cargo.yml:
- Around line 162-166: The workflow currently guards the "cargo xtask
download-assets" step with "if: steps.cache.outputs.cache-hit != 'true'",
causing the Kobo warmup (the "Warmup build (native)" step and any subsequent
"cargo xtask build-kobo" runs) to proceed with a stale asset list; remove the
conditional so cargo xtask download-assets runs unconditionally and ensure this
step precedes the Warmup build (native) and the cargo xtask build-kobo
invocation to keep the generated asset list accurate.
- Line 112: The workflow uses mutable action tags (actions/cache@v5,
actions/cache/restore@v5, and awalsh128/cache-apt-pkgs-action@latest); replace
each `uses:` entry with the corresponding repository@<commit-sha> pinned to a
specific immutable commit SHA (for example, actions/cache@<sha>,
actions/cache/restore@<sha>, and awalsh128/cache-apt-pkgs-action@<sha>) so all
occurrences of those three references in the file are updated to their
respective commit SHAs to eliminate mutable tags.
In @.github/workflows/release.yml:
- Line 78: Replace the mutable action ref "actions/cache/restore@v5" with an
immutable full commit SHA (or digest) to prevent upstream drift; locate the
occurrence of the string "actions/cache/restore@v5" in the workflow and update
it to the pinned form "actions/cache/restore@<full-commit-sha>" (obtain the SHA
from the action's repository tags or GitHub UI), and apply the same pinning
pattern to any other workflows that use this mutable ref.
In `@crates/build-deps/src/build/kobo/mupdf.rs`:
- Around line 95-103: The cleanup loop that iterates over std::fs::read_dir in
mupdf.rs swallows errors by calling .ok() on std::fs::remove_dir_all and
std::fs::remove_file; change these to propagate failures so cleanup errors fail
fast (e.g., replace .ok() with ? or convert the error into a descriptive Err)
for the remove_dir_all and remove_file calls inside the loop so any deletion
failure returns from the surrounding function instead of being ignored.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: a7b36195-19c6-49ba-8be8-ff4a5694e6f6
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (75)
.devin/wiki.json.github/actions/build-kobo/action.yml.github/actions/cache-thirdparty/action.yml.github/workflows/build-release-candidate.yml.github/workflows/cadmus-docs.yml.github/workflows/cargo.yml.github/workflows/copilot-setup-steps.yml.github/workflows/release.yml.gitmodulesCargo.tomlbuild-scripts/djvulibre/kobo.patchbuild-scripts/harfbuzz/kobo-options.txtbuild-scripts/harfbuzz/kobo.patchbuild-scripts/mupdf/README.mdbuild-scripts/mupdf/kobo.patchbuild-scripts/mupdf/webp-image-h-kobo.patchbuild-scripts/mupdf/webp-load-webp-deviations-kobo.patchbuild-scripts/mupdf/webp-upstream-697749-kobo.patchcrates/build-deps/Cargo.tomlcrates/build-deps/src/build/kobo.rscrates/build-deps/src/build/kobo/mupdf.rscrates/build-deps/src/build/kobo/recipes.rscrates/build-deps/src/build/kobo/source.rscrates/build-deps/src/build/mod.rscrates/build-deps/src/build/mupdf.rscrates/build-deps/src/build/mupdf_wrapper.rscrates/build-deps/src/build/native.rscrates/build-deps/src/cmd.rscrates/build-deps/src/lib.rscrates/build-deps/src/markers.rscrates/build-deps/src/versions.rscrates/cadmus/Cargo.tomlcrates/core/Cargo.tomlcrates/core/build.rscrates/emulator/Cargo.tomlcrates/fetcher/Cargo.tomlcrates/importer/Cargo.tomlrenovate.jsonthirdparty/bzip2thirdparty/bzip2/Makefile-kobothirdparty/bzip2/build-kobo.shthirdparty/djvulibrethirdparty/djvulibre/build-kobo.shthirdparty/freetype2thirdparty/freetype2/build-kobo.shthirdparty/gumbothirdparty/gumbo/build-kobo.shthirdparty/harfbuzzthirdparty/harfbuzz/build-kobo.shthirdparty/jbig2decthirdparty/jbig2dec/build-kobo.shthirdparty/libjpegthirdparty/libjpeg/build-kobo.shthirdparty/libpngthirdparty/libpng/build-kobo.shthirdparty/libwebpthirdparty/libwebp/build-kobo.shthirdparty/mupdfthirdparty/mupdf/build-kobo.shthirdparty/openjpegthirdparty/openjpeg/build-kobo.shthirdparty/zlibthirdparty/zlib/build-kobo.shxtask/Cargo.tomlxtask/src/lib.rsxtask/src/tasks/build_kobo.rsxtask/src/tasks/dist.rsxtask/src/tasks/docs.rsxtask/src/tasks/install_importer.rsxtask/src/tasks/mod.rsxtask/src/tasks/run_emulator.rsxtask/src/tasks/setup_native.rsxtask/src/tasks/util/mod.rsxtask/src/tasks/util/mupdf_wrapper.rsxtask/src/tasks/util/thirdparty.rs
💤 Files with no reviewable changes (19)
- thirdparty/zlib/build-kobo.sh
- xtask/src/tasks/mod.rs
- thirdparty/harfbuzz/build-kobo.sh
- xtask/src/tasks/util/mupdf_wrapper.rs
- thirdparty/djvulibre/build-kobo.sh
- thirdparty/openjpeg/build-kobo.sh
- thirdparty/libjpeg/build-kobo.sh
- thirdparty/bzip2/build-kobo.sh
- thirdparty/gumbo/build-kobo.sh
- thirdparty/bzip2/Makefile-kobo
- xtask/src/tasks/util/mod.rs
- thirdparty/libwebp/build-kobo.sh
- thirdparty/mupdf/build-kobo.sh
- thirdparty/libpng/build-kobo.sh
- thirdparty/jbig2dec/build-kobo.sh
- xtask/src/tasks/util/thirdparty.rs
- .github/actions/cache-thirdparty/action.yml
- xtask/src/tasks/setup_native.rs
- thirdparty/freetype2/build-kobo.sh
✅ Files skipped from review due to trivial changes (8)
- thirdparty/bzip2
- thirdparty/harfbuzz
- crates/importer/Cargo.toml
- xtask/Cargo.toml
- thirdparty/libpng
- crates/cadmus/Cargo.toml
- .devin/wiki.json
- Cargo.toml
🚧 Files skipped from review as they are similar to previous changes (33)
- thirdparty/gumbo
- thirdparty/openjpeg
- crates/build-deps/Cargo.toml
- thirdparty/jbig2dec
- crates/emulator/Cargo.toml
- .github/workflows/copilot-setup-steps.yml
- thirdparty/libwebp
- crates/fetcher/Cargo.toml
- xtask/src/tasks/dist.rs
- thirdparty/libjpeg
- xtask/src/tasks/docs.rs
- .gitmodules
- thirdparty/mupdf
- thirdparty/zlib
- crates/build-deps/src/build/mod.rs
- thirdparty/djvulibre
- .github/actions/build-kobo/action.yml
- crates/core/Cargo.toml
- xtask/src/tasks/install_importer.rs
- crates/build-deps/src/build/mupdf_wrapper.rs
- crates/build-deps/src/versions.rs
- thirdparty/freetype2
- xtask/src/lib.rs
- crates/build-deps/src/markers.rs
- crates/build-deps/src/build/kobo/source.rs
- crates/build-deps/src/build/mupdf.rs
- crates/build-deps/src/lib.rs
- crates/build-deps/src/cmd.rs
- renovate.json
- crates/build-deps/src/build/kobo.rs
- crates/build-deps/src/build/native.rs
- crates/core/build.rs
- crates/build-deps/src/build/kobo/recipes.rs
📜 Review details
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (38)
- GitHub Check: test (profiling + tracing, ubuntu-latest)
- GitHub Check: test (emulator + kobo + test, ubuntu-latest)
- GitHub Check: test (emulator + kobo + profiling + tracing, ubuntu-latest)
- GitHub Check: test (kobo + tracing, ubuntu-latest)
- GitHub Check: test (emulator, ubuntu-latest)
- GitHub Check: test (emulator + profiling, ubuntu-latest)
- GitHub Check: test (emulator + test, ubuntu-latest)
- GitHub Check: test (emulator + kobo + profiling, ubuntu-latest)
- GitHub Check: test (kobo + profiling, ubuntu-latest)
- GitHub Check: test (emulator + kobo, ubuntu-latest)
- GitHub Check: clippy (emulator + profiling + test + tracing, ubuntu-latest)
- GitHub Check: test (profiling, ubuntu-latest)
- GitHub Check: test (default, ubuntu-latest)
- GitHub Check: clippy (emulator + kobo + test + tracing, ubuntu-latest)
- GitHub Check: clippy (emulator + kobo + tracing, ubuntu-latest)
- GitHub Check: clippy (emulator + kobo + test, ubuntu-latest)
- GitHub Check: clippy (kobo + profiling + tracing, ubuntu-latest)
- GitHub Check: clippy (emulator + profiling + tracing, ubuntu-latest)
- GitHub Check: clippy (profiling + test, ubuntu-latest)
- GitHub Check: clippy (test + tracing, ubuntu-latest)
- GitHub Check: clippy (profiling + tracing, ubuntu-latest)
- GitHub Check: clippy (tracing, ubuntu-latest)
- GitHub Check: clippy (emulator + kobo + profiling + test, ubuntu-latest)
- GitHub Check: clippy (emulator + profiling + test, ubuntu-latest)
- GitHub Check: clippy (kobo + profiling + test, ubuntu-latest)
- GitHub Check: clippy (kobo + tracing, ubuntu-latest)
- GitHub Check: clippy (test, ubuntu-latest)
- GitHub Check: clippy (emulator + kobo + profiling, ubuntu-latest)
- GitHub Check: clippy (emulator + test, ubuntu-latest)
- GitHub Check: clippy (kobo + profiling, ubuntu-latest)
- GitHub Check: clippy (profiling, ubuntu-latest)
- GitHub Check: clippy (kobo, ubuntu-latest)
- GitHub Check: clippy (default, ubuntu-latest)
- GitHub Check: clippy (emulator + kobo, ubuntu-latest)
- GitHub Check: clippy (emulator + profiling, ubuntu-latest)
- GitHub Check: clippy (emulator, ubuntu-latest)
- GitHub Check: build-kobo
- GitHub Check: build-kobo-test
🧰 Additional context used
📓 Path-based instructions (2)
**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
**/*.rs: Prefer?operator overunwrap()/expect()in library and app code
Usethiserrorfor custom error types andanyhowfor ad-hoc errors in Rust
Use iterators over index-based loops in Rust
Use&stroverStringin function parameters when ownership is not needed
Prefer borrowing over cloning in Rust
Inline expressions directly into struct fields — avoid intermediate bindings solely to pass them into a struct literal
Avoidunsafeunless required and documented in Rust
Avoid prematurecollect()— keep iterators lazy in Rust
Ensure Rust code compiles without warnings
Prefer newtype wrappers over raw primitives for domain concepts (e.g.,Fingerprint(String)instead of bareString)
WrapString,i64, and similar primitives when the value represents a specific domain concept (fingerprints, file kinds, identifiers, etc.)
ImplementDisplay,FromStr, and other standard traits on newtype wrappers to keep them ergonomic
Match on enum variants instead of string comparisons — the compiler catches missing arms
Comment why, not what. Avoid inline comments — extract code into well-named, documented functions instead
Avoid dead-code comments (commented-out code) in Rust
Avoid changelog comments (Modified by X on date) in Rust
Avoid divider comments (//=====) in Rust
Annotations (TODO,FIXME,HACK,NOTE) are acceptable with context in Rust
Use structured fields with thetracingcrate — never use string formatting for log data
Use only structured fields for logging — data goes in fields, not format strings
Do not use module prefixes in logs — instrumentation scope provides context
Do not mix structured fields with format arguments in logging
Usedebuglog level for development and troubleshooting detail
Useinfolog level for important runtime events
Usewarnlog level for recoverable issues (retries, fallbacks)
Useerrorlog level for failures requiring attention
Return domain types directly from sqlx queries instead of parsin...
Files:
xtask/src/tasks/run_emulator.rsxtask/src/tasks/build_kobo.rscrates/build-deps/src/build/kobo/mupdf.rs
.github/workflows/cargo.yml
📄 CodeRabbit inference engine (AGENTS.md)
.github/workflows/cargo.yml: Theclippyandtestjobs in.github/workflows/cargo.ymluse a matrix to check every feature flag individually and in combination
For workspace-wide feature flags in CI, use--workspace --all-targets --features <name>in.github/workflows/cargo.yml
For crate-specific feature flags in CI, use-p <crate> --all-targets --features <name>in.github/workflows/cargo.yml
All feature flag combinations should run onubuntu-latestin.github/workflows/cargo.yml
Onlydefaultandtestfeatures should produce build artifacts in.github/workflows/cargo.yml
Files:
.github/workflows/cargo.yml
🧠 Learnings (17)
📓 Common learnings
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: thirdparty/AGENTS.md:0-0
Timestamp: 2026-05-27T15:13:37.212Z
Learning: Applies to thirdparty/**/thirdparty/*/{build-kobo.sh,*-kobo.patch} : Prefer using kobo.patch for working around upstream issues rather than modifying build-kobo.sh — patches make the delta explicit and reviewable
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-28T14:01:38.823Z
Learning: In CI, `cargo xtask download-assets` must run before `cargo xtask build-kobo` so the generated asset list stays accurate
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: thirdparty/AGENTS.md:0-0
Timestamp: 2026-05-27T15:13:37.212Z
Learning: Applies to thirdparty/xtask/src/tasks/util/thirdparty.rs : Library versions must be defined as constants in xtask/src/tasks/util/thirdparty.rs — never hard-code URLs in build scripts
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: thirdparty/AGENTS.md:0-0
Timestamp: 2026-05-27T15:13:37.212Z
Learning: Applies to thirdparty/xtask/src/tasks/util/thirdparty.rs : Respect the build order defined by LIBRARY_NAMES in xtask/src/tasks/util/thirdparty.rs — libraries later in the list may link against earlier ones, and new libraries must be inserted at the correct position
Learnt from: OGKevin
Repo: OGKevin/cadmus PR: 511
File: crates/core/build.rs:129-131
Timestamp: 2026-05-25T12:43:50.793Z
Learning: In `crates/core/build.rs`, the `generate_bundled_assets()` function intentionally skips missing asset directories (`if !dir.exists() { return; }`) to support emulator/non-Kobo builds where OTA is not used and asset directories may not be present. Any fail-fast guard for missing required directories (e.g., `bin/`, `resources/`, `hyphenation-patterns/`) should be gated on the Kobo target (`TARGET == "arm-unknown-linux-gnueabihf"`) to avoid breaking emulator builds.
📚 Learning: 2026-05-28T14:01:38.823Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-28T14:01:38.823Z
Learning: After modifying `Cargo.toml`, run `cargo xtask clippy` and `cargo xtask test --features default`
Applied to files:
xtask/src/tasks/run_emulator.rsxtask/src/tasks/build_kobo.rs.github/workflows/cargo.yml
📚 Learning: 2026-05-25T12:43:50.793Z
Learnt from: OGKevin
Repo: OGKevin/cadmus PR: 511
File: crates/core/build.rs:129-131
Timestamp: 2026-05-25T12:43:50.793Z
Learning: In `crates/core/build.rs`, the `generate_bundled_assets()` function intentionally skips missing asset directories (`if !dir.exists() { return; }`) to support emulator/non-Kobo builds where OTA is not used and asset directories may not be present. Any fail-fast guard for missing required directories (e.g., `bin/`, `resources/`, `hyphenation-patterns/`) should be gated on the Kobo target (`TARGET == "arm-unknown-linux-gnueabihf"`) to avoid breaking emulator builds.
Applied to files:
xtask/src/tasks/run_emulator.rsxtask/src/tasks/build_kobo.rscrates/build-deps/src/build/kobo/mupdf.rs
📚 Learning: 2026-05-28T14:01:38.823Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-28T14:01:38.823Z
Learning: Applies to .github/workflows/cargo.yml : For crate-specific feature flags in CI, use `-p <crate> --all-targets --features <name>` in `.github/workflows/cargo.yml`
Applied to files:
xtask/src/tasks/run_emulator.rs.github/workflows/build-release-candidate.yml.github/workflows/cargo.yml.github/workflows/release.yml
📚 Learning: 2026-05-27T15:13:37.212Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: thirdparty/AGENTS.md:0-0
Timestamp: 2026-05-27T15:13:37.212Z
Learning: Applies to thirdparty/xtask/src/tasks/util/thirdparty.rs : Library versions must be defined as constants in xtask/src/tasks/util/thirdparty.rs — never hard-code URLs in build scripts
Applied to files:
xtask/src/tasks/run_emulator.rsxtask/src/tasks/build_kobo.rs
📚 Learning: 2026-05-28T14:01:38.823Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-28T14:01:38.823Z
Learning: Applies to .github/workflows/cargo.yml : For workspace-wide feature flags in CI, use `--workspace --all-targets --features <name>` in `.github/workflows/cargo.yml`
Applied to files:
xtask/src/tasks/run_emulator.rs.github/workflows/build-release-candidate.yml.github/workflows/cadmus-docs.yml.github/workflows/cargo.yml.github/workflows/release.yml
📚 Learning: 2026-05-28T14:01:38.823Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-28T14:01:38.823Z
Learning: Applies to .github/workflows/cargo.yml : The `clippy` and `test` jobs in `.github/workflows/cargo.yml` use a matrix to check every feature flag individually and in combination
Applied to files:
xtask/src/tasks/run_emulator.rs.github/workflows/build-release-candidate.yml.github/workflows/cargo.yml.github/workflows/release.yml
📚 Learning: 2026-05-28T14:01:38.823Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-28T14:01:38.823Z
Learning: In CI, `cargo xtask download-assets` must run before `cargo xtask build-kobo` so the generated asset list stays accurate
Applied to files:
xtask/src/tasks/build_kobo.rs.github/workflows/build-release-candidate.yml.github/workflows/cargo.yml
📚 Learning: 2026-05-27T15:13:37.212Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: thirdparty/AGENTS.md:0-0
Timestamp: 2026-05-27T15:13:37.212Z
Learning: Applies to thirdparty/**/thirdparty/*/{build-kobo.sh,*-kobo.patch} : Prefer using kobo.patch for working around upstream issues rather than modifying build-kobo.sh — patches make the delta explicit and reviewable
Applied to files:
xtask/src/tasks/build_kobo.rs.github/workflows/cargo.yml
📚 Learning: 2026-05-27T15:13:37.212Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: thirdparty/AGENTS.md:0-0
Timestamp: 2026-05-27T15:13:37.212Z
Learning: Applies to thirdparty/xtask/src/tasks/util/thirdparty.rs : Respect the build order defined by LIBRARY_NAMES in xtask/src/tasks/util/thirdparty.rs — libraries later in the list may link against earlier ones, and new libraries must be inserted at the correct position
Applied to files:
xtask/src/tasks/build_kobo.rs
📚 Learning: 2026-05-26T20:10:56.991Z
Learnt from: OGKevin
Repo: OGKevin/cadmus PR: 456
File: crates/core/src/document/mupdf_sys.rs:7-10
Timestamp: 2026-05-26T20:10:56.991Z
Learning: In `crates/core/src/document/mupdf_sys.rs` (OGKevin/cadmus), the project owner prefers safety/soundness documentation for unsafe code to be written as `///` Rust doc comments on the function (so they appear in generated rustdoc), rather than as inline `// SAFETY:` comments inside the unsafe block.
Applied to files:
crates/build-deps/src/build/kobo/mupdf.rs
📚 Learning: 2026-05-28T14:01:38.823Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-28T14:01:38.823Z
Learning: Applies to .github/workflows/cargo.yml : Only `default` and `test` features should produce build artifacts in `.github/workflows/cargo.yml`
Applied to files:
.github/workflows/build-release-candidate.yml.github/workflows/cadmus-docs.yml.github/workflows/cargo.yml.github/workflows/release.yml
📚 Learning: 2026-05-28T14:01:38.823Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-28T14:01:38.823Z
Learning: Applies to .github/workflows/cargo.yml : All feature flag combinations should run on `ubuntu-latest` in `.github/workflows/cargo.yml`
Applied to files:
.github/workflows/cargo.yml.github/workflows/release.yml
📚 Learning: 2026-05-28T14:01:38.823Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-28T14:01:38.823Z
Learning: When adding a new feature flag, add it to the relevant `Cargo.toml` and update `.github/workflows/cargo.yml` with matrix entries for both the feature alone and combined with every other feature
Applied to files:
.github/workflows/cargo.yml
📚 Learning: 2026-05-27T15:13:37.212Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: thirdparty/AGENTS.md:0-0
Timestamp: 2026-05-27T15:13:37.212Z
Learning: Applies to thirdparty/**/thirdparty/*/+(build-kobo.sh|kobo.patch|*-kobo.patch|README-kobo.md|README-cadmus.md|Makefile-kobo) : Each library subdirectory may contain build-kobo.sh, kobo.patch, *-kobo.patch files, README-kobo.md, README-cadmus.md, and additional build system files
Applied to files:
.github/workflows/cargo.yml
📚 Learning: 2026-05-27T15:13:37.212Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: thirdparty/AGENTS.md:0-0
Timestamp: 2026-05-27T15:13:37.212Z
Learning: Applies to thirdparty/**/thirdparty/** : Build scripts and patches for third-party libraries must be placed in the thirdparty directory, with no downloaded source trees committed — only build scripts and patches
Applied to files:
.github/workflows/cargo.yml
📚 Learning: 2026-05-28T14:01:38.823Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-28T14:01:38.823Z
Learning: Applies to **/*.rs : Ensure Rust code compiles without warnings
Applied to files:
.github/workflows/cargo.yml
🪛 Betterleaks (1.3.1)
.github/workflows/cargo.yml
[high] 115-115: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
🪛 GitHub Actions: PR `#571` / 0_Analyze (rust).txt
crates/build-deps/src/build/kobo/mupdf.rs
[warning] 41-41: CodeQL rust autobuild warning: macro expansion failed for 'format'.
[warning] 55-55: CodeQL rust autobuild warning: macro expansion failed for 'vec'.
[warning] 157-157: CodeQL rust autobuild warning: macro expansion failed for 'format'.
[warning] 204-204: CodeQL rust autobuild warning: macro expansion failed for 'assert'.
[warning] 205-205: CodeQL rust autobuild warning: macro expansion failed for 'assert'.
[warning] 212-212: CodeQL rust autobuild warning: macro expansion failed for 'assert'.
🪛 GitHub Actions: PR `#571` / Analyze (rust)
crates/build-deps/src/build/kobo/mupdf.rs
[warning] 41-41: CodeQL Rust extraction: macro expansion failed for 'format'
[warning] 55-55: CodeQL Rust extraction: macro expansion failed for 'vec'
[warning] 157-157: CodeQL Rust extraction: macro expansion failed for 'format'
[warning] 204-204: CodeQL Rust extraction: macro expansion failed for 'assert'
[warning] 205-205: CodeQL Rust extraction: macro expansion failed for 'assert'
[warning] 212-212: CodeQL Rust extraction: macro expansion failed for 'assert'
🪛 zizmor (1.25.2)
.github/workflows/build-release-candidate.yml
[error] 51-51: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
.github/workflows/cadmus-docs.yml
[error] 76-76: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
.github/workflows/cargo.yml
[error] 106-106: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
[error] 112-112: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
[error] 106-106: runtime artifacts potentially vulnerable to a cache poisoning attack (cache-poisoning): always restores from cache
(cache-poisoning)
[error] 112-112: runtime artifacts potentially vulnerable to a cache poisoning attack (cache-poisoning): enables caching by default
(cache-poisoning)
[error] 142-142: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
[error] 154-154: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
[error] 142-142: runtime artifacts potentially vulnerable to a cache poisoning attack (cache-poisoning): enables caching by default
(cache-poisoning)
[error] 301-301: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
.github/workflows/release.yml
[error] 78-78: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
🔇 Additional comments (2)
xtask/src/tasks/run_emulator.rs (1)
3-5: LGTM!Also applies to: 33-33
xtask/src/tasks/build_kobo.rs (1)
3-19: LGTM!Also applies to: 24-27, 41-47, 102-103
Change-Id: b03e8f80c2eab7a3d9fedc4c8892c1cb Change-Id-Short: ozwlrkrznxlp
c41f0f0 to
56568ac
Compare
There was a problem hiding this comment.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/cargo.yml (1)
12-20:⚠️ Potential issue | 🟠 Major | ⚡ Quick winInclude submodule-backed build inputs in
pull_request.paths.Right now a PR that only bumps a third-party submodule revision, updates
.gitmodules, or changesmupdf_wrapper/mupdf_wrapper.ccan skip this workflow entirely, even though those inputs now affect the native/Kobo build path. That leaves a straight path for dependency-source changes to merge without running the cargo/clippy/test/build-kobo checks.Suggested fix
pull_request: paths: - "**/*.rs" - "Cargo.*" - "**/Cargo.*" - ".github/workflows/cargo.yml" - ".github/actions/build-kobo/**" - ".github/actions/build-docs-epub/**" - ".github/actions/install-doc-tools/**" - "build-scripts/**" + - ".gitmodules" + - "mupdf_wrapper/**" + - "thirdparty/**"🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/cargo.yml around lines 12 - 20, The pull_request.paths list omits submodule-backed inputs so PRs that only change submodule refs, .gitmodules, or files inside submodule trees can skip the workflow; update the pull_request.paths array to include patterns that cover .gitmodules and any submodule directories and their files (for example add "**/.gitmodules", "mupdf_wrapper/**", "third_party/**" or the actual submodule directory globs and specific files like "mupdf_wrapper/mupdf_wrapper.c") so changes to submodule refs or files will trigger the cargo/clippy/test/build-kobo workflow; ensure the new patterns are added alongside the existing entries under pull_request.paths.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/cargo.yml:
- Around line 48-50: The cache key currently uses hashFiles(...) including
'.gitmodules' but misses submodule gitlink revisions; update the cache key
generation (the key and restore-keys that reference
steps.rust-toolchain.outputs.cachekey and the hashFiles(...) list) to
incorporate actual submodule commit SHAs (for example by adding the output of a
job/step that runs a Git command such as git submodule status --recursive or git
ls-tree/ rev-parse per submodule and exposing that as a step output) so the
produced cache key changes when submodule revisions change; ensure both the
primary key and restore-keys include that new submodule-derived value.
In `@crates/build-deps/src/build/native.rs`:
- Around line 61-95: The cache marker check in ensure_native_artifacts allows
stale MuPDF outputs to bypass version and patch validation; update
ensure_native_artifacts to revalidate the cached mupdf build before taking the
fast path: call read_mupdf_version(&version_header) (compare to MUPDF_VERSION)
and run mupdf::apply_webp_patches_if_needed(&mupdf_build, root) even when
native_cache_complete(root) is true (or alternatively include the MUPDF_VERSION
in the cache marker when creating it), and if validation fails fall back to
copying/building (build_mupdf_native, kobo::cp_r) and update the marker so
link_mupdf_artifacts always sees a current, validated tree.
- Around line 179-186: The final ranlib invocation is hard-coded to "ranlib";
instead use the resolved RANLIB that combine_libwebp_static_archives() already
determines. Modify the code that currently calls cmd::run("ranlib", ...) to pass
the resolved ranlib command (e.g., a variable named ranlib or ranlib_cmd
returned/available from combine_libwebp_static_archives() or the surrounding
scope) so cmd::run(&ranlib, ...) is used and retain the same args and
context/error handling.
In `@crates/core/build.rs`:
- Around line 91-100: The native branch can run when HOST != TARGET causing
native::ensure_native_artifacts (which writes wrapper artifacts under the host
directory) and emit_native_link_directives (which reads the target directory) to
disagree; add a guard after computing target that compares the build host and
target (e.g. env::var("HOST") vs env::var("TARGET")) and return an Err or bail
with a clear context if they differ before calling
native::ensure_native_artifacts or emit_native_link_directives; update the
branch around skip_thirdparty_deps()/native::ensure_native_artifacts and
emit_native_link_directives to perform this host==target check to fail fast.
---
Outside diff comments:
In @.github/workflows/cargo.yml:
- Around line 12-20: The pull_request.paths list omits submodule-backed inputs
so PRs that only change submodule refs, .gitmodules, or files inside submodule
trees can skip the workflow; update the pull_request.paths array to include
patterns that cover .gitmodules and any submodule directories and their files
(for example add "**/.gitmodules", "mupdf_wrapper/**", "third_party/**" or the
actual submodule directory globs and specific files like
"mupdf_wrapper/mupdf_wrapper.c") so changes to submodule refs or files will
trigger the cargo/clippy/test/build-kobo workflow; ensure the new patterns are
added alongside the existing entries under pull_request.paths.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: 0bb42230-a54b-49ae-96a2-29879d0a9c59
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (75)
.devin/wiki.json.github/actions/build-kobo/action.yml.github/actions/cache-thirdparty/action.yml.github/workflows/build-release-candidate.yml.github/workflows/cadmus-docs.yml.github/workflows/cargo.yml.github/workflows/copilot-setup-steps.yml.github/workflows/release.yml.gitmodulesCargo.tomlbuild-scripts/djvulibre/kobo.patchbuild-scripts/harfbuzz/kobo-options.txtbuild-scripts/harfbuzz/kobo.patchbuild-scripts/mupdf/README.mdbuild-scripts/mupdf/kobo.patchbuild-scripts/mupdf/webp-image-h-kobo.patchbuild-scripts/mupdf/webp-load-webp-deviations-kobo.patchbuild-scripts/mupdf/webp-upstream-697749-kobo.patchcrates/build-deps/Cargo.tomlcrates/build-deps/src/build/kobo.rscrates/build-deps/src/build/kobo/mupdf.rscrates/build-deps/src/build/kobo/recipes.rscrates/build-deps/src/build/kobo/source.rscrates/build-deps/src/build/mod.rscrates/build-deps/src/build/mupdf.rscrates/build-deps/src/build/mupdf_wrapper.rscrates/build-deps/src/build/native.rscrates/build-deps/src/cmd.rscrates/build-deps/src/lib.rscrates/build-deps/src/markers.rscrates/build-deps/src/versions.rscrates/cadmus/Cargo.tomlcrates/core/Cargo.tomlcrates/core/build.rscrates/emulator/Cargo.tomlcrates/fetcher/Cargo.tomlcrates/importer/Cargo.tomlrenovate.jsonthirdparty/bzip2thirdparty/bzip2/Makefile-kobothirdparty/bzip2/build-kobo.shthirdparty/djvulibrethirdparty/djvulibre/build-kobo.shthirdparty/freetype2thirdparty/freetype2/build-kobo.shthirdparty/gumbothirdparty/gumbo/build-kobo.shthirdparty/harfbuzzthirdparty/harfbuzz/build-kobo.shthirdparty/jbig2decthirdparty/jbig2dec/build-kobo.shthirdparty/libjpegthirdparty/libjpeg/build-kobo.shthirdparty/libpngthirdparty/libpng/build-kobo.shthirdparty/libwebpthirdparty/libwebp/build-kobo.shthirdparty/mupdfthirdparty/mupdf/build-kobo.shthirdparty/openjpegthirdparty/openjpeg/build-kobo.shthirdparty/zlibthirdparty/zlib/build-kobo.shxtask/Cargo.tomlxtask/src/lib.rsxtask/src/tasks/build_kobo.rsxtask/src/tasks/dist.rsxtask/src/tasks/docs.rsxtask/src/tasks/install_importer.rsxtask/src/tasks/mod.rsxtask/src/tasks/run_emulator.rsxtask/src/tasks/setup_native.rsxtask/src/tasks/util/mod.rsxtask/src/tasks/util/mupdf_wrapper.rsxtask/src/tasks/util/thirdparty.rs
💤 Files with no reviewable changes (19)
- thirdparty/djvulibre/build-kobo.sh
- thirdparty/gumbo/build-kobo.sh
- thirdparty/libpng/build-kobo.sh
- thirdparty/libwebp/build-kobo.sh
- thirdparty/libjpeg/build-kobo.sh
- thirdparty/mupdf/build-kobo.sh
- thirdparty/bzip2/Makefile-kobo
- thirdparty/jbig2dec/build-kobo.sh
- thirdparty/zlib/build-kobo.sh
- thirdparty/harfbuzz/build-kobo.sh
- thirdparty/openjpeg/build-kobo.sh
- xtask/src/tasks/util/mupdf_wrapper.rs
- xtask/src/tasks/mod.rs
- xtask/src/tasks/util/mod.rs
- .github/actions/cache-thirdparty/action.yml
- xtask/src/tasks/setup_native.rs
- thirdparty/freetype2/build-kobo.sh
- xtask/src/tasks/util/thirdparty.rs
- thirdparty/bzip2/build-kobo.sh
✅ Files skipped from review due to trivial changes (8)
- crates/cadmus/Cargo.toml
- thirdparty/jbig2dec
- Cargo.toml
- crates/importer/Cargo.toml
- thirdparty/mupdf
- crates/emulator/Cargo.toml
- thirdparty/djvulibre
- .devin/wiki.json
🚧 Files skipped from review as they are similar to previous changes (36)
- thirdparty/zlib
- thirdparty/gumbo
- thirdparty/libwebp
- .gitmodules
- thirdparty/bzip2
- thirdparty/harfbuzz
- thirdparty/openjpeg
- crates/fetcher/Cargo.toml
- xtask/src/tasks/docs.rs
- thirdparty/libjpeg
- thirdparty/libpng
- crates/core/Cargo.toml
- .github/workflows/cadmus-docs.yml
- xtask/src/tasks/dist.rs
- crates/build-deps/Cargo.toml
- thirdparty/freetype2
- xtask/Cargo.toml
- xtask/src/tasks/install_importer.rs
- .github/workflows/copilot-setup-steps.yml
- crates/build-deps/src/lib.rs
- .github/workflows/build-release-candidate.yml
- .github/workflows/release.yml
- crates/build-deps/src/build/mod.rs
- crates/build-deps/src/cmd.rs
- .github/actions/build-kobo/action.yml
- crates/build-deps/src/versions.rs
- crates/build-deps/src/build/kobo/source.rs
- xtask/src/lib.rs
- crates/build-deps/src/build/mupdf_wrapper.rs
- xtask/src/tasks/run_emulator.rs
- crates/build-deps/src/markers.rs
- crates/build-deps/src/build/mupdf.rs
- crates/build-deps/src/build/kobo/mupdf.rs
- crates/build-deps/src/build/kobo.rs
- xtask/src/tasks/build_kobo.rs
- crates/build-deps/src/build/kobo/recipes.rs
📜 Review details
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: cache-warmup
- GitHub Check: build
🧰 Additional context used
📓 Path-based instructions (5)
.github/workflows/cargo.yml
📄 CodeRabbit inference engine (AGENTS.md)
.github/workflows/cargo.yml: Theclippyandtestjobs in.github/workflows/cargo.ymluse a matrix to check every feature flag individually and in combination
For workspace-wide feature flags in CI, use--workspace --all-targets --features <name>in.github/workflows/cargo.yml
For crate-specific feature flags in CI, use-p <crate> --all-targets --features <name>in.github/workflows/cargo.yml
All feature flag combinations should run onubuntu-latestin.github/workflows/cargo.yml
Onlydefaultandtestfeatures should produce build artifacts in.github/workflows/cargo.yml
Files:
.github/workflows/cargo.yml
crates/core/**/*.rs
📄 CodeRabbit inference engine (crates/core/AGENTS.md)
crates/core/**/*.rs: Rustdoc examples should follow this preference order: fully compilable >no_run>ignore. Useno_runwhen the example compiles but cannot execute (file I/O, network, database). Useignoreonly for private/pub(crate)items unreachable from the test harness with a comment explaining why. Use#to hide boilerplate setup lines. Verify withcargo test --doc.
Use typed SQL macros (sqlx::query!,sqlx::query_as!,sqlx::query_scalar!) in Rust code. Never use untypedsqlx::query()/sqlx::query_as()/sqlx::query_scalar(). Use.flatten()onquery_scalar!results for nullable columns (Option<Option<T>>→Option<T>).
Untyped SQL queries are allowed only for dynamic SQL (e.g. runtimeORDER BYcolumn) if and only if the function has unit tests covering every dynamic path, with a comment explaining why the typed macro cannot be used.
All user-visible strings must use thefl!macro (use crate::fl;). Never hardcode string literals for labels, buttons, placeholders, or notifications. User-visible strings include:label()implementations onSettingKindtraits, input fieldlabelstrings inEvent::OpenNamedInput, menu entry text (EntryKind::Command,EntryKind::RadioButton, etc.), and button labels, notification text.
Files:
crates/core/build.rs
crates/core/**/*.{sql,rs}
📄 CodeRabbit inference engine (crates/core/AGENTS.md)
All SQL queries must list explicit column names. Do not use
SELECT *.
Files:
crates/core/build.rs
crates/core/**/*.{ftl,rs}
📄 CodeRabbit inference engine (crates/core/AGENTS.md)
Every user-visible string needs a Fluent message ID in
crates/core/i18n/en-GB/cadmus_core.ftl. Usefl!("message-id")at the call site. For parameterised strings, use Fluent variables ({ $var }) in the.ftlfile and pass values viafl!("id", var = value).
Files:
crates/core/build.rs
**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
**/*.rs: Prefer?operator overunwrap()/expect()in library and app code
Usethiserrorfor custom error types andanyhowfor ad-hoc errors in Rust
Use iterators over index-based loops in Rust
Use&stroverStringin function parameters when ownership is not needed
Prefer borrowing over cloning in Rust
Inline expressions directly into struct fields — avoid intermediate bindings solely to pass them into a struct literal
Avoidunsafeunless required and documented in Rust
Avoid prematurecollect()— keep iterators lazy in Rust
Ensure Rust code compiles without warnings
Prefer newtype wrappers over raw primitives for domain concepts (e.g.,Fingerprint(String)instead of bareString)
WrapString,i64, and similar primitives when the value represents a specific domain concept (fingerprints, file kinds, identifiers, etc.)
ImplementDisplay,FromStr, and other standard traits on newtype wrappers to keep them ergonomic
Match on enum variants instead of string comparisons — the compiler catches missing arms
Comment why, not what. Avoid inline comments — extract code into well-named, documented functions instead
Avoid dead-code comments (commented-out code) in Rust
Avoid changelog comments (Modified by X on date) in Rust
Avoid divider comments (//=====) in Rust
Annotations (TODO,FIXME,HACK,NOTE) are acceptable with context in Rust
Use structured fields with thetracingcrate — never use string formatting for log data
Use only structured fields for logging — data goes in fields, not format strings
Do not use module prefixes in logs — instrumentation scope provides context
Do not mix structured fields with format arguments in logging
Usedebuglog level for development and troubleshooting detail
Useinfolog level for important runtime events
Usewarnlog level for recoverable issues (retries, fallbacks)
Useerrorlog level for failures requiring attention
Return domain types directly from sqlx queries instead of parsin...
Files:
crates/core/build.rscrates/build-deps/src/build/native.rs
🧠 Learnings (23)
📓 Common learnings
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: thirdparty/AGENTS.md:0-0
Timestamp: 2026-05-27T15:13:37.212Z
Learning: Applies to thirdparty/**/thirdparty/*/{build-kobo.sh,*-kobo.patch} : Prefer using kobo.patch for working around upstream issues rather than modifying build-kobo.sh — patches make the delta explicit and reviewable
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-28T14:01:38.823Z
Learning: In CI, `cargo xtask download-assets` must run before `cargo xtask build-kobo` so the generated asset list stays accurate
Learnt from: OGKevin
Repo: OGKevin/cadmus PR: 571
File: .github/workflows/cargo.yml:162-166
Timestamp: 2026-06-06T19:59:31.071Z
Learning: In `.github/workflows/cargo.yml`, the `cargo xtask download-assets` step in `cache-warmup` is intentionally gated behind the same `if: steps.cache.outputs.cache-hit != 'true'` condition as the warmup build steps. On a warm cache hit, neither assets nor warmup builds run; the `build-kobo` jobs restore from a shared cache that already contains assets from a prior cold run. Running `download-assets` unconditionally in this job is not required.
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: thirdparty/AGENTS.md:0-0
Timestamp: 2026-05-27T15:13:37.212Z
Learning: Applies to thirdparty/xtask/src/tasks/util/thirdparty.rs : Respect the build order defined by LIBRARY_NAMES in xtask/src/tasks/util/thirdparty.rs — libraries later in the list may link against earlier ones, and new libraries must be inserted at the correct position
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: thirdparty/AGENTS.md:0-0
Timestamp: 2026-05-27T15:13:37.212Z
Learning: Applies to thirdparty/xtask/src/tasks/util/thirdparty.rs : Library versions must be defined as constants in xtask/src/tasks/util/thirdparty.rs — never hard-code URLs in build scripts
Learnt from: OGKevin
Repo: OGKevin/cadmus PR: 511
File: crates/core/build.rs:129-131
Timestamp: 2026-05-25T12:43:50.793Z
Learning: In `crates/core/build.rs`, the `generate_bundled_assets()` function intentionally skips missing asset directories (`if !dir.exists() { return; }`) to support emulator/non-Kobo builds where OTA is not used and asset directories may not be present. Any fail-fast guard for missing required directories (e.g., `bin/`, `resources/`, `hyphenation-patterns/`) should be gated on the Kobo target (`TARGET == "arm-unknown-linux-gnueabihf"`) to avoid breaking emulator builds.
📚 Learning: 2026-05-27T15:13:37.212Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: thirdparty/AGENTS.md:0-0
Timestamp: 2026-05-27T15:13:37.212Z
Learning: Applies to thirdparty/**/renovate.json : Ensure Renovate regex managers in renovate.json cover new library version constants to enable automated update PRs
Applied to files:
renovate.json
📚 Learning: 2026-05-28T14:01:38.823Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-28T14:01:38.823Z
Learning: Applies to **/Cargo.toml : Use caret requirements for most dependencies in Cargo.toml
Applied to files:
renovate.json
📚 Learning: 2026-05-27T15:13:37.212Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: thirdparty/AGENTS.md:0-0
Timestamp: 2026-05-27T15:13:37.212Z
Learning: Applies to thirdparty/xtask/src/tasks/util/thirdparty.rs : Library versions must be defined as constants in xtask/src/tasks/util/thirdparty.rs — never hard-code URLs in build scripts
Applied to files:
renovate.jsoncrates/core/build.rscrates/build-deps/src/build/native.rs
📚 Learning: 2026-06-06T19:59:31.071Z
Learnt from: OGKevin
Repo: OGKevin/cadmus PR: 571
File: .github/workflows/cargo.yml:162-166
Timestamp: 2026-06-06T19:59:31.071Z
Learning: In `.github/workflows/cargo.yml`, the `cargo xtask download-assets` step in `cache-warmup` is intentionally gated behind the same `if: steps.cache.outputs.cache-hit != 'true'` condition as the warmup build steps. On a warm cache hit, neither assets nor warmup builds run; the `build-kobo` jobs restore from a shared cache that already contains assets from a prior cold run. Running `download-assets` unconditionally in this job is not required.
Applied to files:
.github/workflows/cargo.ymlcrates/core/build.rs
📚 Learning: 2026-05-28T14:01:38.823Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-28T14:01:38.823Z
Learning: Applies to .github/workflows/cargo.yml : The `clippy` and `test` jobs in `.github/workflows/cargo.yml` use a matrix to check every feature flag individually and in combination
Applied to files:
.github/workflows/cargo.yml
📚 Learning: 2026-05-28T14:01:38.823Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-28T14:01:38.823Z
Learning: Applies to .github/workflows/cargo.yml : For workspace-wide feature flags in CI, use `--workspace --all-targets --features <name>` in `.github/workflows/cargo.yml`
Applied to files:
.github/workflows/cargo.ymlcrates/core/build.rs
📚 Learning: 2026-05-28T14:01:38.823Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-28T14:01:38.823Z
Learning: Applies to .github/workflows/cargo.yml : Only `default` and `test` features should produce build artifacts in `.github/workflows/cargo.yml`
Applied to files:
.github/workflows/cargo.yml
📚 Learning: 2026-05-28T14:01:38.823Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-28T14:01:38.823Z
Learning: Applies to .github/workflows/cargo.yml : For crate-specific feature flags in CI, use `-p <crate> --all-targets --features <name>` in `.github/workflows/cargo.yml`
Applied to files:
.github/workflows/cargo.yml
📚 Learning: 2026-05-28T14:01:38.823Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-28T14:01:38.823Z
Learning: Applies to .github/workflows/cargo.yml : All feature flag combinations should run on `ubuntu-latest` in `.github/workflows/cargo.yml`
Applied to files:
.github/workflows/cargo.yml
📚 Learning: 2026-05-28T14:01:38.823Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-28T14:01:38.823Z
Learning: When adding a new feature flag, add it to the relevant `Cargo.toml` and update `.github/workflows/cargo.yml` with matrix entries for both the feature alone and combined with every other feature
Applied to files:
.github/workflows/cargo.yml
📚 Learning: 2026-05-28T14:01:38.823Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-28T14:01:38.823Z
Learning: After modifying `Cargo.toml`, run `cargo xtask clippy` and `cargo xtask test --features default`
Applied to files:
.github/workflows/cargo.ymlcrates/core/build.rs
📚 Learning: 2026-05-28T14:01:38.823Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-28T14:01:38.823Z
Learning: In CI, `cargo xtask download-assets` must run before `cargo xtask build-kobo` so the generated asset list stays accurate
Applied to files:
.github/workflows/cargo.ymlcrates/core/build.rs
📚 Learning: 2026-05-25T12:43:50.793Z
Learnt from: OGKevin
Repo: OGKevin/cadmus PR: 511
File: crates/core/build.rs:129-131
Timestamp: 2026-05-25T12:43:50.793Z
Learning: In `crates/core/build.rs`, the `generate_bundled_assets()` function intentionally skips missing asset directories (`if !dir.exists() { return; }`) to support emulator/non-Kobo builds where OTA is not used and asset directories may not be present. Any fail-fast guard for missing required directories (e.g., `bin/`, `resources/`, `hyphenation-patterns/`) should be gated on the Kobo target (`TARGET == "arm-unknown-linux-gnueabihf"`) to avoid breaking emulator builds.
Applied to files:
.github/workflows/cargo.ymlcrates/core/build.rs
📚 Learning: 2026-05-28T14:01:38.823Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-28T14:01:38.823Z
Learning: If code generates compile-time metadata from bundled asset directories, ensure `bin/`, `resources/`, and `hyphenation-patterns/` are present before the Kobo build starts
Applied to files:
.github/workflows/cargo.ymlcrates/core/build.rs
📚 Learning: 2026-05-27T15:13:37.212Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: thirdparty/AGENTS.md:0-0
Timestamp: 2026-05-27T15:13:37.212Z
Learning: Applies to thirdparty/**/thirdparty/*/+(build-kobo.sh|kobo.patch|*-kobo.patch|README-kobo.md|README-cadmus.md|Makefile-kobo) : Each library subdirectory may contain build-kobo.sh, kobo.patch, *-kobo.patch files, README-kobo.md, README-cadmus.md, and additional build system files
Applied to files:
.github/workflows/cargo.yml
📚 Learning: 2026-05-27T15:13:37.212Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: thirdparty/AGENTS.md:0-0
Timestamp: 2026-05-27T15:13:37.212Z
Learning: Applies to thirdparty/**/thirdparty/*/{build-kobo.sh,*-kobo.patch} : Prefer using kobo.patch for working around upstream issues rather than modifying build-kobo.sh — patches make the delta explicit and reviewable
Applied to files:
.github/workflows/cargo.yml
📚 Learning: 2026-05-27T15:13:37.212Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: thirdparty/AGENTS.md:0-0
Timestamp: 2026-05-27T15:13:37.212Z
Learning: Applies to thirdparty/**/thirdparty/** : Build scripts and patches for third-party libraries must be placed in the thirdparty directory, with no downloaded source trees committed — only build scripts and patches
Applied to files:
.github/workflows/cargo.yml
📚 Learning: 2026-05-28T14:01:38.823Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-28T14:01:38.823Z
Learning: Applies to **/*.rs : Ensure Rust code compiles without warnings
Applied to files:
.github/workflows/cargo.ymlcrates/build-deps/src/build/native.rs
📚 Learning: 2026-05-28T14:01:38.823Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-28T14:01:38.823Z
Learning: Applies to Cargo.toml : Define dependency versions in root `Cargo.toml` under `[workspace.dependencies]`
Applied to files:
crates/core/build.rs
📚 Learning: 2026-05-28T14:01:38.823Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-28T14:01:38.823Z
Learning: Applies to **/*.rs : Prefer `?` operator over `unwrap()` / `expect()` in library and app code
Applied to files:
crates/build-deps/src/build/native.rs
📚 Learning: 2026-05-28T14:01:38.823Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-28T14:01:38.823Z
Learning: Applies to **/*.rs : Avoid `unsafe` unless required and documented in Rust
Applied to files:
crates/build-deps/src/build/native.rs
📚 Learning: 2026-05-26T20:10:56.991Z
Learnt from: OGKevin
Repo: OGKevin/cadmus PR: 456
File: crates/core/src/document/mupdf_sys.rs:7-10
Timestamp: 2026-05-26T20:10:56.991Z
Learning: In `crates/core/src/document/mupdf_sys.rs` (OGKevin/cadmus), the project owner prefers safety/soundness documentation for unsafe code to be written as `///` Rust doc comments on the function (so they appear in generated rustdoc), rather than as inline `// SAFETY:` comments inside the unsafe block.
Applied to files:
crates/build-deps/src/build/native.rs
🪛 Betterleaks (1.3.1)
.github/workflows/cargo.yml
[high] 115-115: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
(generic-api-key)
🪛 GitHub Actions: PR `#571` / 2_Analyze (rust).txt
crates/build-deps/src/build/native.rs
[warning] 73-577: CodeQL Rust autobuild indexing: macro expansion failed for one or more macros (e.g., 'bail', '$crate::format_args_nl', 'format', 'vec', 'cfg', 'assert_eq', 'assert'). Command: /opt/hostedtoolcache/CodeQL/2.25.6/x64/codeql/rust/tools/autobuild.sh (via codeql database trace-command --use-build-mode).
🪛 GitHub Actions: PR `#571` / Analyze (rust)
crates/build-deps/src/build/native.rs
[warning] 73-73: CodeQL rust autobuild warning: macro expansion failed for 'bail'
[warning] 141-141: CodeQL rust autobuild warning: macro expansion failed for '$crate::format_args_nl'
[warning] 154-154: CodeQL rust autobuild warning: macro expansion failed for '$crate::format_args_nl'
[warning] 189-189: CodeQL rust autobuild warning: macro expansion failed for '$crate::format_args_nl'
[warning] 219-219: CodeQL rust autobuild warning: macro expansion failed for 'format'
[warning] 233-233: CodeQL rust autobuild warning: macro expansion failed for 'format'
[warning] 236-236: CodeQL rust autobuild warning: macro expansion failed for 'format'
[warning] 239-239: CodeQL rust autobuild warning: macro expansion failed for 'format'
[warning] 250-250: CodeQL rust autobuild warning: macro expansion failed for 'bail'
[warning] 256-256: CodeQL rust autobuild warning: macro expansion failed for 'format'
[warning] 259-259: CodeQL rust autobuild warning: macro expansion failed for 'vec'
[warning] 270-270: CodeQL rust autobuild warning: macro expansion failed for 'format'
[warning] 276-276: CodeQL rust autobuild warning: macro expansion failed for 'format'
[warning] 284-284: CodeQL rust autobuild warning: macro expansion failed for 'format'
[warning] 342-342: CodeQL rust autobuild warning: macro expansion failed for '$crate::format_args_nl'
[warning] 351-351: CodeQL rust autobuild warning: macro expansion failed for '$crate::format_args_nl'
[warning] 365-365: CodeQL rust autobuild warning: macro expansion failed for 'format'
[warning] 373-373: CodeQL rust autobuild warning: macro expansion failed for 'format'
[warning] 392-392: CodeQL rust autobuild warning: macro expansion failed for 'format'
[warning] 393-393: CodeQL rust autobuild warning: macro expansion failed for 'format'
[warning] 412-412: CodeQL rust autobuild warning: macro expansion failed for 'cfg'
[warning] 444-444: CodeQL rust autobuild warning: macro expansion failed for 'cfg'
[warning] 450-450: CodeQL rust autobuild warning: macro expansion failed for 'format'
[warning] 458-458: CodeQL rust autobuild warning: macro expansion failed for 'bail'
[warning] 462-462: CodeQL rust autobuild warning: macro expansion failed for '$crate::format_args_nl'
[warning] 466-466: CodeQL rust autobuild warning: macro expansion failed for '$crate::format_args_nl'
[warning] 471-471: CodeQL rust autobuild warning: macro expansion failed for '$crate::format_args_nl'
[warning] 481-481: CodeQL rust autobuild warning: macro expansion failed for 'format'
[warning] 486-486: CodeQL rust autobuild warning: macro expansion failed for 'format'
[warning] 500-500: CodeQL rust autobuild warning: macro expansion failed for 'format'
[warning] 503-503: CodeQL rust autobuild warning: macro expansion failed for 'format'
[warning] 525-525: CodeQL rust autobuild warning: macro expansion failed for 'assert_eq'
[warning] 535-535: CodeQL rust autobuild warning: macro expansion failed for 'assert'
[warning] 569-569: CodeQL rust autobuild warning: macro expansion failed for 'assert'
[warning] 577-577: CodeQL rust autobuild warning: macro expansion failed for 'assert'
🪛 zizmor (1.25.2)
.github/workflows/cargo.yml
[error] 154-154: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
[error] 106-106: runtime artifacts potentially vulnerable to a cache poisoning attack (cache-poisoning): always restores from cache
(cache-poisoning)
[error] 112-112: runtime artifacts potentially vulnerable to a cache poisoning attack (cache-poisoning): enables caching by default
(cache-poisoning)
[error] 128-128: runtime artifacts potentially vulnerable to a cache poisoning attack (cache-poisoning): enables caching by default
(cache-poisoning)
[error] 142-142: runtime artifacts potentially vulnerable to a cache poisoning attack (cache-poisoning): enables caching by default
(cache-poisoning)
[error] 281-281: runtime artifacts potentially vulnerable to a cache poisoning attack (cache-poisoning): always restores from cache
(cache-poisoning)
[error] 287-287: runtime artifacts potentially vulnerable to a cache poisoning attack (cache-poisoning): enables caching by default
(cache-poisoning)
🔇 Additional comments (1)
renovate.json (1)
6-8: LGTM!Also applies to: 35-37, 118-118, 146-146
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/build-deps/src/markers.rs`:
- Around line 39-41: The doc comment for the submodule_commit function contains
raw angle-bracketed tokens "<sha>" and "<path>" which rustdoc treats as HTML;
update the doc comment in markers.rs for pub fn submodule_commit(root: &Path,
submodule_path: &str) -> Option<String> to wrap those tokens in backticks (e.g.
`\<sha\>`/```<sha>``` style—use Markdown inline code) so they render as code
(e.g. `sha` and `path`) and no longer are parsed as HTML tags.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: 931e674e-1639-43a7-9860-bc49685da282
📒 Files selected for processing (6)
.github/actions/cargo-cache/action.yml.github/workflows/cargo.ymlcrates/build-deps/src/build/kobo.rscrates/build-deps/src/build/native.rscrates/build-deps/src/markers.rscrates/core/build.rs
🚧 Files skipped from review as they are similar to previous changes (3)
- crates/core/build.rs
- crates/build-deps/src/build/native.rs
- crates/build-deps/src/build/kobo.rs
📜 Review details
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: cache-warmup
🧰 Additional context used
📓 Path-based instructions (2)
**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
**/*.rs: Prefer?operator overunwrap()/expect()in library and app code
Usethiserrorfor custom error types andanyhowfor ad-hoc errors in Rust
Use iterators over index-based loops in Rust
Use&stroverStringin function parameters when ownership is not needed
Prefer borrowing over cloning in Rust
Inline expressions directly into struct fields — avoid intermediate bindings solely to pass them into a struct literal
Avoidunsafeunless required and documented in Rust
Avoid prematurecollect()— keep iterators lazy in Rust
Ensure Rust code compiles without warnings
Prefer newtype wrappers over raw primitives for domain concepts (e.g.,Fingerprint(String)instead of bareString)
WrapString,i64, and similar primitives when the value represents a specific domain concept (fingerprints, file kinds, identifiers, etc.)
ImplementDisplay,FromStr, and other standard traits on newtype wrappers to keep them ergonomic
Match on enum variants instead of string comparisons — the compiler catches missing arms
Comment why, not what. Avoid inline comments — extract code into well-named, documented functions instead
Avoid dead-code comments (commented-out code) in Rust
Avoid changelog comments (Modified by X on date) in Rust
Avoid divider comments (//=====) in Rust
Annotations (TODO,FIXME,HACK,NOTE) are acceptable with context in Rust
Use structured fields with thetracingcrate — never use string formatting for log data
Use only structured fields for logging — data goes in fields, not format strings
Do not use module prefixes in logs — instrumentation scope provides context
Do not mix structured fields with format arguments in logging
Usedebuglog level for development and troubleshooting detail
Useinfolog level for important runtime events
Usewarnlog level for recoverable issues (retries, fallbacks)
Useerrorlog level for failures requiring attention
Return domain types directly from sqlx queries instead of parsin...
Files:
crates/build-deps/src/markers.rs
.github/workflows/cargo.yml
📄 CodeRabbit inference engine (AGENTS.md)
.github/workflows/cargo.yml: Theclippyandtestjobs in.github/workflows/cargo.ymluse a matrix to check every feature flag individually and in combination
For workspace-wide feature flags in CI, use--workspace --all-targets --features <name>in.github/workflows/cargo.yml
For crate-specific feature flags in CI, use-p <crate> --all-targets --features <name>in.github/workflows/cargo.yml
All feature flag combinations should run onubuntu-latestin.github/workflows/cargo.yml
Onlydefaultandtestfeatures should produce build artifacts in.github/workflows/cargo.yml
Files:
.github/workflows/cargo.yml
🧠 Learnings (13)
📓 Common learnings
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: thirdparty/AGENTS.md:0-0
Timestamp: 2026-05-27T15:13:37.212Z
Learning: Applies to thirdparty/**/thirdparty/*/{build-kobo.sh,*-kobo.patch} : Prefer using kobo.patch for working around upstream issues rather than modifying build-kobo.sh — patches make the delta explicit and reviewable
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-28T14:01:38.823Z
Learning: In CI, `cargo xtask download-assets` must run before `cargo xtask build-kobo` so the generated asset list stays accurate
Learnt from: OGKevin
Repo: OGKevin/cadmus PR: 571
File: .github/workflows/cargo.yml:162-166
Timestamp: 2026-06-06T19:59:31.071Z
Learning: In `.github/workflows/cargo.yml`, the `cargo xtask download-assets` step in `cache-warmup` is intentionally gated behind the same `if: steps.cache.outputs.cache-hit != 'true'` condition as the warmup build steps. On a warm cache hit, neither assets nor warmup builds run; the `build-kobo` jobs restore from a shared cache that already contains assets from a prior cold run. Running `download-assets` unconditionally in this job is not required.
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: thirdparty/AGENTS.md:0-0
Timestamp: 2026-05-27T15:13:37.212Z
Learning: Applies to thirdparty/xtask/src/tasks/util/thirdparty.rs : Respect the build order defined by LIBRARY_NAMES in xtask/src/tasks/util/thirdparty.rs — libraries later in the list may link against earlier ones, and new libraries must be inserted at the correct position
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: thirdparty/AGENTS.md:0-0
Timestamp: 2026-05-27T15:13:37.212Z
Learning: Applies to thirdparty/xtask/src/tasks/util/thirdparty.rs : Library versions must be defined as constants in xtask/src/tasks/util/thirdparty.rs — never hard-code URLs in build scripts
Learnt from: OGKevin
Repo: OGKevin/cadmus PR: 511
File: crates/core/build.rs:129-131
Timestamp: 2026-05-25T12:43:50.793Z
Learning: In `crates/core/build.rs`, the `generate_bundled_assets()` function intentionally skips missing asset directories (`if !dir.exists() { return; }`) to support emulator/non-Kobo builds where OTA is not used and asset directories may not be present. Any fail-fast guard for missing required directories (e.g., `bin/`, `resources/`, `hyphenation-patterns/`) should be gated on the Kobo target (`TARGET == "arm-unknown-linux-gnueabihf"`) to avoid breaking emulator builds.
📚 Learning: 2026-06-06T19:59:31.071Z
Learnt from: OGKevin
Repo: OGKevin/cadmus PR: 571
File: .github/workflows/cargo.yml:162-166
Timestamp: 2026-06-06T19:59:31.071Z
Learning: In `.github/workflows/cargo.yml`, the `cargo xtask download-assets` step in `cache-warmup` is intentionally gated behind the same `if: steps.cache.outputs.cache-hit != 'true'` condition as the warmup build steps. On a warm cache hit, neither assets nor warmup builds run; the `build-kobo` jobs restore from a shared cache that already contains assets from a prior cold run. Running `download-assets` unconditionally in this job is not required.
Applied to files:
.github/actions/cargo-cache/action.yml.github/workflows/cargo.yml
📚 Learning: 2026-05-28T14:01:38.823Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-28T14:01:38.823Z
Learning: Applies to .github/workflows/cargo.yml : The `clippy` and `test` jobs in `.github/workflows/cargo.yml` use a matrix to check every feature flag individually and in combination
Applied to files:
.github/workflows/cargo.yml
📚 Learning: 2026-05-28T14:01:38.823Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-28T14:01:38.823Z
Learning: Applies to .github/workflows/cargo.yml : Only `default` and `test` features should produce build artifacts in `.github/workflows/cargo.yml`
Applied to files:
.github/workflows/cargo.yml
📚 Learning: 2026-05-28T14:01:38.823Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-28T14:01:38.823Z
Learning: Applies to .github/workflows/cargo.yml : For workspace-wide feature flags in CI, use `--workspace --all-targets --features <name>` in `.github/workflows/cargo.yml`
Applied to files:
.github/workflows/cargo.yml
📚 Learning: 2026-05-28T14:01:38.823Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-28T14:01:38.823Z
Learning: Applies to .github/workflows/cargo.yml : For crate-specific feature flags in CI, use `-p <crate> --all-targets --features <name>` in `.github/workflows/cargo.yml`
Applied to files:
.github/workflows/cargo.yml
📚 Learning: 2026-05-28T14:01:38.823Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-28T14:01:38.823Z
Learning: Applies to .github/workflows/cargo.yml : All feature flag combinations should run on `ubuntu-latest` in `.github/workflows/cargo.yml`
Applied to files:
.github/workflows/cargo.yml
📚 Learning: 2026-05-28T14:01:38.823Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-28T14:01:38.823Z
Learning: When adding a new feature flag, add it to the relevant `Cargo.toml` and update `.github/workflows/cargo.yml` with matrix entries for both the feature alone and combined with every other feature
Applied to files:
.github/workflows/cargo.yml
📚 Learning: 2026-05-28T14:01:38.823Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-28T14:01:38.823Z
Learning: In CI, `cargo xtask download-assets` must run before `cargo xtask build-kobo` so the generated asset list stays accurate
Applied to files:
.github/workflows/cargo.yml
📚 Learning: 2026-05-25T12:43:50.793Z
Learnt from: OGKevin
Repo: OGKevin/cadmus PR: 511
File: crates/core/build.rs:129-131
Timestamp: 2026-05-25T12:43:50.793Z
Learning: In `crates/core/build.rs`, the `generate_bundled_assets()` function intentionally skips missing asset directories (`if !dir.exists() { return; }`) to support emulator/non-Kobo builds where OTA is not used and asset directories may not be present. Any fail-fast guard for missing required directories (e.g., `bin/`, `resources/`, `hyphenation-patterns/`) should be gated on the Kobo target (`TARGET == "arm-unknown-linux-gnueabihf"`) to avoid breaking emulator builds.
Applied to files:
.github/workflows/cargo.yml
📚 Learning: 2026-05-28T14:01:38.823Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-28T14:01:38.823Z
Learning: If code generates compile-time metadata from bundled asset directories, ensure `bin/`, `resources/`, and `hyphenation-patterns/` are present before the Kobo build starts
Applied to files:
.github/workflows/cargo.yml
📚 Learning: 2026-05-27T15:13:37.212Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: thirdparty/AGENTS.md:0-0
Timestamp: 2026-05-27T15:13:37.212Z
Learning: Applies to thirdparty/**/thirdparty/*/{build-kobo.sh,*-kobo.patch} : Prefer using kobo.patch for working around upstream issues rather than modifying build-kobo.sh — patches make the delta explicit and reviewable
Applied to files:
.github/workflows/cargo.yml
📚 Learning: 2026-05-27T15:13:37.212Z
Learnt from: CR
Repo: OGKevin/cadmus PR: 0
File: thirdparty/AGENTS.md:0-0
Timestamp: 2026-05-27T15:13:37.212Z
Learning: Applies to thirdparty/**/thirdparty/*/+(build-kobo.sh|kobo.patch|*-kobo.patch|README-kobo.md|README-cadmus.md|Makefile-kobo) : Each library subdirectory may contain build-kobo.sh, kobo.patch, *-kobo.patch files, README-kobo.md, README-cadmus.md, and additional build system files
Applied to files:
.github/workflows/cargo.yml
🪛 GitHub Actions: Cadmus Documentation / 3_build.txt
crates/build-deps/src/markers.rs
[error] 40-40: rustdoc failed: unclosed HTML tag sha. (error: unclosed HTML tag sha; implied by -D warnings in RUSTDOCFLAGS)
[error] 40-40: rustdoc failed: unclosed HTML tag path. (error: unclosed HTML tag path; implied by -D warnings in RUSTDOCFLAGS)
🪛 GitHub Actions: Cadmus Documentation / build
crates/build-deps/src/markers.rs
[error] 40-40: Rustdoc failed due to invalid HTML in doc comment: unclosed HTML tag sha. (rustdoc::invalid-html-tags implied by -D warnings)
[error] 40-40: Rustdoc failed due to invalid HTML in doc comment: unclosed HTML tag path. (rustdoc::invalid-html-tags implied by -D warnings)
🪛 GitHub Actions: PR `#571` / 0_Analyze (rust).txt
crates/build-deps/src/markers.rs
[warning] 90-90: CodeQL rust autobuild: macro expansion failed for 'format'
[warning] 93-93: CodeQL rust autobuild: macro expansion failed for 'format'
[warning] 110-110: CodeQL rust autobuild: macro expansion failed for 'format'
[warning] 119-119: CodeQL rust autobuild: macro expansion failed for 'env'
[warning] 125-125: CodeQL rust autobuild: macro expansion failed for 'assert'
[warning] 127-127: CodeQL rust autobuild: macro expansion failed for 'assert_eq'
[warning] 128-128: CodeQL rust autobuild: macro expansion failed for 'assert'
🪛 GitHub Actions: PR `#571` / Analyze (rust)
crates/build-deps/src/markers.rs
[warning] 90-128: CodeQL Rust autobuild reported "macro expansion failed" for macros including 'format', 'env', 'assert', and 'assert_eq'.
🔇 Additional comments (15)
crates/build-deps/src/markers.rs (4)
1-14: LGTM!
56-78: LGTM!
80-95: LGTM!
113-130: LGTM!.github/actions/cargo-cache/action.yml (1)
1-66: LGTM!The composite action properly addresses the submodule revision tracking concern from past reviews - using
git ls-tree HEAD thirdparty/to hash gitlink SHAs ensures the cache key changes when submodule pointers move. Actions are pinned to SHA, cache paths are appropriate, and the restore/save mode separation is clean..github/workflows/cargo.yml (10)
19-24: LGTM!
41-44: LGTM!
59-62: LGTM!
75-78: LGTM!
126-163: LGTM!
186-189: LGTM!
229-232: LGTM!
296-310: LGTM!
337-340: LGTM!
407-410: LGTM!
1a2f418 to
bd6957c
Compare
bd6957c to
48ed868
Compare
48ed868 to
c976c0e
Compare
c976c0e to
8053cce
Compare
Change-Id: bc5eecbd94d24946167efb1a7985f961 Change-Id-Short: onullnomqvmx
8053cce to
98a8377
Compare
|
@CodeRabbit review |
✅ Action performedReview finished.
|

Replace tarball-based thirdparty downloads with git submodules and a
build-depscrateThirdparty C/C++ dependencies (zlib, bzip2, libpng, libjpeg, openjpeg, jbig2dec, libwebp, freetype2, harfbuzz, gumbo, djvulibre, mupdf) are now tracked as git submodules in
.gitmodulesinstead of being downloaded at build time from tarballs or pre-built release assets. The per-librarybuild-kobo.shshell scripts and theMakefile-kobofor bzip2 have been removed.A new
crates/build-depscrate centralises all thirdparty build logic previously spread acrossxtask/src/tasks/util/thirdparty.rs,xtask/src/tasks/util/mupdf_wrapper.rs, andxtask/src/tasks/setup_native.rs. It exposes:build::kobo— cross-compilation recipes for each library targetingarm-unknown-linux-gnueabihf, finallibmupdf.solink step, andensure_kobo_artifactsas the single entry point.build::native— native host builds of libwebp and MuPDF using system libraries, withensure_native_artifactsas the entry point.build::mupdf_wrapper— compilesmupdf_wrapper.cvia thecccrate for both targets.build::mupdf— shared WebP patch application logic used by both flows.markers,cmd,versions— marker-file helpers, shell-out wrappers, and pinned version/path constants.crates/core/build.rsnow calls intobuild-depsdirectly to build and link thirdparty artifacts, replacing the previous manual shell invocations. ACADMUS_SKIP_THIRDPARTY_DEPSenvironment variable allows skipping the build and link steps for workflows that only need Rust source analysis (e.g.cargo doc).The
cargo xtask setup-nativecommand and itsSetupNativeArgshave been removed. Native dependency building is now handled automatically bybuild.rswhencargo buildruns.run-emulatorandinstall-importerno longer callsetup_nativeas a prerequisite. The--slowand--skipflags onbuild-kobohave been removed; the build script handles caching via.builtmarker files and skips submodule initialisation on warm caches.Build patches previously under
thirdparty/<lib>/have been moved tobuild-scripts/<lib>/. The shared cargo artifact cache key now includesbuild-scripts/**,.gitmodules,mupdf_wrapper/mupdf_wrapper.c, andcrates/build-deps/**, and thelibs/directory is added to the cached paths. Renovate is updated to track submodule versions via thegit-submodulesmanager instead of regex matches against version constants inthirdparty.rs.Change-Id: b03e8f80c2eab7a3d9fedc4c8892c1cb
Change-Id-Short: ozwlrkrznxlp