-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
RUSTC_WRAPPER is ignored #45
Comments
Happy to review a PR -- I'm doing passive maintenance only for this project. |
I think the only thing needed for this is that: pub fn version_meta() -> Result<VersionMeta> {
let cmd = env::var_os("RUSTC").unwrap_or_else(|| OsString::from("rustc"));
VersionMeta::for_command(Command::new(cmd))
} first checks RUSTC_WRAPPER, maybe like so: pub fn version_meta() -> Result<VersionMeta> {
let rustc = env::var_os("RUSTC").unwrap_or_else(|| OsString::from("rustc"));
let cmd = if let Some(wrapper) = env::var_os("RUSTC_WRAPPER") {
Command::new(wrapper).arg(rustc)
} else {
Command::new(rustc)
};
VersionMeta::for_command(cmd)
} |
@hkBst great -- want to submit a PR for that? |
done |
This seems mostly right, except for one corner case: if the env var is set to the empty string, that means there is no wrapper.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
rustc-version has the same issue as rust-lang/cargo#10885: it will by default ignore RUSTC_WRAPPER, so tools that expect to intercept all communication between a build and rustc by setting the wrapper will get entirely bypassed. If the wrapper ends up invoking an entirely different version of rustc than what is in the PATH, that can lead to incorrect results (e.g. when rustc-version is used from a build script).
The text was updated successfully, but these errors were encountered: