Skip to content

Commit

Permalink
Ignore proc-macros when assembling rustc libdir
Browse files Browse the repository at this point in the history
  • Loading branch information
tmiasko committed Dec 23, 2020
1 parent 353f3a3 commit 3271681
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//! goes along from the output of the previous stage.

use std::borrow::Cow;
use std::collections::HashSet;
use std::env;
use std::fs;
use std::io::prelude::*;
Expand Down Expand Up @@ -956,13 +957,26 @@ impl Step for Assemble {
builder.info(&format!("Assembling stage{} compiler ({})", stage, host));

// Link in all dylibs to the libdir
let stamp = librustc_stamp(builder, build_compiler, target_compiler.host);
let proc_macros = builder
.read_stamp_file(&stamp)
.into_iter()
.filter_map(|(path, dependency_type)| {
if dependency_type == DependencyType::Host {
Some(path.file_name().unwrap().to_owned().into_string().unwrap())
} else {
None
}
})
.collect::<HashSet<_>>();

let sysroot = builder.sysroot(target_compiler);
let rustc_libdir = builder.rustc_libdir(target_compiler);
t!(fs::create_dir_all(&rustc_libdir));
let src_libdir = builder.sysroot_libdir(build_compiler, host);
for f in builder.read_dir(&src_libdir) {
let filename = f.file_name().into_string().unwrap();
if is_dylib(&filename) {
if is_dylib(&filename) && !proc_macros.contains(&filename) {
builder.copy(&f.path(), &rustc_libdir.join(&filename));
}
}
Expand Down

0 comments on commit 3271681

Please sign in to comment.