diff options
| author | bors <bors@rust-lang.org> | 2016-04-20 01:16:55 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2016-04-20 01:16:55 -0700 |
| commit | 9bba2907ee712753e44d7e248560031c190724e0 (patch) | |
| tree | 255c81d71582ce716b505da7770580841ef2dd12 /src/libcore | |
| parent | 3dd88f60de01774b9f9e29c0289a874a5dcaa1ce (diff) | |
| parent | 02538d463a350f5c3658f7aabefca16eb599d31c (diff) | |
| download | rust-9bba2907ee712753e44d7e248560031c190724e0.tar.gz rust-9bba2907ee712753e44d7e248560031c190724e0.zip | |
Auto merge of #32942 - alexcrichton:bootstrap-from-previous, r=brson
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
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/intrinsics.rs | 25 | ||||
| -rw-r--r-- | src/libcore/sync/atomic.rs | 24 |
2 files changed, 0 insertions, 49 deletions
diff --git a/src/libcore/intrinsics.rs b/src/libcore/intrinsics.rs index 03bcf9caeea..45890cd3d81 100644 --- a/src/libcore/intrinsics.rs +++ b/src/libcore/intrinsics.rs @@ -53,34 +53,14 @@ extern "rust-intrinsic" { // NB: These intrinsics take raw pointers because they mutate aliased // memory, which is not valid for either `&` or `&mut`. - #[cfg(all(stage0, not(cargobuild)))] - pub fn atomic_cxchg<T>(dst: *mut T, old: T, src: T) -> T; - #[cfg(all(stage0, not(cargobuild)))] - pub fn atomic_cxchg_acq<T>(dst: *mut T, old: T, src: T) -> T; - #[cfg(all(stage0, not(cargobuild)))] - pub fn atomic_cxchg_rel<T>(dst: *mut T, old: T, src: T) -> T; - #[cfg(all(stage0, not(cargobuild)))] - pub fn atomic_cxchg_acqrel<T>(dst: *mut T, old: T, src: T) -> T; - #[cfg(all(stage0, not(cargobuild)))] - pub fn atomic_cxchg_relaxed<T>(dst: *mut T, old: T, src: T) -> T; - - #[cfg(any(not(stage0), cargobuild))] pub fn atomic_cxchg<T>(dst: *mut T, old: T, src: T) -> (T, bool); - #[cfg(any(not(stage0), cargobuild))] pub fn atomic_cxchg_acq<T>(dst: *mut T, old: T, src: T) -> (T, bool); - #[cfg(any(not(stage0), cargobuild))] pub fn atomic_cxchg_rel<T>(dst: *mut T, old: T, src: T) -> (T, bool); - #[cfg(any(not(stage0), cargobuild))] pub fn atomic_cxchg_acqrel<T>(dst: *mut T, old: T, src: T) -> (T, bool); - #[cfg(any(not(stage0), cargobuild))] pub fn atomic_cxchg_relaxed<T>(dst: *mut T, old: T, src: T) -> (T, bool); - #[cfg(any(not(stage0), cargobuild))] pub fn atomic_cxchg_failrelaxed<T>(dst: *mut T, old: T, src: T) -> (T, bool); - #[cfg(any(not(stage0), cargobuild))] pub fn atomic_cxchg_failacq<T>(dst: *mut T, old: T, src: T) -> (T, bool); - #[cfg(any(not(stage0), cargobuild))] pub fn atomic_cxchg_acq_failrelaxed<T>(dst: *mut T, old: T, src: T) -> (T, bool); - #[cfg(any(not(stage0), cargobuild))] pub fn atomic_cxchg_acqrel_failrelaxed<T>(dst: *mut T, old: T, src: T) -> (T, bool); pub fn atomic_cxchgweak<T>(dst: *mut T, old: T, src: T) -> (T, bool); @@ -548,27 +528,22 @@ extern "rust-intrinsic" { /// Float addition that allows optimizations based on algebraic rules. /// May assume inputs are finite. - #[cfg(not(stage0))] pub fn fadd_fast<T>(a: T, b: T) -> T; /// Float subtraction that allows optimizations based on algebraic rules. /// May assume inputs are finite. - #[cfg(not(stage0))] pub fn fsub_fast<T>(a: T, b: T) -> T; /// Float multiplication that allows optimizations based on algebraic rules. /// May assume inputs are finite. - #[cfg(not(stage0))] pub fn fmul_fast<T>(a: T, b: T) -> T; /// Float division that allows optimizations based on algebraic rules. /// May assume inputs are finite. - #[cfg(not(stage0))] pub fn fdiv_fast<T>(a: T, b: T) -> T; /// Float remainder that allows optimizations based on algebraic rules. /// May assume inputs are finite. - #[cfg(not(stage0))] pub fn frem_fast<T>(a: T, b: T) -> T; diff --git a/src/libcore/sync/atomic.rs b/src/libcore/sync/atomic.rs index 483c3822df6..e74dc08ea71 100644 --- a/src/libcore/sync/atomic.rs +++ b/src/libcore/sync/atomic.rs @@ -1380,7 +1380,6 @@ unsafe fn atomic_sub<T>(dst: *mut T, val: T, order: Ordering) -> T { } #[inline] -#[cfg(any(not(stage0), cargobuild))] unsafe fn atomic_compare_exchange<T>(dst: *mut T, old: T, new: T, @@ -1408,29 +1407,6 @@ unsafe fn atomic_compare_exchange<T>(dst: *mut T, } #[inline] -#[cfg(all(stage0, not(cargobuild)))] -unsafe fn atomic_compare_exchange<T>(dst: *mut T, - old: T, - new: T, - success: Ordering, - _: Ordering) -> Result<T, T> - where T: ::cmp::Eq + ::marker::Copy -{ - let val = match success { - Acquire => intrinsics::atomic_cxchg_acq(dst, old, new), - Release => intrinsics::atomic_cxchg_rel(dst, old, new), - AcqRel => intrinsics::atomic_cxchg_acqrel(dst, old, new), - Relaxed => intrinsics::atomic_cxchg_relaxed(dst, old, new), - SeqCst => intrinsics::atomic_cxchg(dst, old, new), - }; - if val == old { - Ok(val) - } else { - Err(val) - } -} - -#[inline] unsafe fn atomic_compare_exchange_weak<T>(dst: *mut T, old: T, new: T, |
