Skip to content

Commit f7c9b30

Browse files
committed
collect-license-metadata: update submodules before running
Previously, this could cause incorrect failures like the following: ``` diff --git a/license-metadata.json b/license-metadata.json index 4fb5921..b1291c00b94 100644 --- a/license-metadata.json +++ b/license-metadata.json @@ -244,19 +172,6 @@ }, "name": "src/doc/rustc-dev-guide/mermaid.min.js", "type": "file" - }, - { - "children": [], - "license": { - "copyright": [ - "2003-2019 University of Illinois at Urbana-Champaign", - "2003-2019 by the contributors listed in CREDITS.TXT (https://github.com/rust-lang/llvm-project/blob/7738295178045041669876bf32b0543ec8319a5c/llvm/CREDITS.TXT)", - "2010 Apple Inc" - ], - "spdx": "Apache-2.0 WITH LLVM-exception AND NCSA" - }, - "name": "src/llvm-project", - "type": "directory" ``` Additionally, this prints a warning if there were untracked files, which could cause a failure like the following: ``` diff --git a/license-metadata.json b/license-metadata.json index 4fb5921..ebf1c478282 100644 --- a/license-metadata.json +++ b/license-metadata.json @@ -155,6 +155,22 @@ "name": "src/librustdoc/html/static/fonts", "type": "directory" }, + { + "directories": [], + "files": [ + "2015-edition.txt", + "diagnostics.json", + "license.diff", + "test.fixed.rs" + ], + "license": { + "copyright": [ + "NONE" + ], + "spdx": "NONE" + }, + "type": "group" + }, { "license": { "copyright": [ ```
1 parent dc2c356 commit f7c9b30

File tree

1 file changed

+11
-0
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+11
-0
lines changed

src/bootstrap/src/core/build_steps/run.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use std::path::PathBuf;
77

88
use build_helper::exit;
9+
use build_helper::git::get_git_untracked_files;
910
use clap_complete::{Generator, shells};
1011

1112
use crate::core::build_steps::dist::distdir;
@@ -208,6 +209,16 @@ impl Step for CollectLicenseMetadata {
208209

209210
let dest = builder.src.join("license-metadata.json");
210211

212+
if !builder.config.dry_run() {
213+
builder.require_and_update_all_submodules();
214+
if let Ok(Some(untracked)) = get_git_untracked_files(None) {
215+
eprintln!(
216+
"Warning: {} untracked files may cause the license report to be incorrect.",
217+
untracked.len()
218+
);
219+
}
220+
}
221+
211222
let mut cmd = builder.tool_cmd(Tool::CollectLicenseMetadata);
212223
cmd.env("REUSE_EXE", reuse);
213224
cmd.env("DEST", &dest);

0 commit comments

Comments
 (0)