From 897cf9bba0866edf878a04f0bc408c9ebcb3e61d Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 15 Dec 2016 10:08:06 -0700 Subject: [PATCH 1/4] Add prefix to config.toml --- src/bootstrap/config.rs | 2 ++ src/bootstrap/config.toml.example | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index 60f65f623006c..beb62ef20744c 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -126,6 +126,7 @@ struct Build { target: Vec, cargo: Option, rustc: Option, + prefix: Option, compiler_docs: Option, docs: Option, submodules: Option, @@ -238,6 +239,7 @@ impl Config { } config.rustc = build.rustc.map(PathBuf::from); config.cargo = build.cargo.map(PathBuf::from); + config.prefix = build.prefix; config.nodejs = build.nodejs.map(PathBuf::from); config.gdb = build.gdb.map(PathBuf::from); config.python = build.python.map(PathBuf::from); diff --git a/src/bootstrap/config.toml.example b/src/bootstrap/config.toml.example index b6774b3af20a5..e1f0dac7ddbab 100644 --- a/src/bootstrap/config.toml.example +++ b/src/bootstrap/config.toml.example @@ -70,6 +70,9 @@ # specified, use this rustc binary instead as the stage0 snapshot compiler. #rustc = "/path/to/bin/rustc" +# Instead of installing installing to /usr/local, install to this path instead. +#prefix = "/path/to/install" + # Flag to specify whether any documentation is built. If false, rustdoc and # friends will still be compiled but they will not be used to generate any # documentation. From 58b94bd3a84600047f6a994b55b51bb2baf143d9 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 15 Dec 2016 14:32:40 -0700 Subject: [PATCH 2/4] Update config.toml.example --- src/bootstrap/config.toml.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootstrap/config.toml.example b/src/bootstrap/config.toml.example index e1f0dac7ddbab..76fcfebdb9456 100644 --- a/src/bootstrap/config.toml.example +++ b/src/bootstrap/config.toml.example @@ -70,7 +70,7 @@ # specified, use this rustc binary instead as the stage0 snapshot compiler. #rustc = "/path/to/bin/rustc" -# Instead of installing installing to /usr/local, install to this path instead. +# Instead of installing to /usr/local, install to this path instead. #prefix = "/path/to/install" # Flag to specify whether any documentation is built. If false, rustdoc and From 0a014c684140c8df32aea55801f006a1b8aa973c Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Mon, 19 Dec 2016 15:49:57 -0700 Subject: [PATCH 3/4] Move prefix to [install] section --- src/bootstrap/config.rs | 14 ++++++++++++-- src/bootstrap/config.toml.example | 11 ++++++++--- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index beb62ef20744c..942555274057e 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -113,6 +113,7 @@ pub struct Target { #[derive(RustcDecodable, Default)] struct TomlConfig { build: Option, + install: Option, llvm: Option, rust: Option, target: Option>, @@ -126,7 +127,6 @@ struct Build { target: Vec, cargo: Option, rustc: Option, - prefix: Option, compiler_docs: Option, docs: Option, submodules: Option, @@ -136,6 +136,12 @@ struct Build { python: Option, } +/// TOML representation of various global install decisions. +#[derive(RustcDecodable, Default, Clone)] +struct Install { + prefix: Option, +} + /// TOML representation of how the LLVM build is configured. #[derive(RustcDecodable, Default)] struct Llvm { @@ -239,7 +245,6 @@ impl Config { } config.rustc = build.rustc.map(PathBuf::from); config.cargo = build.cargo.map(PathBuf::from); - config.prefix = build.prefix; config.nodejs = build.nodejs.map(PathBuf::from); config.gdb = build.gdb.map(PathBuf::from); config.python = build.python.map(PathBuf::from); @@ -248,6 +253,10 @@ impl Config { set(&mut config.submodules, build.submodules); set(&mut config.vendor, build.vendor); + if let Some(ref install) = toml.install { + config.prefix = install.prefix.clone(); + } + if let Some(ref llvm) = toml.llvm { set(&mut config.ccache, llvm.ccache); set(&mut config.ninja, llvm.ninja); @@ -257,6 +266,7 @@ impl Config { set(&mut config.llvm_version_check, llvm.version_check); set(&mut config.llvm_static_stdcpp, llvm.static_libstdcpp); } + if let Some(ref rust) = toml.rust { set(&mut config.rust_debug_assertions, rust.debug_assertions); set(&mut config.rust_debuginfo, rust.debuginfo); diff --git a/src/bootstrap/config.toml.example b/src/bootstrap/config.toml.example index 76fcfebdb9456..4a08d66d8d9a0 100644 --- a/src/bootstrap/config.toml.example +++ b/src/bootstrap/config.toml.example @@ -70,9 +70,6 @@ # specified, use this rustc binary instead as the stage0 snapshot compiler. #rustc = "/path/to/bin/rustc" -# Instead of installing to /usr/local, install to this path instead. -#prefix = "/path/to/install" - # Flag to specify whether any documentation is built. If false, rustdoc and # friends will still be compiled but they will not be used to generate any # documentation. @@ -101,6 +98,14 @@ # Indicate whether the vendored sources are used for Rust dependencies or not #vendor = false +# ============================================================================= +# General install configuration options +# ============================================================================= +[install] + +# Instead of installing to /usr/local, install to this path instead. +#prefix = "/path/to/install" + # ============================================================================= # Options for compiling Rust code itself # ============================================================================= From 228e495e7f7fb89ca4047847a5118c5e224a0958 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Mon, 19 Dec 2016 17:42:07 -0700 Subject: [PATCH 4/4] Remove trailing whitespace --- src/bootstrap/config.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index 942555274057e..c38f860141fc7 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -266,7 +266,7 @@ impl Config { set(&mut config.llvm_version_check, llvm.version_check); set(&mut config.llvm_static_stdcpp, llvm.static_libstdcpp); } - + if let Some(ref rust) = toml.rust { set(&mut config.rust_debug_assertions, rust.debug_assertions); set(&mut config.rust_debuginfo, rust.debuginfo);