Skip to content

Commit 8e3482e

Browse files
committed
don't optimize debuginfo for artifact dependencies
1 parent 51c3fba commit 8e3482e

File tree

1 file changed

+3
-2
lines changed
  • src/cargo/ops/cargo_compile

1 file changed

+3
-2
lines changed

src/cargo/ops/cargo_compile/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,8 +1284,9 @@ fn traverse_and_share(
12841284
let mut profile = unit.profile.clone();
12851285

12861286
// If this is a build dependency, and it's not shared with runtime dependencies, we can weaken
1287-
// its debuginfo level to optimize build times.
1288-
if unit.kind.is_host() && profile.debuginfo.is_deferred() {
1287+
// its debuginfo level to optimize build times. We do nothing if it's an artifact dependency,
1288+
// as it and its debuginfo may end up embedded in the main program.
1289+
if unit.kind.is_host() && profile.debuginfo.is_deferred() && !unit.artifact.is_true() {
12891290
// We create a "probe" test to see if a unit with the same explicit debuginfo level exists
12901291
// in the graph. This is the level we'd expect if it was set manually or the default value
12911292
// set by a profile for a runtime dependency: its canonical value.

0 commit comments

Comments
 (0)