Skip to content

Commit 9f82a74

Browse files
committed
Auto merge of #7400 - snf:fix_7358, r=alexcrichton
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.
2 parents 053b767 + e7c5579 commit 9f82a74

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

src/cargo/core/compiler/context/compilation_files.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,8 @@ fn compute_metadata<'a, 'cfg>(
495495
if !(unit.mode.is_any_test() || unit.mode.is_check())
496496
&& (unit.target.is_dylib()
497497
|| unit.target.is_cdylib()
498-
|| (unit.target.is_executable() && unit.kind.short_name(bcx).starts_with("wasm32-")))
498+
|| (unit.target.is_executable() && unit.kind.short_name(bcx).starts_with("wasm32-"))
499+
|| (unit.target.is_executable() && unit.kind.short_name(bcx).contains("msvc")))
499500
&& unit.pkg.package_id().source_id().is_path()
500501
&& __cargo_default_lib_metadata.is_err()
501502
{

tests/testsuite/build.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4207,8 +4207,7 @@ fn uplift_pdb_of_bin_on_windows() {
42074207
p.cargo("build --bins --examples --tests").run();
42084208
assert!(p.target_debug_dir().join("foo.pdb").is_file());
42094209
assert!(p.target_debug_dir().join("b.pdb").is_file());
4210-
assert!(!p.target_debug_dir().join("examples/c.pdb").exists());
4211-
assert_eq!(p.glob("target/debug/examples/c-*.pdb").count(), 1);
4210+
assert!(p.target_debug_dir().join("examples/c.pdb").exists());
42124211
assert!(!p.target_debug_dir().join("c.pdb").exists());
42134212
assert!(!p.target_debug_dir().join("d.pdb").exists());
42144213
}

tests/testsuite/collisions.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
use cargo_test_support::{basic_manifest, project};
1+
#[cfg(not(target_env = "msvc"))]
2+
use cargo_test_support::basic_manifest;
3+
use cargo_test_support::project;
24
use std::env;
35

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

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

8588
#[cargo_test]
89+
#[cfg(not(target_env = "msvc"))]
8690
fn collision_export() {
8791
// `--out-dir` combines some things which can cause conflicts.
8892
let p = project()

tests/testsuite/freshness.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,7 @@ fn changing_bin_paths_common_target_features_caches_targets() {
423423
}
424424

425425
#[cargo_test]
426+
#[cfg(not(target_env = "msvc"))]
426427
fn changing_bin_features_caches_targets() {
427428
let p = project()
428429
.file(

0 commit comments

Comments
 (0)