-
Notifications
You must be signed in to change notification settings - Fork 82
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
vargo: Decouple from rustup #877
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! Thank you for the PR!
This all seems reasonable, but let me think through the implications. One small question in the meantime (Edit: now I've actually posted the question :).
if let Ok(sysroot) = std::env::var("RUST_SYSROOT") { | ||
child_args.push("--sysroot".to_string()); | ||
child_args.push(sysroot); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need this? Is it to set a sysroot manually, that would otherwise be set by rustup
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Somehow missed the notification, my apologies)
Yes, rustup
wrappers automatically set the correct LD_LIBRARY_PATH
(or equivalents on other platforms) when executing the toolchain binaries, and binaries distributed by rust-overlay
and fenix
have their runpaths patched so the default sysroot detection logic works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Do you know if there's a way to set the sysroot for rustc with an environment variable? Or is it just the --sysroot
flag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Sorry again)
I quickly looked, and I couldn't find an environment variable to do this override.
22394c9
to
0b4c9f8
Compare
Sorry all, it's been a while but I rebased the PR on top of the latest changes. |
0b4c9f8
to
06b1222
Compare
This PR makes vargo aware of a new environment variable,
VARGO_TOOLCHAIN
, which can be one of the following:rust-toolchain.toml
(current behavior)host
: Uses the Rust toolchain fromPATH
(3) allows Verus to be built without rustup, which is useful when the Rust toolchain is managed by something else like Nix + rust-overlay. Furthermore, (2) can be used to temporarily override the rustup toolchain to test Rust updates.
We've been using this downstream for a while since we use Nix to manage everything. We are submitting this upstream to see if this is something you would like and to stop bumping into merge conflicts 😄