Skip to content

Commit

Permalink
Auto merge of #4581 - tamird:master, r=alexcrichton
Browse files Browse the repository at this point in the history
cargo_rustc: remove workaround for fixed upstream issue

Fixed in rust-lang/rust#25411. Also, the
removed code is implicated in test failures observed in
rust-lang/rust#44515.

r? @alexcrichton
  • Loading branch information
bors committed Oct 10, 2017
2 parents 5c0e9f1 + 8b68e59 commit d6843a7
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/cargo/ops/cargo_rustc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,19 +366,14 @@ fn rustc<'a, 'cfg>(cx: &mut Context<'a, 'cfg>,
add_custom_env(&mut rustc, &build_state, &current_id, kind)?;
}

// FIXME(rust-lang/rust#18913): we probably shouldn't have to do
// this manually
for &(ref filename, ref _link_dst, _linkable) in filenames.iter() {
let mut dsts = vec![root.join(filename)];
// If there is both an rmeta and rlib, rustc will prefer to use the
// rlib, even if it is older. Therefore, we must delete the rlib to
// force using the new rmeta.
if dsts[0].extension() == Some(OsStr::new("rmeta")) {
dsts.push(root.join(filename).with_extension("rlib"));
}
for dst in &dsts {
if fs::metadata(dst).is_ok() {
fs::remove_file(dst).chain_err(|| {
if filename.extension() == Some(OsStr::new("rmeta")) {
let dst = root.join(filename).with_extension("rlib");
if dst.exists() {
fs::remove_file(&dst).chain_err(|| {
format!("Could not remove file: {}.", dst.display())
})?;
}
Expand Down

0 comments on commit d6843a7

Please sign in to comment.