From 3ae5c2b010d1f78d9aeec217e78e5cc7246a1327 Mon Sep 17 00:00:00 2001 From: Ashley Hauck <953151+khyperia@users.noreply.github.com> Date: Thu, 28 Oct 2021 13:09:32 +0200 Subject: [PATCH] Remove CARGO_FEATURES_* and CARGO_CFG_* (#782) --- crates/spirv-builder/src/lib.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/spirv-builder/src/lib.rs b/crates/spirv-builder/src/lib.rs index dff332a9a8..6234406a49 100644 --- a/crates/spirv-builder/src/lib.rs +++ b/crates/spirv-builder/src/lib.rs @@ -477,6 +477,15 @@ fn invoke_rustc(builder: &SpirvBuilder) -> Result { } } + for (key, _) in env::vars_os() { + let remove = key.to_str().map_or(false, |s| { + s.starts_with("CARGO_FEATURES_") || s.starts_with("CARGO_CFG_") + }); + if remove { + cargo.env_remove(key); + } + } + let cargo_encoded_rustflags = join_checking_for_separators(rustflags, "\x1f"); let build = cargo