Skip to content

Commit 1e40745

Browse files
author
Jon Gjengset
committed
Remove CARGO_ prefix for new build script envvars
1 parent 8012d32 commit 1e40745

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/cargo/core/compiler/custom_build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,9 @@ fn build_work(cx: &mut Context<'_, '_>, unit: &Unit) -> CargoResult<Job> {
251251

252252
// Also inform the build script of the rustc compiler context.
253253
if let Some(wrapper) = bcx.rustc().wrapper.as_ref() {
254-
cmd.env("CARGO_RUSTC_WRAPPER", wrapper);
254+
cmd.env("RUSTC_WRAPPER", wrapper);
255255
}
256-
cmd.env("CARGO_RUSTFLAGS", bcx.rustflags_args(unit).join(" "));
256+
cmd.env("RUSTFLAGS", bcx.rustflags_args(unit).join(" "));
257257

258258
// Gather the set of native dependencies that this package has along with
259259
// some other variables to close over.

tests/testsuite/build_script.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ fn custom_build_env_vars() {
120120
121121
assert!(env::var("RUSTC_LINKER").is_err());
122122
123-
let rustflags = env::var("CARGO_RUSTFLAGS").unwrap();
123+
let rustflags = env::var("RUSTFLAGS").unwrap();
124124
assert_eq!(rustflags, "");
125125
}}
126126
"#,
@@ -161,9 +161,9 @@ fn custom_build_env_var_rustflags() {
161161
// Static assertion that exactly one of the cfg paths is always taken.
162162
let x;
163163
#[cfg(special)]
164-
{{ assert_eq!(env::var("CARGO_RUSTFLAGS").unwrap(), "{}"); x = String::new(); }}
164+
{{ assert_eq!(env::var("RUSTFLAGS").unwrap(), "{}"); x = String::new(); }}
165165
#[cfg(notspecial)]
166-
{{ assert_eq!(env::var("CARGO_RUSTFLAGS").unwrap(), "{}"); x = String::new(); }}
166+
{{ assert_eq!(env::var("RUSTFLAGS").unwrap(), "{}"); x = String::new(); }}
167167
let _ = x;
168168
}}
169169
"#,
@@ -190,7 +190,7 @@ fn custom_build_env_var_rustc_wrapper() {
190190
191191
fn main() {{
192192
assert_eq!(
193-
env::var("CARGO_RUSTC_WRAPPER").unwrap(),
193+
env::var("RUSTC_WRAPPER").unwrap(),
194194
env::var("CARGO_RUSTC_WRAPPER_CHECK").unwrap()
195195
);
196196
}}

0 commit comments

Comments
 (0)