Skip to content

Commit 53bbef8

Browse files
committed
Remove host and target configuration from config.txt
They can still be set using HOST_TRIPLE and TARGET_TRIPLE.
1 parent 88139f0 commit 53bbef8

File tree

3 files changed

+4
-38
lines changed

3 files changed

+4
-38
lines changed

build_system/config.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,3 @@ pub(crate) fn get_bool(name: &str) -> bool {
3333
true
3434
}
3535
}
36-
37-
pub(crate) fn get_value(name: &str) -> Option<String> {
38-
let values = load_config_file()
39-
.into_iter()
40-
.filter(|(key, _)| key == name)
41-
.map(|(_, val)| val)
42-
.collect::<Vec<_>>();
43-
if values.is_empty() {
44-
None
45-
} else if values.len() == 1 {
46-
if values[0].is_none() {
47-
eprintln!("Config `{}` missing value", name);
48-
process::exit(1);
49-
}
50-
values.into_iter().next().unwrap()
51-
} else {
52-
eprintln!("Config `{}` given multiple values: {:?}", name, values);
53-
process::exit(1);
54-
}
55-
}

build_system/main.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,8 @@ fn main() {
156156
let cargo = rustc_info::get_cargo_path();
157157
let rustc = rustc_info::get_rustc_path();
158158
let rustdoc = rustc_info::get_rustdoc_path();
159-
let triple = std::env::var("HOST_TRIPLE")
160-
.ok()
161-
.or_else(|| config::get_value("host"))
162-
.unwrap_or_else(|| rustc_info::get_host_triple(&rustc));
159+
let triple =
160+
std::env::var("HOST_TRIPLE").unwrap_or_else(|_| rustc_info::get_host_triple(&rustc));
163161
Compiler {
164162
cargo,
165163
rustc,
@@ -170,10 +168,8 @@ fn main() {
170168
runner: vec![],
171169
}
172170
};
173-
let target_triple = std::env::var("TARGET_TRIPLE")
174-
.ok()
175-
.or_else(|| config::get_value("target"))
176-
.unwrap_or_else(|| bootstrap_host_compiler.triple.clone());
171+
let target_triple =
172+
std::env::var("TARGET_TRIPLE").unwrap_or_else(|_| bootstrap_host_compiler.triple.clone());
177173

178174
let dirs = path::Dirs {
179175
source_dir: current_dir.clone(),

config.txt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
11
# This file allows configuring the build system.
22

3-
# Which triple to produce a compiler toolchain for.
4-
#
5-
# Defaults to the default triple of rustc on the host system.
6-
#host = x86_64-unknown-linux-gnu
7-
8-
# Which triple to build libraries (core/alloc/std/test/proc_macro) for.
9-
#
10-
# Defaults to `host`.
11-
#target = x86_64-unknown-linux-gnu
12-
133
# Disables cleaning of the sysroot dir. This will cause old compiled artifacts to be re-used when
144
# the sysroot source hasn't changed. This is useful when the codegen backend hasn't been modified.
155
# This option can be changed while the build system is already running for as long as sysroot

0 commit comments

Comments
 (0)