rust
rust copied to clipboard
[bootstrap] Move the `split-debuginfo` setting to the per-target section
As described in #112406, bootstrap currently applies the global split-debuginfo
setting to all artifacts, irrespective of their target triple.
This doesn't cause problems when the "build" triple defaults split-debuginfo
to off
(as is the case on Linux, for example).
However, when the "build" triple has split-debuginfo
enabled and additional target triples are configured, then artifacts for the additional triples will also be built with split-debuginfo
(despite not necessarily supporting split-debuginfo
).
#112406 mentions riscv32imc-unknown-none-elf
as one target where this happens, and I've run into this with Wasm as well.
This PR does not implement @ehuss's suggestion that "bootstrap not try to guess how to configure split-debuginfo, and instead use cargo profiles to set it", because that seemed like a lot more significant change.
After this PR, anyone explicitly setting rust.split-debuginfo
should update their configuration to specify the setting in the target.<triple>
section, though rust.split-debuginfo
will still be honored for the "build" triple for now.
This PR changes the behavior when rust.split-debuginfo
was not explicitly set and bootstrap is configured to cross-compile to a triple that has a different split-debuginfo
than the "build" triple.
If there's a reasonable way to add additional tests for this, please let me know (I didn't find any tests checking cargo arguments in builder/tests.rs
).
r? @Mark-Simulacrum
rustbot has assigned @Mark-Simulacrum. They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.
Use r? to explicitly pick a reviewer
This PR modifies src/bootstrap/src/core/config
.
If appropriate, please update CONFIG_CHANGE_HISTORY
in src/bootstrap/src/utils/change_tracker.rs
.
This PR modifies config.example.toml
.
If appropriate, please update CONFIG_CHANGE_HISTORY
in src/bootstrap/src/utils/change_tracker.rs
.
@rustbot author
@rustbot ready
:umbrella: The latest upstream changes (presumably #122113) made this pull request unmergeable. Please resolve the merge conflicts.
@ehuss can you say more about Cargo's automatic detection?
I would suggest that bootstrap not try to guess how to configure split-debuginfo, and instead use cargo profiles to set it. Cargo already dynamically detects if split-debuginfo is supported on the platform.
In particular it looks like we set -Zunstable-options in some cases if we don't think it's already stable, my assumption is that Cargo wouldn't do that, right? So until this is stable everywhere we would still need this custom support.
r=me on the changes here in general though
Cargo uses rustc --print=split-debuginfo
to determine what options are supported.
Indeed, it looks like --print=split-debuginfo
does not take -Zunstable-options
into consideration in its output.
Rebased. @rustbot ready
@bors r+
:pushpin: Commit 93a807f87127b18a69ba2572269efb282741ceac has been approved by Mark-Simulacrum
It is now in the queue for this repository.
:umbrella: The latest upstream changes (presumably #122331) made this pull request unmergeable. Please resolve the merge conflicts.
Rebased. @rustbot ready
:umbrella: The latest upstream changes (presumably #122338) made this pull request unmergeable. Please resolve the merge conflicts.
Rebased again.
@bors r=Mark-Simulacrum,onur-ozkan
:pushpin: Commit 0e354c98a82df53df04e49c5d0f7107c03482d42 has been approved by Mark-Simulacrum,onur-ozkan
It is now in the queue for this repository.