Add new mode to bootstrap for building std during dist builds#158264
Add new mode to bootstrap for building std during dist builds#158264adamgemmell wants to merge 7 commits into
Conversation
`dist` profile and prevents applying config options
|
r? @clubby789 rustbot has assigned @clubby789. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
r? @Kobzol |
|
|
|
What is the motivation for this? This would make it harder for distros to change how the standard library gets built, right? For example a distro might want to enforce overflow checks for the standard library for security reasons. Or they might want to disable LTO because the codegen backend they chose doesn't support LTO. Or they might want to build the standard library with full debuginfo. I also personally have used |
|
The motivation is enforcing that any configuration for dist builds lives somewhere that build-std can see it. We had some discussion on zulip a while ago: https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Standard.20library.20dist.20configuration. From that the two main complications that led to this approach were:
The intention is that panic never triggers, it's a sanity check for bootstrap itself. Yes, this is quite disruptive and annoying, and anyone doing dist builds would need to translate all their options to the library manifest, but distros need to do this anyway so the build-std artifacts have the same compatibility as the prebuilt std. I'm not sure on the best way to make this less disruptive - perhaps it should only ignore config options when |
For example for the debuginfo options, if a distro wants to enable full debuginfo for their precompiled standard library, they probably don't want to enable full debuginfo for end users that use |
|
The initial version of build-std we're stabilising doesn't support customising the standard library, it should match the distributed std as closely as possible. When we change Cargo to use the dist profile, we'll add an unstable option that keeps the "user profile" behaviour build-std currently has. |
|
You are adding several of these flags even to the non-dist profiles. |
|
I've only moved over options that are unconditionally passed by bootstrap. This is because I'd like to explore doing something similar to RUSTFLAGS as I have for profile variables here, but I'm happy to defer that. |
|
The |
|
LTO is off for the standard library's own profile. Presumably if it were on then LTO would run twice for it if the user requested it too? |
|
|
|
It won't be with build-std's currently approved RFCs, as until we introduce |
|
A job failed! Check out the build log: (web) (plain enhanced) (plain) Click to see the possible cause of the failure (guessed by this bot) |
|
@bors retry |
|
❗ You can only retry pull requests that are approved and have a previously failed auto build. |
|
I've retried the PR CI from the github interface for you. Bors is not involved with PR CI, only try runs and pre-merge CI. |
View all comments
This PR adds a new Mode, DistStd, to bootstrap, as proposed by @Kobzol a while ago, which is used when building the standard library during
x distbuilds. This mode:distprofile in the library workspace, added in Move bootstrap configuration to library workspace #149514Note that RUSTFLAGS can still be set based on configuration, and this will be addressed in an upcoming patch as we still need to work out how build-std can consume target-specific configuration. Probably this will go in the cargo config.