diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2023-11-22 15:17:48 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2023-12-04 15:29:23 +0100 |
| commit | c27fe3e0366313933daf6f9a6b3df578bde2682b (patch) | |
| tree | 44de3929155a4bb558d0864be7ffab0ca9433f97 | |
| parent | 694a80d3724cdf7138df550d64fcaceb5d1404b0 (diff) | |
| download | rust-c27fe3e0366313933daf6f9a6b3df578bde2682b.tar.gz rust-c27fe3e0366313933daf6f9a6b3df578bde2682b.zip | |
Correctly handle channel in config
| -rw-r--r-- | build_system/src/config.rs | 4 | ||||
| -rw-r--r-- | build_system/src/test.rs | 8 |
2 files changed, 8 insertions, 4 deletions
diff --git a/build_system/src/config.rs b/build_system/src/config.rs index 763cac8edb6..8bab64f121a 100644 --- a/build_system/src/config.rs +++ b/build_system/src/config.rs @@ -110,7 +110,9 @@ impl ConfigInfo { let current_dir = std_env::current_dir().map_err(|error| format!("`current_dir` failed: {:?}", error))?; - let channel = if let Some(channel) = env.get("CHANNEL") { + let channel = if self.sysroot_release_channel { + "release" + } else if let Some(channel) = env.get("CHANNEL") { channel.as_str() } else { "debug" diff --git a/build_system/src/test.rs b/build_system/src/test.rs index 2619fbc2f64..06a5c3157bb 100644 --- a/build_system/src/test.rs +++ b/build_system/src/test.rs @@ -126,7 +126,6 @@ struct TestArg { build_only: bool, gcc_path: String, channel: Channel, - sysroot_channel: Channel, use_backend: bool, runners: BTreeSet<String>, flags: Vec<String>, @@ -148,8 +147,11 @@ impl TestArg { while let Some(arg) = args.next() { match arg.as_str() { - "--release" => test_arg.channel = Channel::Release, - "--release-sysroot" => test_arg.sysroot_channel = Channel::Release, + "--release" => { + test_arg.channel = Channel::Release; + test_arg.config_info.sysroot_release_channel = true; + } + "--release-sysroot" => test_arg.config_info.sysroot_release_channel = true, "--no-default-features" => { // To prevent adding it more than once. if !test_arg.no_default_features { |
