Skip to content
cccskills
FreePublished on GitHub

build-jj-workspace

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.

The English summary is being prepared. Showing the original description.

Run score Not tested

See how to install

Files included (1)

  • SKILL.md4.8 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Build Cadmus in a non-colocated jj workspace

Why a sibling workspace does not build out of the box

A jj sibling workspace (jj workspace add) is a separate working copy of the same repository with no .git. Two consequences break the build:

  • jj ignores git submodules, so every thirdparty/<lib> directory is empty (mupdf, libwebp, harfbuzz, sqlite, …).
  • Cadmus builds through 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.

Detect

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.

The fix: point git at the colocated repo

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" \
  cadmuscli setup --host

cadmuscli 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" \
  cadmuscli 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.

Caveats

  • git ls-tree HEAD reads the colocated repo's HEAD, not $ROOT's @. Fine while both revisions record the same submodule gitlinks.
  • If a submodule step writes the git index, use a separate GIT_INDEX_FILE (see jj-vcs).
  • jj 0.45.x has no jj workspace add --colocate; the git-env approach is the supported path here.

Per-workspace 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.

sccache

devenv sets RUSTC_WRAPPER=sccache. If setup or a compile panics inside sccache, retry that command with env -u RUSTC_WRAPPER (shown above).

Checklist (in $ROOT)

  1. devenv shell -- cadmuscli docs --mdbook-only if the EPUB is missing.
  2. cadmuscli setup --host with GIT_DIR/GIT_WORK_TREE (above).
  3. devenv shell -- env GIT_DIR=… GIT_WORK_TREE=… cadmuscli test --features emulator.

A device feature (emulator) is required; see build-cadmus-native for the EPUB, feature, and daily-command details.

Expected noise

  • git-hooks.nix: skipping hook installation: not a git repository on devenv enter — expected.
  • No jj-pre-hook / git pre-commit here; see jj-commit.

Common mistakes

MistakeResultFix
Building in $ROOT without GIT_DIRnot a git repository, empty thirdparty/Pass GIT_DIR/GIT_WORK_TREE from $COLOCATED
Reusing colocated SQLITE3_* onlyNative deps still fail (empty thirdparty/)Materialize submodules via the git env
Assuming a shared target/Missing artifacts in the siblingEach workspace builds its own target/
cargo test without a device featurecompile_error! in cadmus-core--features emulator
Leaving GIT_DIR exported for jjgit-based tools read the wrong repoScope it to the build commands

Related skills

  • build-cadmus-native — EPUB, xtask commands, device features
  • jj-vcs — GIT_DIR / GIT_INDEX_FILE caveats for non-colocated workspaces
  • jj-commit — skip git pre-commit when .git is absent

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Build Cadmus on Linux and macOS hosts using cadmuscli. Use when asked how to compile, test, lint, or run the project locally.

The English summary is being prepared. Showing the original description.

OGKevin/cadmus50Updated Oct 23, 2026

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.

The English summary is being prepared. Showing the original description.

OGKevin/cadmus50Updated Oct 23, 2026

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.

The English summary is being prepared. Showing the original description.

OGKevin/cadmus50Updated Oct 23, 2026

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.

The English summary is being prepared. Showing the original description.

OGKevin/cadmus50Updated Oct 23, 2026

docs

Free

Build the full Cadmus documentation website (mdBook + cargo doc + Storybook + Next.js). Use this when asked to build, preview, or update the documentation site.

The English summary is being prepared. Showing the original description.

OGKevin/cadmus50Updated Oct 23, 2026

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.

The English summary is being prepared. Showing the original description.

OGKevin/cadmus50Updated Oct 23, 2026

See all skills by OGKevin

Report a problem with this skill