Skip to content

fix: download Rust nightly hermetically for coq_of_rust build#25

Merged
avrabe merged 2 commits intomainfrom
fix/hermetic-rust-sysroot
Apr 2, 2026
Merged

fix: download Rust nightly hermetically for coq_of_rust build#25
avrabe merged 2 commits intomainfrom
fix/hermetic-rust-sysroot

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented Apr 2, 2026

Summary

  • Downloads Rust nightly components (rustc, cargo, rust-std, rustc-dev) hermetically from static.rust-lang.org within the repository rule
  • Eliminates dependency on host rustup — the libLLVM-19-rust-* linker error in sandboxed CI is fixed because the sysroot lib/ is now always on LIBRARY_PATH
  • Falls back to host rustup if hermetic download is unavailable (unknown platform, no network)
  • Mirrors the approach used in rules_verus for hermetic Rust sysroot setup

Fixes #24

Test plan

  • CI passes (Bazel build + examples)
  • Hermetic path: builds without host rustup on supported platforms (macOS arm64/x86, Linux x86/arm64)
  • Fallback path: still works when hermetic download unavailable

🤖 Generated with Claude Code

avrabe and others added 2 commits April 2, 2026 18:52
Download rustc, cargo, rust-std, and rustc-dev nightly components from
static.rust-lang.org within the repository rule, eliminating the
dependency on host rustup. This fixes the libLLVM-19-rust-* linker
error in sandboxed CI environments where LIBRARY_PATH is stripped.

Falls back to host rustup if hermetic download is unavailable.

Fixes #24

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The coq_of_rust rule only passed wrapper + real_binary to the action,
dropping the rust_sysroot lib files. Bazel's sandbox needs all files
declared as inputs, so librustc_driver was missing at runtime.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@avrabe avrabe merged commit 2cfb99c into main Apr 2, 2026
7 checks passed
@avrabe avrabe deleted the fix/hermetic-rust-sysroot branch April 2, 2026 23:05
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.

coq_of_rust build fails: libLLVM-19-rust-1.85.0-nightly not found during repository fetch

1 participant