From 65186e01285ba20e966e06f505f0e89e06694601 Mon Sep 17 00:00:00 2001 From: teapot4195 Date: Sat, 28 Jan 2023 15:20:27 -0500 Subject: [PATCH] Gracefully exit when --keep-stage used on clean source tree --- src/bootstrap/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index d44b96cfb991e..522b3b7e851ff 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -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); + } + 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