-
Notifications
You must be signed in to change notification settings - Fork 432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fully support windows without --enable_runfiles
#1156
Labels
Comments
UebelAndre
changed the title
Fully support windows without --enable_runfiles
Fully support windows without Feb 27, 2022
--enable_runfiles
This was referenced Sep 14, 2024
github-merge-queue bot
pushed a commit
that referenced
this issue
Sep 19, 2024
Partially addresses #1156
UebelAndre
added a commit
to UebelAndre/rules_rust
that referenced
this issue
Sep 19, 2024
…uild#2871) Partially addresses bazelbuild#1156
github-merge-queue bot
pushed a commit
that referenced
this issue
Sep 19, 2024
Partially addresses #1156 This pull-request implements an additional change to enable this behavior which aggregates all transitive `BuildInfo.compile_data` into `Rustc` actions. While this seems to bloat these actions with unnecessary data, it addresses a catastrophic flaw in how Windows works at all. As of Bazel 7.3.1, Windows does not run any actions in a sandbox (bazelbuild/bazel#18401), this means that references to the current working directory will be consistent since they always refer to the execroot. On top of this fact, `cargo_build_script` will assign [CARGO_MANIFEST_DIR](https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-crates) to a [path within the runfiles directory of the build script](https://github.com/bazelbuild/rules_rust/blame/d9ee6172d1dfc2801ba809441668e60e797f89de/cargo/private/cargo_build_script.bzl#L218). The combination of these two facts leads crates like [windows_x86_64_msvc](https://crates.io/crates/windows_x86_64_msvc), which assign a linker path using `CARGO_MANIFEST_DIR` ([@windows_x86_64_msvc//build.rs](https://github.com/microsoft/windows-rs/blob/0.59.0/crates/targets/x86_64_msvc/build.rs#L1-L8)) to introduce un-tracked dependencies into dependent `Rustc` actions. This then leads to build failures if the `windows_x86_64_msvc` crate is ever a remote cache hit for the dependents as runfiles (or `.cargo_runfiles` in the case of this PR) are not fetched and will not exist on the host at link time. This change addresses this issue of untracked dependencies by ensuring the runfiles of `cargo_build_script.script` targets are aggregated into `Rustc` actions.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
rules_rust
currently has some components that require --enable_runfiles and --windows_enable_symlinks to be set on windows. This should not be needed and all rules should work without requiring any flags.Rules that require extra flags:
cargo_build_script
(Updatecargo_build_script
to work without runfiles support. #2871)rust_doc_test
crate_universe
The text was updated successfully, but these errors were encountered: