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

Removing hash from output files when using MSVC #7400

Merged
merged 1 commit into from
Oct 2, 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
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