Skip to content
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

Merged
merged 3 commits into from May 24, 2016

Conversation

cuviper
Copy link
Member

@cuviper cuviper commented May 22, 2016

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.
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,
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@alexcrichton
Copy link
Member

Looks good to me, thanks @cuviper! Out of curiosity, have you tested this out yet as well? Seems like it may be hard to...

@cuviper
Copy link
Member Author

cuviper commented May 23, 2016

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 --enable-local-rust has no testing, so we're in the same boat.

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 make VERBOSE=1 that it used --cfg stage1 even during stage0, as desired. I also hacked a shell-script wrapper around the local rustc to dump RUSTC_BOOTSTRAP_KEY, to make sure it kept the current key.

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 $target/stage0/bin/, so this failed quickly, and I didn't look much further. This was just using ../configure --enable-local-rebuild --enable-rustbuild, and its config.mk looked correct.

@alexcrichton
Copy link
Member

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

@alexcrichton
Copy link
Member

@bors: r+ 0ca7d3d

@bors
Copy link
Contributor

bors commented May 24, 2016

⌛ Testing commit 0ca7d3d with merge dd6e8d4...

bors added a commit that referenced this pull request May 24, 2016
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants