Skip to content

Commit

Permalink
Auto merge of #7400 - snf:fix_7358, r=alexcrichton
Browse files Browse the repository at this point in the history
Removing hash from output files when using MSVC

This is the fix for #7358 suggested by @alexcrichton . Tested and working.

I see a few tests failling but seem unrelated. I'll investigate them tomorrow.
  • Loading branch information
bors committed Oct 2, 2019
2 parents 053b767 + e7c5579 commit 9f82a74
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/cargo/core/compiler/context/compilation_files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,8 @@ fn compute_metadata<'a, 'cfg>(
if !(unit.mode.is_any_test() || unit.mode.is_check())
&& (unit.target.is_dylib()
|| unit.target.is_cdylib()
|| (unit.target.is_executable() && unit.kind.short_name(bcx).starts_with("wasm32-")))
|| (unit.target.is_executable() && unit.kind.short_name(bcx).starts_with("wasm32-"))
|| (unit.target.is_executable() && unit.kind.short_name(bcx).contains("msvc")))
&& unit.pkg.package_id().source_id().is_path()
&& __cargo_default_lib_metadata.is_err()
{
Expand Down
3 changes: 1 addition & 2 deletions tests/testsuite/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4207,8 +4207,7 @@ fn uplift_pdb_of_bin_on_windows() {
p.cargo("build --bins --examples --tests").run();
assert!(p.target_debug_dir().join("foo.pdb").is_file());
assert!(p.target_debug_dir().join("b.pdb").is_file());
assert!(!p.target_debug_dir().join("examples/c.pdb").exists());
assert_eq!(p.glob("target/debug/examples/c-*.pdb").count(), 1);
assert!(p.target_debug_dir().join("examples/c.pdb").exists());
assert!(!p.target_debug_dir().join("c.pdb").exists());
assert!(!p.target_debug_dir().join("d.pdb").exists());
}
Expand Down
6 changes: 5 additions & 1 deletion tests/testsuite/collisions.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use cargo_test_support::{basic_manifest, project};
#[cfg(not(target_env = "msvc"))]
use cargo_test_support::basic_manifest;
use cargo_test_support::project;
use std::env;

#[cargo_test]
Expand Down Expand Up @@ -54,6 +56,7 @@ This may become a hard error in the future; see <https://github.com/rust-lang/ca
}

#[cargo_test]
#[cfg(not(target_env = "msvc"))]
fn collision_example() {
// Examples in a workspace can easily collide.
let p = project()
Expand Down Expand Up @@ -83,6 +86,7 @@ This may become a hard error in the future; see <https://github.com/rust-lang/ca
}

#[cargo_test]
#[cfg(not(target_env = "msvc"))]
fn collision_export() {
// `--out-dir` combines some things which can cause conflicts.
let p = project()
Expand Down
1 change: 1 addition & 0 deletions tests/testsuite/freshness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ fn changing_bin_paths_common_target_features_caches_targets() {
}

#[cargo_test]
#[cfg(not(target_env = "msvc"))]
fn changing_bin_features_caches_targets() {
let p = project()
.file(
Expand Down

0 comments on commit 9f82a74

Please sign in to comment.