fix(coverage): install the base-pinned Rust release in the coverage image - #2524
Conversation
…mage Debian's rustc 1.85 is older than fast-mlsirm's pinned 1.97.1 (its graph needs >=1.90), so the offline maturin build failed, _core never imported, and every fast-mlsirm coverage run fell below its 100% gate. When the validated base commit pins an exact 1.x.y release, the trusted image installs it from a SHA-256-verified rustup-init (minimal profile + llvm-tools-preview) and binds Rust coverage to that release's LLVM tools. Unpinned repositories keep the Debian image; a failed pinned layer rebuilds the previous image. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PtgtJk1WjqieqvLDb1w8uW
The head-lock intake contract executes the workflow block that ends at the Dockerfile heredoc with a python3 stub; resolving the toolchain inside that block overwrote its argument receipt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PtgtJk1WjqieqvLDb1w8uW
|
Warning Review limit reachedNext included review available in 57 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (10)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
fast-mlsirm's pytest pythonpath puts python/ first, so the source-tree package shadowed the wheel installed into user site-packages and _core stayed unimportable even after a successful offline build. Copy only the wheel's compiled extension members into the tool.maturin.python-source package, as maturin develop does, rejecting paths that leave the project. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PtgtJk1WjqieqvLDb1w8uW
|
Bypass merge record (merge
|
|
Correction: the description said "coverage sits near 68% against its 100% gate". That was wrong. The 68.1% in the log is the docstring-coverage advisory ( |
Why
The coverage image installs Debian's rustc 1.85. fast-mlsirm pins 1.97.1, and its dependency graph needs at least 1.90 (ordered-float, time, wgpu/naga). So
maturin build --offlinefails,_corenever imports, and every fast-mlsirm coverage run sits near 68% against its 100% gate. For example, fast-mlsirm#2256 coverage-evidence job 109519410203. As a result, no fast-mlsirm PR can reach an APPROVED review.What changes
scripts/ci/resolve_base_rust_toolchain.pyreadsrust-toolchain(.toml)from the base SHA only.1.x.ypin is used as-is.stable,nightly-*, custompathand unparsable files all fall back to the central 1.97.1.--profile minimal --component llvm-tools-preview.cargoandrustcare symlinked to the toolchain binaries, so no rustup proxy runs inside--network=none./usr/local/libexec/opencode-rust/*from the same rustc release.Verification
tests/test_resolve_base_rust_toolchain.pyandtests/test_opencode_rust_coverage_toolchain_contract.py. TheREVIEW_DISPATCH_BLOB_SHApin is updated.scripts/ci/test_strix_quick_gate.shpasses. The target tests pass both plain and withGITHUB_ACTIONS=true.--network=noneas a non-root UID: pyo3 0.29.2 from fast-mlsirm's base vendor dir builds offline with maturin and imports, andcargo llvm-covreports 100%._coreimports and the backend resolves torust.🤖 Generated with Claude Code
https://claude.ai/code/session_01PtgtJk1WjqieqvLDb1w8uW
Addendum: the second root cause (commit 2c90c58)
fast-mlsirm's pytest config sets
pythonpath = [".", "python"], so the test suite imports the source tree'spython/fast_mlsirmfirst. A_corethat exists only in user site-packages is shadowed, and the samecannot import name '_core'error persists even after a successful build.scripts/ci/place_maturin_extension.pycopies only the wheel's compiled extension into thetool.maturin.python-sourcepackage, asmaturin developdoes, and rejects paths that leave the project. Reproduced on fast-mlsirm#2157's tree: collection ImportError before placement →17 passedafter.Known follow-up (not in this PR)
On my host (M-series, 4 jobs),
cargo llvm-cov --workspace --all-featurestook 3366 s over fast-mlsirm#2157's tree. The sandbox's per-command cap is 900 s, so a Rust-changing fast-mlsirm PR will likely time out in Rust coverage. The timeout, the test scope, and the repo-ownedminimum_linesmetadata need a separate decision.