Skip to content

Commit 3271681

Browse files
committed
Ignore proc-macros when assembling rustc libdir
1 parent 353f3a3 commit 3271681

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/bootstrap/compile.rs

+15-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//! goes along from the output of the previous stage.
88
99
use std::borrow::Cow;
10+
use std::collections::HashSet;
1011
use std::env;
1112
use std::fs;
1213
use std::io::prelude::*;
@@ -956,13 +957,26 @@ impl Step for Assemble {
956957
builder.info(&format!("Assembling stage{} compiler ({})", stage, host));
957958

958959
// Link in all dylibs to the libdir
960+
let stamp = librustc_stamp(builder, build_compiler, target_compiler.host);
961+
let proc_macros = builder
962+
.read_stamp_file(&stamp)
963+
.into_iter()
964+
.filter_map(|(path, dependency_type)| {
965+
if dependency_type == DependencyType::Host {
966+
Some(path.file_name().unwrap().to_owned().into_string().unwrap())
967+
} else {
968+
None
969+
}
970+
})
971+
.collect::<HashSet<_>>();
972+
959973
let sysroot = builder.sysroot(target_compiler);
960974
let rustc_libdir = builder.rustc_libdir(target_compiler);
961975
t!(fs::create_dir_all(&rustc_libdir));
962976
let src_libdir = builder.sysroot_libdir(build_compiler, host);
963977
for f in builder.read_dir(&src_libdir) {
964978
let filename = f.file_name().into_string().unwrap();
965-
if is_dylib(&filename) {
979+
if is_dylib(&filename) && !proc_macros.contains(&filename) {
966980
builder.copy(&f.path(), &rustc_libdir.join(&filename));
967981
}
968982
}

0 commit comments

Comments
 (0)