]> git.lizzy.rs Git - rust.git/commitdiff
add the build.reuse config option to choose the reuse binary
authorPietro Albini <pietro.albini@ferrous-systems.com>
Tue, 8 Nov 2022 11:27:49 +0000 (12:27 +0100)
committerPietro Albini <pietro.albini@ferrous-systems.com>
Tue, 15 Nov 2022 09:22:17 +0000 (10:22 +0100)
config.toml.example
src/bootstrap/config.rs
src/bootstrap/sanity.rs

index c94a27b12a3a73661f7295f57a79f152ba3b9c3c..ffc6a330b9f60f766af56571c8bac242aae313a2 100644 (file)
@@ -255,6 +255,13 @@ changelog-seen = 2
 # Defaults to the Python interpreter used to execute x.py
 #python = "python"
 
+# The path to the REUSE executable to use. REUSE will be used to gather
+# the licensing information of the codebase.
+#
+# If this is omitted, the cached licensing information present in the source
+# tarball will have to be present.
+#reuse = "reuse"
+
 # Force Cargo to check that Cargo.lock describes the precise dependency
 # set that all the Cargo.toml files create, instead of updating it.
 #locked-deps = false
index af004aa5098542a5d3bbc44af8ddd4382c72501f..34b631c2bcac88f41562c3784e56caf748945e20 100644 (file)
@@ -212,6 +212,7 @@ pub struct Config {
     pub npm: Option<PathBuf>,
     pub gdb: Option<PathBuf>,
     pub python: Option<PathBuf>,
+    pub reuse: Option<PathBuf>,
     pub cargo_native_static: bool,
     pub configure_args: Vec<String>,
 
@@ -610,6 +611,7 @@ struct Build {
         nodejs: Option<String> = "nodejs",
         npm: Option<String> = "npm",
         python: Option<String> = "python",
+        reuse: Option<String> = "reuse",
         locked_deps: Option<bool> = "locked-deps",
         vendor: Option<bool> = "vendor",
         full_bootstrap: Option<bool> = "full-bootstrap",
@@ -1003,6 +1005,7 @@ pub fn parse(args: &[String]) -> Config {
         config.npm = build.npm.map(PathBuf::from);
         config.gdb = build.gdb.map(PathBuf::from);
         config.python = build.python.map(PathBuf::from);
+        config.reuse = build.reuse.map(PathBuf::from);
         config.submodules = build.submodules;
         set(&mut config.low_priority, build.low_priority);
         set(&mut config.compiler_docs, build.compiler_docs);
index 631d42acb93fc3564093496169d0a9b4012a9166..8a40b0f64f4b6c5673ce6fc1c885f4622958c0e0 100644 (file)
@@ -140,6 +140,13 @@ pub fn check(build: &mut Build) {
         .map(|p| cmd_finder.must_have(p))
         .or_else(|| cmd_finder.maybe_have("gdb"));
 
+    build.config.reuse = build
+        .config
+        .reuse
+        .take()
+        .map(|p| cmd_finder.must_have(p))
+        .or_else(|| cmd_finder.maybe_have("reuse"));
+
     // We're gonna build some custom C code here and there, host triples
     // also build some C++ shims for LLVM so we need a C++ compiler.
     for target in &build.targets {