about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--Readme.md2
-rw-r--r--build_system/prepare.rs7
2 files changed, 8 insertions, 1 deletions
diff --git a/Readme.md b/Readme.md
index 18a840f8a50..28edb5795ce 100644
--- a/Readme.md
+++ b/Readme.md
@@ -49,13 +49,13 @@ If you want to build the backend manually, you can download it from GitHub and b
 ```bash
 $ git clone https://github.com/rust-lang/rustc_codegen_cranelift
 $ cd rustc_codegen_cranelift
-$ ./y.sh prepare
 $ ./y.sh build
 ```
 
 To run the test suite replace the last command with:
 
 ```bash
+$ ./y.sh prepare # only needs to be run the first time
 $ ./test.sh
 ```
 
diff --git a/build_system/prepare.rs b/build_system/prepare.rs
index 11f73bdb61f..ba5cc9a29f5 100644
--- a/build_system/prepare.rs
+++ b/build_system/prepare.rs
@@ -91,6 +91,13 @@ impl GitRepo {
 
     fn verify_checksum(&self, dirs: &Dirs) {
         let download_dir = self.download_dir(dirs);
+        if !download_dir.exists() {
+            eprintln!(
+                "Missing directory {download_dir}: Please run ./y.sh prepare to download.",
+                download_dir = download_dir.display(),
+            );
+            std::process::exit(1);
+        }
         let actual_hash = format!("{:016x}", hash_dir(&download_dir));
         if actual_hash != self.content_hash {
             eprintln!(