]> git.lizzy.rs Git - rust.git/commit
mk: Bootstrap from stable instead of snapshots
authorAlex Crichton <alex@alexcrichton.com>
Wed, 13 Apr 2016 18:18:35 +0000 (11:18 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 19 Apr 2016 17:56:49 +0000 (10:56 -0700)
commit02538d463a350f5c3658f7aabefca16eb599d31c
treedbc3b388eb51267b426879341f972d63bd58faa8
parent478a33dabc4e6f2f501f476c79b56178d9df4f37
mk: Bootstrap from stable instead of snapshots

This commit removes all infrastructure from the repository for our so-called
snapshots to instead bootstrap the compiler from stable releases. Bootstrapping
from a previously stable release is a long-desired feature of distros because
they're not fans of downloading binary stage0 blobs from us. Additionally, this
makes our own CI easier as we can decommission all of the snapshot builders and
start having a regular cadence to when we update the stage0 compiler.

A new `src/etc/get-stage0.py` script was added which shares some code with
`src/bootstrap/bootstrap.py` to read a new file, `src/stage0.txt`, which lists
the current stage0 compiler as well as cargo that we bootstrap from. This script
will download the relevant `rustc` package an unpack it into `$target/stage0` as
we do today.

One problem of bootstrapping from stable releases is that we're not able to
compile unstable code (e.g. all the `#![feature]` directives in libcore/libstd).
To overcome this we employ two strategies:

* The bootstrap key of the previous compiler is hardcoded into `src/stage0.txt`
  (enabled as a result of #32731) and exported by the build system. This enables
  nightly features in the compiler we download.
* The standard library and compiler are pinned to a specific stage0, which
  doesn't change, so we're guaranteed that we'll continue compiling as we start
  from a known fixed source.

The process for making a release will also need to be tweaked now to continue to
cadence of bootstrapping from the previous release. This process looks like:

1. Merge `beta` to `stable`
2. Produce a new stable compiler.
3. Change `master` to bootstrap from this new stable compiler.
4. Merge `master` to `beta`
5. Produce a new beta compiler
6. Change `master` to bootstrap from this new beta compiler.

Step 3 above should involve very few changes as `master` was previously
bootstrapping from `beta` which is the same as `stable` at that point in time.
Step 6, however, is where we benefit from removing lots of `#[cfg(stage0)]` and
get to use new features. This also shouldn't slow the release too much as steps
1-5 requires little work other than waiting and step 6 just needs to happen at
some point during a release cycle, it's not time sensitive.

Closes #29555
Closes #29557
23 files changed:
Makefile.in
mk/dist.mk
mk/main.mk
mk/reconfig.mk
mk/snap.mk [deleted file]
mk/stage0.mk
mk/target.mk
mk/tests.mk
src/bootstrap/bootstrap.py
src/bootstrap/build/channel.rs
src/bootstrap/build/compile.rs
src/bootstrap/build/mod.rs
src/etc/get-snapshot.py [deleted file]
src/etc/get-stage0.py [new file with mode: 0644]
src/etc/latest-unix-snaps.py [deleted file]
src/etc/make-snapshot.py [deleted file]
src/etc/mirror-all-snapshots.py [deleted file]
src/etc/snapshot.py [deleted file]
src/libcore/intrinsics.rs
src/libcore/sync/atomic.rs
src/nightlies.txt [deleted file]
src/snapshots.txt [deleted file]
src/stage0.txt [new file with mode: 0644]