mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-01 05:57:03 +03:00
Remove host and target configuration from config.txt
They can still be set using HOST_TRIPLE and TARGET_TRIPLE.
This commit is contained in:
@@ -33,23 +33,3 @@ pub(crate) fn get_bool(name: &str) -> bool {
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn get_value(name: &str) -> Option<String> {
|
||||
let values = load_config_file()
|
||||
.into_iter()
|
||||
.filter(|(key, _)| key == name)
|
||||
.map(|(_, val)| val)
|
||||
.collect::<Vec<_>>();
|
||||
if values.is_empty() {
|
||||
None
|
||||
} else if values.len() == 1 {
|
||||
if values[0].is_none() {
|
||||
eprintln!("Config `{}` missing value", name);
|
||||
process::exit(1);
|
||||
}
|
||||
values.into_iter().next().unwrap()
|
||||
} else {
|
||||
eprintln!("Config `{}` given multiple values: {:?}", name, values);
|
||||
process::exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,10 +156,8 @@ fn main() {
|
||||
let cargo = rustc_info::get_cargo_path();
|
||||
let rustc = rustc_info::get_rustc_path();
|
||||
let rustdoc = rustc_info::get_rustdoc_path();
|
||||
let triple = std::env::var("HOST_TRIPLE")
|
||||
.ok()
|
||||
.or_else(|| config::get_value("host"))
|
||||
.unwrap_or_else(|| rustc_info::get_host_triple(&rustc));
|
||||
let triple =
|
||||
std::env::var("HOST_TRIPLE").unwrap_or_else(|_| rustc_info::get_host_triple(&rustc));
|
||||
Compiler {
|
||||
cargo,
|
||||
rustc,
|
||||
@@ -170,10 +168,8 @@ fn main() {
|
||||
runner: vec![],
|
||||
}
|
||||
};
|
||||
let target_triple = std::env::var("TARGET_TRIPLE")
|
||||
.ok()
|
||||
.or_else(|| config::get_value("target"))
|
||||
.unwrap_or_else(|| bootstrap_host_compiler.triple.clone());
|
||||
let target_triple =
|
||||
std::env::var("TARGET_TRIPLE").unwrap_or_else(|_| bootstrap_host_compiler.triple.clone());
|
||||
|
||||
let dirs = path::Dirs {
|
||||
source_dir: current_dir.clone(),
|
||||
|
||||
-10
@@ -1,15 +1,5 @@
|
||||
# This file allows configuring the build system.
|
||||
|
||||
# Which triple to produce a compiler toolchain for.
|
||||
#
|
||||
# Defaults to the default triple of rustc on the host system.
|
||||
#host = x86_64-unknown-linux-gnu
|
||||
|
||||
# Which triple to build libraries (core/alloc/std/test/proc_macro) for.
|
||||
#
|
||||
# Defaults to `host`.
|
||||
#target = x86_64-unknown-linux-gnu
|
||||
|
||||
# Disables cleaning of the sysroot dir. This will cause old compiled artifacts to be re-used when
|
||||
# the sysroot source hasn't changed. This is useful when the codegen backend hasn't been modified.
|
||||
# This option can be changed while the build system is already running for as long as sysroot
|
||||
|
||||
Reference in New Issue
Block a user