about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-06-03 19:52:05 +0000
committerbors <bors@rust-lang.org>2025-06-03 19:52:05 +0000
commitdecbfcda13468ff1ef15fede737ac04bd8846ed7 (patch)
treee7615b217017ee885448825c9ee57af8ad8ec586
parent99e783d4e9bdcc44e2071973631a7d5e689b0787 (diff)
parentea26272c94c7a66ed018930c13c63551cb2f1390 (diff)
downloadrust-decbfcda13468ff1ef15fede737ac04bd8846ed7.tar.gz
rust-decbfcda13468ff1ef15fede737ac04bd8846ed7.zip
Auto merge of #141229 - tgross35:builtins-josh-subtree, r=Kobzol
Merge `compiler-builtins` as a Josh subtree

Use the Josh [1] utility to add `compiler-builtins` as a subtree, which
will allow us to stop using crates.io for updates. This is intended to
help resolve some problems when unstable features change and require
code changes in `compiler-builtins`, which sometimes gets trapped in a
bootstrap cycle.

This was done using `josh-filter` built from the r24.10.04 tag:

    git fetch https://github.com/rust-lang/compiler-builtins.git 233434412fe7eced8f1ddbfeddabef1d55e493bd
    josh-filter ":prefix=library/compiler-builtins" FETCH_HEAD
    git merge --allow-unrelated FILTERED_HEAD

The HEAD in the `compiler-builtins` repository is 233434412f ("fix an if
statement that can be collapsed").

[1]: https://github.com/josh-project/josh
-rw-r--r--build_system/utils.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/build_system/utils.rs b/build_system/utils.rs
index f2399768459..d9807155a3d 100644
--- a/build_system/utils.rs
+++ b/build_system/utils.rs
@@ -213,11 +213,13 @@ pub(crate) fn copy_dir_recursively(from: &Path, to: &Path) {
         if filename == "." || filename == ".." {
             continue;
         }
+        let src = from.join(&filename);
+        let dst = to.join(&filename);
         if entry.metadata().unwrap().is_dir() {
-            fs::create_dir(to.join(&filename)).unwrap();
-            copy_dir_recursively(&from.join(&filename), &to.join(&filename));
+            fs::create_dir(&dst).unwrap_or_else(|e| panic!("failed to create {dst:?}: {e}"));
+            copy_dir_recursively(&src, &dst);
         } else {
-            fs::copy(from.join(&filename), to.join(&filename)).unwrap();
+            fs::copy(&src, &dst).unwrap_or_else(|e| panic!("failed to copy {src:?}->{dst:?}: {e}"));
         }
     }
 }