about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2024-12-18 18:32:00 +0000
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2024-12-18 18:36:05 +0000
commit53bbef8305877fd32d0358501fd6fc34a9e33360 (patch)
treebb2fb6238eed3598ceb8b33da1cce1466b108aed
parent88139f0c6b14f493022bdd5c9a2881cf57cc861c (diff)
downloadrust-53bbef8305877fd32d0358501fd6fc34a9e33360.tar.gz
rust-53bbef8305877fd32d0358501fd6fc34a9e33360.zip
Remove host and target configuration from config.txt
They can still be set using HOST_TRIPLE and TARGET_TRIPLE.
-rw-r--r--build_system/config.rs20
-rw-r--r--build_system/main.rs12
-rw-r--r--config.txt10
3 files changed, 4 insertions, 38 deletions
diff --git a/build_system/config.rs b/build_system/config.rs
index ef540cf1f82..37bc4c5d782 100644
--- a/build_system/config.rs
+++ b/build_system/config.rs
@@ -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);
-    }
-}
diff --git a/build_system/main.rs b/build_system/main.rs
index 2f892b9038e..3ff9751a3ef 100644
--- a/build_system/main.rs
+++ b/build_system/main.rs
@@ -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(),
diff --git a/config.txt b/config.txt
index b63597f60fc..9808ad624e1 100644
--- a/config.txt
+++ b/config.txt
@@ -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