We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6eb3e97 commit cd4adb8Copy full SHA for cd4adb8
src/bootstrap/src/core/build_steps/compile.rs
@@ -975,6 +975,13 @@ pub fn rustc_cargo_env(
975
.env("CFG_RELEASE_CHANNEL", &builder.config.channel)
976
.env("CFG_VERSION", builder.rust_version());
977
978
+ // Some tools like Cargo detect their own git information in build scripts. When omit-git-hash
979
+ // is enabled in config.toml, we pass this environment variable to tell build scripts to avoid
980
+ // detecting git information on their own.
981
+ if builder.config.omit_git_hash {
982
+ cargo.env("CFG_OMIT_GIT_HASH", "1");
983
+ }
984
+
985
if let Some(backend) = builder.config.default_codegen_backend() {
986
cargo.env("CFG_DEFAULT_CODEGEN_BACKEND", backend);
987
}
0 commit comments