Skip to content

Commit 17ee25d

Browse files
committed
add the build.reuse config option to choose the reuse binary
1 parent 101e182 commit 17ee25d

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

config.toml.example

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,13 @@ changelog-seen = 2
255255
# Defaults to the Python interpreter used to execute x.py
256256
#python = "python"
257257

258+
# The path to the REUSE executable to use. REUSE will be used to gather
259+
# the licensing information of the codebase.
260+
#
261+
# If this is omitted, the cached licensing information present in the source
262+
# tarball will have to be present.
263+
#reuse = "reuse"
264+
258265
# Force Cargo to check that Cargo.lock describes the precise dependency
259266
# set that all the Cargo.toml files create, instead of updating it.
260267
#locked-deps = false

src/bootstrap/config.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ pub struct Config {
212212
pub npm: Option<PathBuf>,
213213
pub gdb: Option<PathBuf>,
214214
pub python: Option<PathBuf>,
215+
pub reuse: Option<PathBuf>,
215216
pub cargo_native_static: bool,
216217
pub configure_args: Vec<String>,
217218

@@ -610,6 +611,7 @@ define_config! {
610611
nodejs: Option<String> = "nodejs",
611612
npm: Option<String> = "npm",
612613
python: Option<String> = "python",
614+
reuse: Option<String> = "reuse",
613615
locked_deps: Option<bool> = "locked-deps",
614616
vendor: Option<bool> = "vendor",
615617
full_bootstrap: Option<bool> = "full-bootstrap",
@@ -1003,6 +1005,7 @@ impl Config {
10031005
config.npm = build.npm.map(PathBuf::from);
10041006
config.gdb = build.gdb.map(PathBuf::from);
10051007
config.python = build.python.map(PathBuf::from);
1008+
config.reuse = build.reuse.map(PathBuf::from);
10061009
config.submodules = build.submodules;
10071010
set(&mut config.low_priority, build.low_priority);
10081011
set(&mut config.compiler_docs, build.compiler_docs);

src/bootstrap/sanity.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,13 @@ than building it.
140140
.map(|p| cmd_finder.must_have(p))
141141
.or_else(|| cmd_finder.maybe_have("gdb"));
142142

143+
build.config.reuse = build
144+
.config
145+
.reuse
146+
.take()
147+
.map(|p| cmd_finder.must_have(p))
148+
.or_else(|| cmd_finder.maybe_have("reuse"));
149+
143150
// We're gonna build some custom C code here and there, host triples
144151
// also build some C++ shims for LLVM so we need a C++ compiler.
145152
for target in &build.targets {

0 commit comments

Comments
 (0)