From 17ee25d77550b771200d73533e3bcb2a9959122d Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Tue, 8 Nov 2022 12:27:49 +0100 Subject: [PATCH] add the build.reuse config option to choose the reuse binary --- config.toml.example | 7 +++++++ src/bootstrap/config.rs | 3 +++ src/bootstrap/sanity.rs | 7 +++++++ 3 files changed, 17 insertions(+) diff --git a/config.toml.example b/config.toml.example index c94a27b12a3..ffc6a330b9f 100644 --- a/config.toml.example +++ b/config.toml.example @@ -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 diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index af004aa5098..34b631c2bca 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -212,6 +212,7 @@ pub struct Config { pub npm: Option, pub gdb: Option, pub python: Option, + pub reuse: Option, pub cargo_native_static: bool, pub configure_args: Vec, @@ -610,6 +611,7 @@ struct Build { nodejs: Option = "nodejs", npm: Option = "npm", python: Option = "python", + reuse: Option = "reuse", locked_deps: Option = "locked-deps", vendor: Option = "vendor", full_bootstrap: Option = "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); diff --git a/src/bootstrap/sanity.rs b/src/bootstrap/sanity.rs index 631d42acb93..8a40b0f64f4 100644 --- a/src/bootstrap/sanity.rs +++ b/src/bootstrap/sanity.rs @@ -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 { -- 2.44.0