diff --git a/src/cargo/core/compiler/context/compilation_files.rs b/src/cargo/core/compiler/context/compilation_files.rs index 04d75fe0ac5..5d2cf4efce9 100644 --- a/src/cargo/core/compiler/context/compilation_files.rs +++ b/src/cargo/core/compiler/context/compilation_files.rs @@ -608,6 +608,12 @@ fn should_use_metadata(bcx: &BuildContext<'_, '_>, unit: &Unit) -> bool { // - wasm32 executables: When using emscripten, the path to the .wasm file // is embedded in the .js file, so we don't want the hash in there. // TODO: Is this necessary for wasm32-unknown-unknown? + // - apple executables: The executable name is used in the dSYM directory + // (such as `target/debug/foo.dSYM/Contents/Resources/DWARF/foo-64db4e4bf99c12dd`). + // Unfortunately this causes problems with our current backtrace + // implementation which looks for a file matching the exe name exactly. + // See https://github.com/rust-lang/rust/issues/72550#issuecomment-638501691 + // for more details. // // This is only done for local packages, as we don't expect to export // dependencies. @@ -622,7 +628,8 @@ fn should_use_metadata(bcx: &BuildContext<'_, '_>, unit: &Unit) -> bool { if (unit.target.is_dylib() || unit.target.is_cdylib() || (unit.target.is_executable() && short_name.starts_with("wasm32-")) - || (unit.target.is_executable() && short_name.contains("msvc"))) + || (unit.target.is_executable() && short_name.contains("msvc")) + || (unit.target.is_executable() && short_name.contains("-apple-"))) && unit.pkg.package_id().source_id().is_path() && env::var("__CARGO_DEFAULT_LIB_METADATA").is_err() { diff --git a/src/cargo/core/compiler/fingerprint.rs b/src/cargo/core/compiler/fingerprint.rs index 145a622bb1f..b432839850a 100644 --- a/src/cargo/core/compiler/fingerprint.rs +++ b/src/cargo/core/compiler/fingerprint.rs @@ -1229,7 +1229,7 @@ fn calculate_normal(cx: &mut Context<'_, '_>, unit: &Unit) -> CargoResult