File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
src/cargo/ops/cargo_compile Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -635,8 +635,13 @@ fn traverse_and_share(
635
635
let mut profile = unit. profile . clone ( ) ;
636
636
637
637
// If this is a build dependency, and it's not shared with runtime dependencies, we can weaken
638
- // its debuginfo level to optimize build times.
639
- if unit. kind . is_host ( ) && to_host. is_some ( ) && profile. debuginfo . is_deferred ( ) {
638
+ // its debuginfo level to optimize build times. We do nothing if it's an artifact dependency,
639
+ // as it and its debuginfo may end up embedded in the main program.
640
+ if unit. kind . is_host ( )
641
+ && to_host. is_some ( )
642
+ && profile. debuginfo . is_deferred ( )
643
+ && !unit. artifact . is_true ( )
644
+ {
640
645
// We create a "probe" test to see if a unit with the same explicit debuginfo level exists
641
646
// in the graph. This is the level we'd expect if it was set manually or the default value
642
647
// set by a profile for a runtime dependency: its canonical value.
You can’t perform that action at this time.
0 commit comments