Skip to content

Commit 4d479f9

Browse files
Rollup merge of #137340 - Kobzol:bootstrap-dir-check, r=onur-ozkan
Add a notice about missing GCC sources into source tarballs I didn't use `.gitkeep`, because that would be a hidden file that might not be noticed, whereas we want to let people inspecting the archive know why the sources are missing. Inspired by #137332. r? `@onur-ozkan`
2 parents 02ceb5f + c0bea5d commit 4d479f9

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

Diff for: src/bootstrap/src/core/build_steps/dist.rs

+11
Original file line numberDiff line numberDiff line change
@@ -1029,6 +1029,17 @@ impl Step for PlainSourceTarball {
10291029
],
10301030
plain_dst_src,
10311031
);
1032+
// We keep something in src/gcc because it is a registered submodule,
1033+
// and if it misses completely it can cause issues elsewhere
1034+
// (see https://github.com/rust-lang/rust/issues/137332).
1035+
// We can also let others know why is the source code missing.
1036+
if !builder.config.dry_run() {
1037+
builder.create_dir(&plain_dst_src.join("src/gcc"));
1038+
t!(std::fs::write(
1039+
plain_dst_src.join("src/gcc/notice.txt"),
1040+
"The GCC source code is not included due to unclear licensing implications\n"
1041+
));
1042+
}
10321043

10331044
// Copy the files normally
10341045
for item in &src_files {

Diff for: src/bootstrap/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ impl Build {
492492
}
493493
self.config.update_submodule(submodule);
494494
let absolute_path = self.config.src.join(submodule);
495-
if dir_is_empty(&absolute_path) {
495+
if !absolute_path.exists() || dir_is_empty(&absolute_path) {
496496
let maybe_enable = if !self.config.submodules()
497497
&& self.config.rust_info.is_managed_git_subrepository()
498498
{

0 commit comments

Comments
 (0)