Skip to content

Fix some bootstrap papercuts #139823

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/bootstrap/src/core/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2888,6 +2888,13 @@ impl Config {

let absolute_path = self.src.join(relative_path);

// NOTE: This check is required because `jj git clone` doesn't create directories for
// submodules, they are completely ignored. The code below assumes this directory exists,
// so create it here.
if !absolute_path.exists() {
t!(fs::create_dir_all(&absolute_path));
}
Comment on lines +2891 to +2896
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remark: Path::exists will traverse symlinks to look for existence of the destination file (i.e. not necessarily the "shallow" $checkout_root/$usual_submodule_location), but I guess if the user has a symlink in the place of the usual submodules in checkout...


// NOTE: The check for the empty directory is here because when running x.py the first time,
// the submodule won't be checked out. Check it out now so we can build it.
if !GitInfo::new(false, &absolute_path).is_managed_git_subrepository()
Expand Down
9 changes: 8 additions & 1 deletion src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2378,12 +2378,19 @@ impl<'test> TestCx<'test> {
// eg.
// /home/user/rust/build/x86_64-unknown-linux-gnu/test/ui/<test_dir>/$name.$revision.$mode/
normalize_path(&self.output_base_dir(), "$TEST_BUILD_DIR");
// Same as above, but with a canonicalized path.
// This is required because some tests print canonical paths inside test build directory,
// so if the build directory is a symlink, normalization doesn't help.
//
// NOTE: There are also tests which print the non-canonical name, so we need both this and
// the above normalizations.
normalize_path(&self.output_base_dir().canonicalize_utf8().unwrap(), "$TEST_BUILD_DIR");
// eg. /home/user/rust/build
normalize_path(&self.config.build_root, "$BUILD_DIR");

if json {
// escaped newlines in json strings should be readable
// in the stderr files. There's no point int being correct,
// in the stderr files. There's no point in being correct,
// since only humans process the stderr files.
// Thus we just turn escaped newlines back into newlines.
normalized = normalized.replace("\\n", "\n");
Expand Down
Loading