본문으로 건너뛰기
cccskills
무료GitHub에 공개

build-cadmus-native

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

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

실행 점수 미검증

설치 방법 보기

포함된 파일(1)

  • SKILL.md6.9 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Build Cadmus on Native Hosts (Linux / macOS)

Critical prerequisite: generate the documentation EPUB

cadmus-core embeds the user documentation at compile time via rust-embed. The macro points to docs/book/epub/Cadmus Documentation.epub. If that file is missing, every cargo check, cargo build, or cargo test that touches cadmus-core will fail with:

error: #[derive(RustEmbed)] folder '…/docs/book/epub/' does not exist.
error[E0599]: no associated function named `get` found for struct `DocumentationAssets`

Generate the EPUB

cadmuscli docs --mdbook-only

This installs mdBook and mdbook-epub (if missing), builds the mdBook sources, and writes docs/book/epub/Cadmus Documentation.epub. You only need to rerun it when documentation sources change.

One-time setup

Custom SQLite

Required before any native compile — libsqlite3-sys runs before cadmus-core's build.rs, so the UDL-enabled SQLite library must already exist:

cadmuscli setup

Default (no flags) builds for the host and Kobo targets.

Runtime assets

Required for Kobo builds — run both before cadmuscli build-kobo:

cadmuscli download-assets
cadmuscli download-fonts

download-assets pulls Plato runtime directories (bin/, resources/, hyphenation-patterns/). download-fonts assembles the fonts/.

Other native dependencies (MuPDF, libwebp, and the C wrapper) are built automatically by build.rs when you run any Cargo command that compiles cadmus-core. SQLite is the exception — use cadmuscli setup first.

Daily workflow commands

GoalCommand
Check formattingcadmuscli fmt
Run clippycadmuscli clippy
Run tests (emulator features)cadmuscli test --features emulator
Run tests with coveragecadmus-test-coverage --features emulator (devenv)
View coverage (project-wide)cadmus-coverage-show (after test-coverage)
View coverage (patch diff)cadmus-coverage-diff (after test-coverage)
Run tests with telemetrycadmuscli test --features "emulator + profiling + test + tracing"
Run the emulatorcadmuscli run-emulator (builds the EPUB first if missing)
Install the importer CLIcadmuscli install-importer
Build docs portal (full)cadmuscli docs

A device feature is required

cadmus-core emits compile_error!("A device feature must be enabled") (crates/core/src/lib.rs) unless one of emulator, kobo, or deviceless is enabled. The merged cadmus crate has default = [], so plain cargo build, --features default, and cadmuscli test --features default all fail. For native host development use emulator (what run-emulator uses); use kobo only via the build-kobo skill (it cross-compiles for ARM).

Testing locally

The full feature matrix is large and slow. Run the complete matrix only in CI. Locally, test the feature combination you are actively working with — every combination must include a device feature:

# Emulator device feature — fastest, covers most code
cadmuscli test --features emulator

# Add the feature you are modifying on top of a device feature
cadmuscli test --features "emulator + profiling + test + tracing"

[!NOTE] The telemetry feature is excluded from the xtask matrix because it aliases tracing + profiling with no separate cfg branches. Use the expanded form (emulator + profiling + test + tracing) instead.

Use cadmuscli ci matrix to see all available feature combinations if you need to verify a specific one.

Coverage locally

In a devenv shell (cadmus-test-coverage, cadmus-coverage-show, cadmus-coverage-diff):

cadmus-test-coverage
cadmus-coverage-show
cadmus-coverage-diff

Without devenv:

cadmuscli test --coverage --features emulator

This writes target/coverage/lcov.info. Project HTML uses cargo llvm-cov report --html. Patch HTML uses diff-cover (see devenv.nix scripts).

What the xtask wrappers do

  • fmt — runs cargo fmt --check (or --apply in CI) across the workspace
  • clippy — iterates the full feature matrix; use --features to narrow it
  • test — iterates the test feature matrix; --coverage enables llvm-cov instrumentation
  • run-emulator — ensures the documentation EPUB exists, then runs cargo run -p cadmus --features emulator
  • install-importer — runs cargo install --path crates/importer

Common mistakes

MistakeResultFix
Running cargo check before cadmuscli docs --mdbook-onlyRustEmbed folder-not-found errorGenerate the EPUB first
Running bare cargo clippy / cargo test directlyMay miss feature-gated code or use wrong feature combinationsPrefer cadmuscli clippy and cadmuscli test
Running cadmuscli test without --featuresRuns the full (slow) CI matrix locallyPass --features emulator (or kobo/deviceless) plus any specific combo you need
Running cargo build / cargo test without a device featurecompile_error!("A device feature must be enabled") in cadmus-corePass --features emulator (or kobo/deviceless)

Platform notes

  • Linux: Native dependencies are built from source automatically via build.rs; ensure gcc, make, cmake, and standard build tools are installed.
  • macOS: Native dependencies are built from source automatically via build.rs; Xcode Command Line Tools must be installed. Full support including Kobo cross-compilation.
  • The build-kobo command cross-compiles for ARM and is available on both Linux and macOS; it runs inside a containerised CI action in the main workflow.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

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.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

OGKevin/cadmus502026년 10월 23일 업데이트

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.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

OGKevin/cadmus502026년 10월 23일 업데이트

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.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

OGKevin/cadmus502026년 10월 23일 업데이트

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.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

OGKevin/cadmus502026년 10월 23일 업데이트

docs

무료

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

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

OGKevin/cadmus502026년 10월 23일 업데이트

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.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

OGKevin/cadmus502026년 10월 23일 업데이트

OGKevin의 스킬 모두 보기

이 스킬의 문제 신고