Skip to content

Commit b9676c2

Browse files
committed
Make distcheck use the tarball submodule directories
When Distcheck runs, it invokes `make check` with the current directory set to `<git_root>/build/tmp/distcheck` which contains an extracted plain source tarball. Without passing `--src`, bootstrap's `compute_src_directory` will call `git rev-parse --show-cdup` from that tmp directory and get back to `<git_root>` At that point all the `git_info` calls will find submodules in the original git checkout, not in the tarball. If we instead pass `--src`, `compute_src_directory` will use the argument directory and all the git info commands will use the tarball git-commit-info files. Additionally, we update tidy's `gcc_submodule` check to look for the `src/gcc/notice.txt` file that is present in tarballs to indicate that we did not include the `src/gcc` submodule.
1 parent cba5918 commit b9676c2

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/bootstrap/mk/Makefile.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ifdef MAKEFLAGS
1313
endif
1414
endif
1515

16-
BOOTSTRAP := $(CFG_PYTHON) $(CFG_SRC_DIR)src/bootstrap/bootstrap.py
16+
BOOTSTRAP := $(CFG_PYTHON) $(CFG_SRC_DIR)src/bootstrap/bootstrap.py --src $(CFG_SRC_DIR)
1717

1818
all:
1919
$(Q)$(BOOTSTRAP) build --stage 2 $(BOOTSTRAP_ARGS)
@@ -46,7 +46,7 @@ book:
4646
standalone-docs:
4747
$(Q)$(BOOTSTRAP) doc --stage 2 src/doc $(BOOTSTRAP_ARGS)
4848
check:
49-
$(Q)$(BOOTSTRAP) test --stage 2 $(BOOTSTRAP_ARGS)
49+
$(Q)$(BOOTSTRAP) test --verbose --stage 2 $(BOOTSTRAP_ARGS)
5050
check-aux:
5151
$(Q)$(BOOTSTRAP) test --stage 2 \
5252
src/tools/cargo \

src/tools/tidy/src/gcc_submodule.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ pub fn check(root_path: &Path, compiler_path: &Path, bad: &mut bool) {
1313
.trim()
1414
.to_string();
1515

16+
// If we're in a tarball, there is no gcc submodule
17+
if root_path.join("src").join("gcc").join("notice.txt").exists() {
18+
return;
19+
}
20+
1621
let git_output = Command::new("git")
1722
.current_dir(root_path)
1823
.arg("submodule")

0 commit comments

Comments
 (0)