-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
env hack to deal with sccache issues #296
Conversation
addresses #295 |
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, let's call this CARGO_ZIGBUILD_RUSTC_VERSION
.
@@ -106,7 +106,10 @@ impl Zig { | |||
.and_then(|index| cmd_args.get(index + 1)); | |||
let target_info = TargetInfo::new(target); | |||
|
|||
let rustc_ver = rustc_version::version()?; | |||
let rustc_ver = match env::var("CARGOZIGBUILD_RUSTC_VERSION") { |
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.
let rustc_ver = match env::var("CARGOZIGBUILD_RUSTC_VERSION") { | |
let rustc_ver = match env::var("CARGO_ZIGBUILD_RUSTC_VERSION") { |
@@ -512,6 +515,11 @@ impl Zig { | |||
.map(|target| target.split_once('.').map(|(t, _)| t).unwrap_or(target)) | |||
.collect::<Vec<&str>>(); | |||
let rustc_meta = rustc_version::version_meta()?; | |||
Self::add_env_if_missing( | |||
cmd, | |||
"CARGOZIGBUILD_RUSTC_VERSION", |
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.
"CARGOZIGBUILD_RUSTC_VERSION", | |
"CARGO_ZIGBUILD_RUSTC_VERSION", |
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.
I'll do the rename locally
What this does: adds
CARGOZIGBUILD_RUSTC_VERSION
(idk what else to name it) variable that is used byZig::execute_compiler
to avoid callingsccache rustc -vV
in some cases