Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix overwriting .d file for binary with dSYM on apple targets. #7057

Merged
merged 1 commit into from
Jul 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/cargo/core/compiler/output_depinfo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::path::{Path, PathBuf};

use log::debug;

use super::{fingerprint, Context, Unit};
use super::{fingerprint, Context, FileFlavor, Unit};
use crate::util::paths;
use crate::util::{internal, CargoResult};

Expand Down Expand Up @@ -98,7 +98,11 @@ pub fn output_depinfo<'a, 'b>(cx: &mut Context<'a, 'b>, unit: &Unit<'a>) -> Carg
.map(|f| render_filename(f, basedir))
.collect::<CargoResult<Vec<_>>>()?;

for output in cx.outputs(unit)?.iter() {
for output in cx
.outputs(unit)?
.iter()
.filter(|o| o.flavor != FileFlavor::DebugInfo)
{
if let Some(ref link_dst) = output.hardlink {
let output_path = link_dst.with_extension("d");
if success {
Expand Down
7 changes: 7 additions & 0 deletions tests/testsuite/dep_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ fn build_dep_info() {
let depinfo_bin_path = &p.bin("foo").with_extension("d");

assert!(depinfo_bin_path.is_file());

let depinfo = p.read_file(depinfo_bin_path.to_str().unwrap());

let bin_path = p.bin("foo");
let src_path = p.root().join("src").join("foo.rs");
let expected_depinfo = format!("{}: {}\n", bin_path.display(), src_path.display());
assert_eq!(depinfo, expected_depinfo);
}

#[cargo_test]
Expand Down