Conversation
|
@dzbarsky What do you think of this approach? In #136 (comment) you doubted that BCR could work, but it seems like maybe it's fine? The |
I chatted with @fionera offline, I don't understand how this PR works and I suspect that it doesn't. I think it places the zlib artifact into the wrong dir so rustc picks up the system one instead of this one.
That seems a little drastic :) You could apply a 1-line patch to comment out this line which will result in rustc picking up the system zlib, which is a hermiticity violation but likely one you don't care about :) Oh, but drake can't patch, right? OK we may need to add a toggle. |
Patches don't inherit to downstream projects. It would fix it when my project is the main module, but not when my project is used as a dependency. I guess this is off-topic for this PR, though. |
Yeah, I connected the dots eventually :) Let me take a peek and see if we can either find some more mirrors or make this download opt-out-able |
|
I think #254 should help here, that mirror seems more stable. Just cut a release bazelbuild/bazel-central-registry#10448 want to give it a shot? @jwnimmer-tri |
|
Thanks, I've updated now. FYI it was only sporadically failing, so I'll probably need about two weeks without an outage to say for sure whether it's fully healed. |
Work toward #248. This does not fully fix the hermetic Linux rustc runtime yet.
Adds a global
--@rules_rs//rs/private:rustc_zlib_from_source=trueflag. On Linux, this buildslibz.so.1from the BCR zlib module and places it alongside rustc's bundled LLVM runtime libraries.The existing Ubuntu package path remains the default and has been moved into lazy architecture-specific repositories, so it is not fetched when source-built zlib is selected.
Adds a Linux E2E test that creates a downstream workspace, enables the flag, then builds and runs a Rust binary.
Known limitation
Testing the same Rust compilation through the actiond Linux VM with remote fallback disabled exposed another missing runtime dependency before the zlib E2E could complete:
The source-built zlib path therefore does not by itself make the Linux rustc toolchain fully hermetic.
libgcc_s.so.1also needs to be supplied before this should be considered a complete fix for #248.Testing
Passing locally:
bazel test //:rustc_zlib_from_source_test --test_output=errorsfromtest/bazel build --//rs/private:rustc_zlib_from_source=true //tools/rust_analyzer:launcherfrom the repository rootRemote actiond VM test:
libgcc_s.so.1was unavailable