Build Cadmus on Linux and macOS hosts using xtask. Use when asked how to compile, test, lint, or run the project locally.
日本語の概要は準備中です。原文の説明を表示しています。
Build, test, and lint Cadmus from a jj sibling workspace that has no .git (non-colocated checkout). Use when jj workspace root is a sibling tmp/agent workspace and builds fail with git submodule or .gitmodules errors, empty thirdparty/ sources, cache-marker misses, or missing sqlite.
インストールする前に、エージェントに与えられる指示の中身を確認できます。
A jj sibling workspace (jj workspace add) is a separate working copy of
the same repository with no .git. Two consequences break the build:
thirdparty/<lib> directory is
empty (mupdf, libwebp, harfbuzz, sqlite, …).build-deps, which needs git:
ensure_submodules runs git submodule update for cold artifacts.markers runs git ls-tree HEAD thirdparty/<lib> to resolve submodule
revisions for cache markers.With no .git, both fail (fatal: not a git repository). Even a warm
target/ is re-validated via git ls-tree, so it does not help. The fix is to
give the build a git directory to read — without building in the colocated
checkout.
ROOT="$(jj workspace root)"
COLOCATED="$(cd "$(jj workspace root --name default)" && pwd)"
test ! -e "$ROOT/.git" && echo non-colocated
Run every build, test, and lint command from $ROOT. jj workspace root is
the workspace owning the current working copy (the sibling directory), not the
default checkout. $COLOCATED is the default workspace — the one carrying
.git.
Pass GIT_DIR (and GIT_WORK_TREE so submodules materialize into $ROOT) to
the cargo invocation:
cd "$ROOT"
devenv shell -- env -u RUSTC_WRAPPER \
GIT_DIR="$COLOCATED/.git" \
GIT_WORK_TREE="$ROOT" \
cargo xtask setup --host
cargo xtask setup --host initializes the submodules into $ROOT and builds
SQLite under $ROOT/target/cadmus-build-deps/<host-triple>/sqlite/. Reuse the
same git env for later checks:
cd "$ROOT"
devenv shell -- env GIT_DIR="$COLOCATED/.git" GIT_WORK_TREE="$ROOT" \
cargo xtask test --features emulator
Scope GIT_DIR/GIT_WORK_TREE to the build commands; do not export them for
the whole shell, and keep them off jj invocations.
git ls-tree HEAD reads the colocated repo's HEAD, not $ROOT's @.
Fine while both revisions record the same submodule gitlinks.GIT_INDEX_FILE
(see jj-vcs).jj workspace add --colocate; the git-env approach is the
supported path here.target/devenv sets CARGO_TARGET_DIR and PKG_CONFIG_PATH_* from
config.devenv.root (the workspace you entered), so each workspace has its own
target/. SQLite and the native deps (MuPDF, libwebp) build per workspace; the
first build in a sibling workspace is a full native build.
devenv sets RUSTC_WRAPPER=sccache. If setup or a compile panics inside
sccache, retry that command with env -u RUSTC_WRAPPER (shown above).
$ROOT)devenv shell -- cargo xtask docs --mdbook-only if the EPUB is missing.cargo xtask setup --host with GIT_DIR/GIT_WORK_TREE (above).devenv shell -- env GIT_DIR=… GIT_WORK_TREE=… cargo xtask test --features emulator.A device feature (emulator) is required; see build-cadmus-native for the
EPUB, feature, and daily-command details.
git-hooks.nix: skipping hook installation: not a git repository on devenv
enter — expected.jj-pre-hook / git pre-commit here; see jj-commit.| Mistake | Result | Fix |
|---|---|---|
Building in $ROOT without GIT_DIR | not a git repository, empty thirdparty/ | Pass GIT_DIR/GIT_WORK_TREE from $COLOCATED |
Reusing colocated SQLITE3_* only | Native deps still fail (empty thirdparty/) | Materialize submodules via the git env |
Assuming a shared target/ | Missing artifacts in the sibling | Each workspace builds its own target/ |
cargo test without a device feature | compile_error! in cadmus-core | --features emulator |
Leaving GIT_DIR exported for jj | git-based tools read the wrong repo | Scope it to the build commands |
build-cadmus-native — EPUB, xtask commands, device featuresjj-vcs — GIT_DIR / GIT_INDEX_FILE caveats for non-colocated workspacesjj-commit — skip git pre-commit when .git is absentまだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Build Cadmus on Linux and macOS hosts using xtask. Use when asked how to compile, test, lint, or run the project locally.
日本語の概要は準備中です。原文の説明を表示しています。
Cross-compile Cadmus for Kobo e-reader devices (ARM Linux). Use this when asked to build a Kobo release, cross-compile for ARM, or prepare a device binary.
日本語の概要は準備中です。原文の説明を表示しています。
Run clippy locally and report only issues in the current diff, matching the CI reviewdog flow. Use when asked how to lint changed code or get clippy feedback on a branch before pushing.
日本語の概要は準備中です。原文の説明を表示しています。
Resolve failed Renovate or Dependabot dependency update PRs by fixing version constraints, API breaking changes, and verifying build/test/format compliance. Use when a dependency bump PR fails CI, Cargo cannot select versions, or a crate update requires code migration.
日本語の概要は準備中です。原文の説明を表示しています。
Build the full Cadmus documentation website (mdBook + cargo doc + Storybook + Next.js). Use this when asked to build, preview, or update the documentation site.
日本語の概要は準備中です。原文の説明を表示しています。
Fetch Cadmus application logs from Loki by run ID. Use when asked to look up logs for a specific run, debug a device session, or find log output for a given run ID.
日本語の概要は準備中です。原文の説明を表示しています。