-
Notifications
You must be signed in to change notification settings - Fork 483
Delete experimental_toolchain_generated_sysroot
#2848
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
Conversation
aa46c32
to
5070b4f
Compare
Could we functionally keep this around (possibly renaming it to non-experimental)? We've got a use case (quite convolved admittedly, so bear with me) for this where we need the ability to prevent passing the computed For this, we currently have a custom single (Ideally, we'd have two separate rust_toolchain-s: one for the standard libs that packages the nightly stdlibs, and another one for the proc_macro-s that packages the beta stdlibs, but I don't know of a way to do that via toolchain resolution: if the target platform is the same as the exec platform, the only thing on bazel toolchain resolution side that distinguishes them is that one of them is exec, and you can't use that for toolchain resolution purposes.) (We could still work around not having this ability by updating the script to strip off the --sysroot generated by rules_rust and replacing it with a custom one, but that's a bit complicated as it will need to handle the various ways there are to pass flags, like via param files and stuff.) |
Wait, I'm confused, do you have a use for it or are you using it? If the former it kinda sounds like you want something like C++ toolchain features where you can control what flags are used and optionally disable some. And if that's the case then I'd say lets merge this and start working on that but admidetly this change isn't absolutely needed and can wait. I just don't wanna keep incompatibility/experimental to permanently persist in lieu of actually building useful functionality. |
We are using this (specifically the ability to disable passing the generated --sysroot by setting the build setting to false in some build configurations). And I agree and think the default behavior makes sense, so I suggest to just promote this flag to be non-experimental. |
Can you put that PR together and close the tracking issue then? |
You can probably make this work by transitioning your stdlibs to a platform that has an additional constraint (let's call it "has-sysroot-flag=true" for now). You'll need to register your toolchains all having an explicit value for that constraint ("has-sysroot-flag=true" and "has-sysroot-flag=false") because a missing constraint on a toolchain is treated as "compatible with all values of this constraint". You can see a similar-ish example at rules_rust/examples/musl_cross_compiling/WORKSPACE.bazel Lines 86 to 95 in 9ad0b00
(by krasimir: sorry I accidentally edited your comment initially instead of posting a reply 🤦 ) |
Thank you for the suggestion! Naively, this situation is a bit different in that we still need to use two different sysroots even when # these two toolchains are distinuished by has-sysroot-flag
rust_toolchain(
name = "for_deps",
rust_std = "std_for_deps",
)
rust_toolchain(
name = "for_proc_macro_deps",
rust_std = "std_for_proc_macro_deps",
)
rust_binary(
name = "rustc",
deps = [
"rustc_lib1", # needs std_for_deps sysroot
],
proc_macro_deps = [
"rustc_pm1", # needs std_for_proc_macro_deps sysroot
],
) There are several approaches that can solve this, but all that we have considered bad tradeoffs with other features: we could apply a custom user-defined transition that flips the has-sysroot-flag on the |
Prepped #2849 to keep this around as non-experimental. |
Pull request was closed
…2849) No functional changes intended. We've got a use case where the ability to turn this off is useful, see (#2848 (comment)). Closes #2298
Closes #2298