-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add --enable-local-rebuild to bootstrap from the current release #33787
Conversation
In Linux distributions, it is often necessary to rebuild packages for cases like applying new patches or linking against new system libraries. In this scenario, the rustc in the distro build environment may already match the current release that we're trying to rebuild. Thus we don't want to use the prior release's bootstrap key, nor `--cfg stage0` for the prior unstable features. The new `configure --enable-local-rebuild` option specifies that we are rebuilding from the current release. The current bootstrap key is used for the local rustc, and current stage1 features are also assumed.
The rustc for a local-rebuild is assumed to use the current bootstrap key and already match the current stage1 features.
@@ -67,6 +67,7 @@ pub struct Config { | |||
pub target: Vec<String>, | |||
pub rustc: Option<String>, | |||
pub cargo: Option<String>, | |||
pub rebuild: bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you rename this to local_rebuild
? We may actually use a key like "rebuild" to indicate whether dependencies should be tracked eventually as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Looks good to me, thanks @cuviper! Out of curiosity, have you tested this out yet as well? Seems like it may be hard to... |
It is definitely hard to test. I thought about how to add an automated test, and the best I could think of was configuring a whole new build somewhere using local-rebuild pointing to the compiler we just built. That seems like a lot to go through, and even then it would only be partially useful since most master/nightly testing doesn't care about the bootstrap key anyway. AFAICS even basic So I did manual testing only. I configured with one of the official nightly builds as my local rust for the rebuild, and everything built just fine. I manually confirmed with I was honestly a little more superficial about the rustbuild side. The cfg and bootstrap key looked right, but it seemed like local-rust wasn't working in general. It didn't copy any rustc into |
Ok, sounds good to me! Yeah I definitely don't expect to see automated tests here for this, that'd probably be quite overkill :) I'll look into the local-rebuild problems with rustbuild though, it's probably something pretty easy |
Add --enable-local-rebuild to bootstrap from the current release In Linux distributions, it is often necessary to rebuild packages for cases like applying new patches or linking against new system libraries. In this scenario, the rustc in the distro build environment may already match the current release that we're trying to rebuild. Thus we don't want to use the prior release's bootstrap key, nor `--cfg stage0` for the prior unstable features. The new `configure --enable-local-rebuild` option specifies that we are rebuilding from the current release. The current bootstrap key is used for the local rustc, and current stage1 features are also assumed. Both the makefiles and rustbuild support this configuration. Fixes #29556 r? @alexcrichton
In Linux distributions, it is often necessary to rebuild packages for cases like applying new patches or linking against new system libraries. In this scenario, the rustc in the distro build environment may already match the current release that we're trying to rebuild. Thus we don't want to use the prior release's bootstrap key, nor
--cfg stage0
for the prior unstable features.The new
configure --enable-local-rebuild
option specifies that we are rebuilding from the current release. The current bootstrap key is used for the local rustc, and current stage1 features are also assumed. Both the makefiles and rustbuild support this configuration.Fixes #29556
r? @alexcrichton