8000 cargo-llvm-cov: add 0.9.2 by bryan-minimal · Pull Request #1612 · gominimal/pkgs · GitHub
[go: up one dir, main page]

Skip to content

cargo-llvm-cov: add 0.9.2 - #1612

Merged
bryan-minimal merged 1 commit into
mainfrom
add-cargo-llvm-cov
Nov 21, 2026
Merged

bryan-minimal merged 1 commit into
mainfrom
add-cargo-llvm-cov

Conversation

@bryan-minimal
Copy link
Copy Markdown
Member

Summary

Adds cargo-llvm-cov 0.9.2, the latest release (taiki-e/cargo-llvm-cov), for the fv-lab formal-verification loadout. It is built from source with our rust and follows the cargo-nextest / wasm-bindgen-cli pattern: --locked and --remap-path-prefix. It ships only usr/bin/cargo-llvm-cov, with runtime deps glibc and subsetOf gcc ["libgcc"]. It brings no toolchain and no LLVM.

Changes

  • packages/cargo-llvm-cov/: the source is the published crate, static.crates.io/.../cargo-llvm-cov-0.9.2.crate (sha256 079b7461…871e, which matches the crates.io API checksum). It is not the GitHub tag archive, because upstream commits no Cargo.lock. Only the .crate carries the lock it was released with, so --locked needs it.
    • Why it isn't mirrored to gs://: pkgmgr's updater resolves a gs:// mirror's upstream through a tarball-extension table and a GitHub-archive fallback. Neither knows .crate, so a bump would fetch the lock-less tag archive. A direct, sha-pinned crates.io URL keeps the updater working. wasm-bindgen-cli already uses it.
  • Tests: cargo-llvm-cov llvm-cov --version must print exactly cargo-llvm-cov 0.9.2, and --help must list --lcov.

Testing

  • arm64, local min session: min package build --rebuild --verbose cargo-llvm-cov finished, and min check was all Pass. amd64 is up to build-bot.
  • Real coverage run, arm64 session: a tiny lib crate with one test that covers one of three branches, run with cargo-llvm-cov + rust-nightly-charon + llvm + toolchain:
    • LLVM_COV=/usr/bin/llvm-cov LLVM_PROFDATA=/usr/bin/llvm-profdata cargo llvm-cov --offline reports 12 regions, 2 missed (83.33%). The ^0 markers fall on the two untaken branches, which is correct.
    • Without those variables, it errors: failed to find llvm-tools-preview, please install llvm-tools-preview, or set LLVM_COV and LLVM_PROFDATA.

LLVM / toolchain compatibility (findings, no change here)

cargo llvm-cov needs llvm-cov and llvm-profdata with the same LLVM major as the rustc that builds the code. It looks for them in $(rustc --print target-libdir)/../bin, which is where rustup's llvm-tools component installs them. Failing that, it reads LLVM_COV and LLVM_PROFDATA. It never downloads anything; it only suggests rustup component add when rustup is installed.

rustc LLVM profiler runtime works with cargo-llvm-cov?
rust-nightly-charon (nightly 2026-09-17, 1.100.0-nightly) 23.1.1 (bundled libLLVM.so.23.1-rust-1.100.0-nightly) yes (libprofiler_builtins in rust-std) Yes, with LLVM_COV/LLVM_PROFDATA pointed at our llvm 23.1.5 (same major). Verified above.
rust 1.100.0 (stable, from source) 23.1.5 (our llvm) no No. -C instrument-coverage fails with E0463: can't find crate for profiler_builtins ("the compiler may have been built without the profiler runtime").

What's needed:

  1. fv-lab, using charon's nightly: the LLVM majors already match. To work out of the box, choose one of:
    • (a) preferred: add the llvm-tools-nightly component (same date) to rust-nightly-charon. Its llvm-cov and llvm-profdata land in lib/rustlib/<host>/bin, which cargo-llvm-cov finds without configuration, and they always match rustc's LLVM exactly.
    • (b): add llvm to the loadout and set LLVM_COV=/usr/bin/llvm-cov LLVM_PROFDATA=/usr/bin/llvm-profdata. This works today, but it pulls in the whole llvm/clang package, and the match holds only while both stay on LLVM 23.
  2. Stable rust: the package needs the profiler runtime. Our llvm already ships /usr/lib/clang/23/lib/<triple>/libclang_rt.profile.a. Setting profiler = "<that path>" per target in packages/rust/bootstrap.toml should be enough; [build] profiler = true instead builds it from the vendored compiler-rt. rust already runtime-depends on llvm, so /usr/bin/llvm-cov is present wherever rust is. Optionally, symlinking llvm-cov and llvm-profdata into usr/lib/rustlib/<host>/bin would make discovery automatic.

Neither change is made here; rust-nightly-charon and rust are untouched.

Notes for reviewers

  • Rust packages on main use subsetOf gcc ["libgcc"]. This becomes gcc-runtime once gcc 15.2.0 → 16.2.0, with gcc-runtime split out (pm#1182) #1545 lands.
  • I left a real coverage run out of the standalone tests. Our stable rust can't do one yet (finding 2 above), and making rust-nightly-charon + llvm test deps seemed too heavy for a smoke test. Once rust has the profiler, the test is easy to add.

🤖 Generated with Claude Code

`cargo llvm-cov` (taiki-e/cargo-llvm-cov) for the fv-lab loadout, built from
the published crate with our `rust` (--locked against the crate's Cargo.lock;
upstream commits none). Ships only the cargo subcommand: no toolchain, no LLVM.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bryan-minimal
bryan-minimal requested a review from a team as a code owner November 20, 2026 20:35
@coderabbitai
coderabbitai Bot commented Nov 20, 2026
Copy link
Copy Markdown
Contributor

Warning

Review limit reached

  • Run on-demand review

This review includes 2 billable files and costs up to $0.50.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 38 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 67 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 03aa958 and 185e264.

Files selected for processing: 2

  • packages/cargo-llvm-cov/build.ncl
  • packages/cargo-llvm-cov/build.sh
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@bryan-minimal
bryan-minimal added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit 7161f85 Nov 21, 2026
16 checks passed
@bryan-minimal
bryan-minimal deleted the add-cargo-llvm-cov branch November 21, 2026 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

38AA

2 participants

0