-
Notifications
You must be signed in to change notification settings - Fork 0
Building
- C++20 toolchain:
clang14+ orgcc11+ - Rust 1.85+ stable
-
git(for cloning the Verovio submodule) - POSIX userland (Linux or macOS — Windows is permanently out of scope)
git clone --recurse-submodules https://github.com/ro-ag/verovio-rs
cd verovio-rs
cargo testIf you forgot --recurse-submodules:
git submodule update --init --recursiveFirst clean build takes ~6 minutes (295 C++ source files in -O0 +
debug info). Subsequent incremental builds are seconds.
The repo ships a shell.nix with the full toolchain plus sccache
(compiler cache) and mold (fast linker):
nix-shell
cargo testA clean rebuild after cargo clean, on a warm sccache, completes in
under a minute.
The live-audio feature needs alsa-lib and pkg-config for cpal:
nix-shell -p alsa-lib pkg-config
cargo run --release --features live-audio \
--example live_playback -- soundfont.sf2The sanitize (ASan + UBSan) and sanitize-thread (TSan) features
instrument the C++ build:
RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=lld" \
ASAN_OPTIONS="halt_on_error=1:abort_on_error=1:detect_leaks=0" \
cargo test --features verovio/sanitizeRUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=lld" \
cargo test --features verovio/sanitize-thread --test concurrencySee Concurrency for what TSan reports and why we leave those races unmitigated.
On stable Rust, rust-lld doesn't translate -fsanitize=… into the
matching runtime link. The RUSTFLAGS above forces clang as the
linker driver so the right libsanitizer runtime gets linked.
build.rs panics if both sanitize and sanitize-thread are enabled
together (the runtimes can't coexist).
Matrix:
| Job | Platform | What it runs |
|---|---|---|
test (ubuntu-latest) |
ubuntu-latest | default cargo test
|
test (macos-latest) |
macos-latest | default cargo test
|
test (nix-shell) |
ubuntu-latest |
cargo test inside nix-shell
|
sanitize |
ubuntu-latest | cargo test --features verovio/sanitize |
CI uses sccache backed by the GitHub Actions cache for cross-job
compile caching. If you see "cache storage failed to read" from
sccache, that's a transient GH Actions cache outage — rerun the job.
You enabled live-audio without alsa-lib available. On NixOS:
nix-shell -p alsa-lib pkg-config. On Debian/Ubuntu:
apt install libasound2-dev pkg-config.
Required by bindgen (used only as a fallback for cxx). On NixOS this
isn't on a standard FHS path — shell.nix sets LIBCLANG_PATH for
you. Outside the shell, install clang and ensure libclang.so is
discoverable, or set LIBCLANG_PATH manually.
You cloned without --recurse-submodules and didn't run
git submodule update --init. The Verovio source tree at
crates/verovio-sys/vendor/verovio/ will be empty and the build will
fail to find headers.