Skip to content

Commit a949fa1

Browse files
authored
Merge pull request #778 from rust-lang/fix/multiple-candidates-error-sysroot
Clean the sysroot destination directory before copying the content into it
2 parents 9cc826c + 2cd4f67 commit a949fa1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

build_system/src/build.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ pub fn build_sysroot(env: &HashMap<String, String>, config: &ConfigInfo) -> Resu
149149

150150
// Copy files to sysroot
151151
let sysroot_path = start_dir.join(format!("sysroot/lib/rustlib/{}/lib/", config.target_triple));
152+
// To avoid errors like "multiple candidates for `rmeta` dependency `core` found", we clean the
153+
// sysroot directory before copying the sysroot build artifacts.
154+
let _ = fs::remove_dir_all(&sysroot_path);
152155
create_dir(&sysroot_path)?;
153156
let mut copier = |dir_to_copy: &Path| {
154157
// FIXME: should not use shell command!

0 commit comments

Comments
 (0)