about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2024-08-10 23:56:43 +0200
committerJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2024-08-11 04:16:53 +0200
commitdd3f7578ee52af74de732f8a8e6dc5d02b284daa (patch)
tree5ef2ab608c92befe6220f4cf22e842186c77461e /src
parent56beb1d744cf5d5b6ab9e802efdf716e15b088f2 (diff)
downloadrust-dd3f7578ee52af74de732f8a8e6dc5d02b284daa.tar.gz
rust-dd3f7578ee52af74de732f8a8e6dc5d02b284daa.zip
Exclude just `std` from rustc deps
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/src/core/build_steps/compile.rs14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
index 2e521ff7544..db0aa1ecff1 100644
--- a/src/bootstrap/src/core/build_steps/compile.rs
+++ b/src/bootstrap/src/core/build_steps/compile.rs
@@ -1838,17 +1838,13 @@ impl Step for Assemble {
         for f in builder.read_dir(&src_libdir) {
             let filename = f.file_name().into_string().unwrap();
 
-            // For the later stages which gets distributed only copy over the
-            // `rustc_driver` library so we don't end up with an extra copy of `std`.
-            // If we're not statically linking `std` into `rustc_driver`, just copy every library
-            // to ensure `std` is included.
+            // For the later stages which gets distributed avoid copying `std` if we're
+            // statically linking `std` into `rustc_driver`.
             // We still need `std` for the initial stage as the bootstrap compiler may not
             // have the new `rustc_private` linking behavior.
-            let can_be_rustc_dep = filename.starts_with("rustc_driver-")
-                || filename.starts_with("librustc_driver-")
-                || build_compiler.stage == 0
-                || !link_std_into_rustc_driver;
-
+            let is_std = filename.starts_with("std-") || filename.starts_with("libstd-");
+            let can_be_rustc_dep =
+                !is_std || !link_std_into_rustc_driver || build_compiler.stage == 0; // cfg(bootstrap)
             if can_be_rustc_dep
                 && (is_dylib(&filename) || is_debug_info(&filename))
                 && !proc_macros.contains(&filename)