Skip to content

Commit 76188b6

Browse files
committed
Auto merge of #80315 - tmiasko:ignore-proc-macros, r=Mark-Simulacrum
Ignore proc-macros when assembling rustc libdir Fixes #80294.
2 parents 2fab321 + 3271681 commit 76188b6

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::*;
@@ -991,13 +992,26 @@ impl Step for Assemble {
991992
builder.info(&format!("Assembling stage{} compiler ({})", stage, host));
992993

993994
// Link in all dylibs to the libdir
995+
let stamp = librustc_stamp(builder, build_compiler, target_compiler.host);
996+
let proc_macros = builder
997+
.read_stamp_file(&stamp)
998+
.into_iter()
999+
.filter_map(|(path, dependency_type)| {
1000+
if dependency_type == DependencyType::Host {
1001+
Some(path.file_name().unwrap().to_owned().into_string().unwrap())
1002+
} else {
1003+
None
1004+
}
1005+
})
1006+
.collect::<HashSet<_>>();
1007+
9941008
let sysroot = builder.sysroot(target_compiler);
9951009
let rustc_libdir = builder.rustc_libdir(target_compiler);
9961010
t!(fs::create_dir_all(&rustc_libdir));
9971011
let src_libdir = builder.sysroot_libdir(build_compiler, host);
9981012
for f in builder.read_dir(&src_libdir) {
9991013
let filename = f.file_name().into_string().unwrap();
1000-
if is_dylib(&filename) {
1014+
if is_dylib(&filename) && !proc_macros.contains(&filename) {
10011015
builder.copy(&f.path(), &rustc_libdir.join(&filename));
10021016
}
10031017
}

0 commit comments

Comments
 (0)