Skip to content

Gracefully exit if --keep-stage flag is used on a clean source tree #107397

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 1 commit into from
Jan 29, 2023
Merged
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/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1431,6 +1431,13 @@ impl Build {
return Vec::new();
}

if !stamp.exists() {
eprintln!(
"Warning: Unable to find the stamp file, did you try to keep a nonexistent build stage?"
);
crate::detail_exit(1);
Comment on lines +1435 to +1438
Copy link
Member

Choose a reason for hiding this comment

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

I have two comments here:

  1. This should say "error", not "warning"
  2. This should print the file path of the stamp file; currently it's a regression compared to the existing error message.

@Teapot4195 do you think you could make a follow-up PR with both those changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I'll make a follow up PR for those changes

Copy link
Member

Choose a reason for hiding this comment

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

Thank you!

}

let mut paths = Vec::new();
let contents = t!(fs::read(stamp), &stamp);
// This is the method we use for extracting paths from the stamp file passed to us. See
Expand Down