From e7c5579d3e9295548aac06e74d992f468cc07666 Mon Sep 17 00:00:00 2001 From: snf Date: Fri, 20 Sep 2019 22:38:24 -0300 Subject: [PATCH] removing hash from output files when using MSVC --- src/cargo/core/compiler/context/compilation_files.rs | 3 ++- tests/testsuite/build.rs | 3 +-- tests/testsuite/collisions.rs | 6 +++++- tests/testsuite/freshness.rs | 1 + 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/cargo/core/compiler/context/compilation_files.rs b/src/cargo/core/compiler/context/compilation_files.rs index f96c2d405d9..45beb93d985 100644 --- a/src/cargo/core/compiler/context/compilation_files.rs +++ b/src/cargo/core/compiler/context/compilation_files.rs @@ -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() { diff --git a/tests/testsuite/build.rs b/tests/testsuite/build.rs index 1866fed4bac..ff0e259f234 100644 --- a/tests/testsuite/build.rs +++ b/tests/testsuite/build.rs @@ -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()); } diff --git a/tests/testsuite/collisions.rs b/tests/testsuite/collisions.rs index f1fb4bacfb6..6119a79dd43 100644 --- a/tests/testsuite/collisions.rs +++ b/tests/testsuite/collisions.rs @@ -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] @@ -54,6 +56,7 @@ This may become a hard error in the future; see