Significantly simplify sysroot configuration#342
Merged
Conversation
jyn514
reviewed
Jun 21, 2023
Comment on lines
-127
to
-142
| let our_exe_filename = std::env::current_exe() | ||
| .ok() | ||
| .and_then(|p| p.file_stem().map(ToOwned::to_owned)) | ||
| .unwrap_or_else(|| "plrustc".into()); | ||
|
|
||
| let wrapper_mode = orig_args | ||
| .get(1) | ||
| .map(std::path::Path::new) | ||
| .and_then(std::path::Path::file_stem) | ||
| .map_or(false, |name| { | ||
| name == our_exe_filename || name == "plrustc" || name == "rustc" | ||
| }); | ||
|
|
||
| if wrapper_mode { | ||
| args.remove(1); | ||
| } |
There was a problem hiding this comment.
note that removing this means that setting RUSTC_WORKSPACE_WRAPPER=plrustc won't work anymore, but thom tells me you were using RUSTC instead anyway.
Contributor
Author
There was a problem hiding this comment.
Yes, I don't think we realistically supported that anyway.
workingjubilee
approved these changes
Jun 21, 2023
| } | ||
|
|
||
| // TODO: eventually we can replace this with: | ||
| // rustc_driver::install_ice_hook("https://github.com/tcdi/plrust/issues/new", |_| ()); |
There was a problem hiding this comment.
as soon as you update the nightly toolchain :) rust-lang/rust#110989
Contributor
Author
There was a problem hiding this comment.
We actually don't use nightly >_>
There was a problem hiding this comment.
ah. when 1.71 lands on stable in a few weeks, then.
Comment on lines
+112
to
+113
| let args = rustc_driver::args::arg_expand_all(&std::env::args().collect::<Vec<_>>()); | ||
| let config = PlrustcConfig::from_env_and_args(&args); |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We no longer have to manually search for the sysroot, as of rust-lang/rust#103660 it should be auto-detected from first the arguments passed, followed by locating it based on the location of the rustc_driver dynamic library.
This means we don't support configuring it via the environment anymore, but I don't believe anybody was explicitly using this anyway. Regardless, if they were configuring it to a different value than we locate with this function, it was almost certainly wrong. Still, we should make a note in the next release notes about it.
Thanks to @jyn514 for pointing this out to me!