Commit Graph

141 Commits

Author SHA1 Message Date
Corey Farwell b3518aff90 Rollup merge of #39491 - dumbbell:support-aarch64-unknown-freebsd, r=alexcrichton
Support aarch64-unknown-freebsd
2017-02-05 12:45:06 -05:00
Jean-Sébastien Pédron f6c6b31d26
`aarch64` CPU type is called `arm64` on FreeBSD 2017-02-03 09:11:33 +01:00
Dirkjan Ochtman 51e5cb525d Fix typo in bootstrap.py info message 2017-02-02 22:28:26 +01:00
Dirkjan Ochtman 8e793eb3c6 Guard against USER not existing in the environment 2017-02-02 22:28:00 +01:00
Dirkjan Ochtman a0efdf3441 Don't check for sudo environment if vendored sources are already configured 2017-02-02 22:27:15 +01:00
Alex Crichton 93f9e696c5 rustbuild: Pass --retry 3 to curl
Try to handle spurious network failures on Travis by automatically
retrying failed downloads on Travis.
2017-01-07 07:55:06 -08:00
Alex Crichton f5e7d92129 rustbuild: Update Cargo download location
I updated the beta compiler used to bootstrap the master branch in #38438 with
the intention of fixing Travis OSX linkage issues but I mistakenly forgot that
the PR only updated rustc, not Cargo itself. Cargo has a new release process
with downloads in a different location, so this commit updates rustbuild to
download from this new location by tracking revisions instead of Cargo nightly
dates.
2016-12-19 17:16:13 -08:00
Niko Matsakis 83453bc673 add and document `--incremental` flag along with misc other changes
For example:

- we now support `-vv` to get very verbose output.
- RUSTFLAGS is respected by `x.py`
- better error messages for some cases
2016-12-19 11:46:38 -05:00
Alex Crichton 0e272de69f mk: Switch rustbuild to the default build system
This commit switches the default build system for Rust from the makefiles to
rustbuild. The rustbuild build system has been in development for almost a year
now and has become quite mature over time. This commit is an implementation of
the proposal on [internals] which slates deletion of the makefiles on
2016-01-02.

[internals]: https://internals.rust-lang.org/t/proposal-for-promoting-rustbuild-to-official-status/4368

This commit also updates various documentation in `README.md`,
`CONTRIBUTING.md`, `src/bootstrap/README.md`, and throughout the source code of
rustbuild itself.

Closes #37858
2016-12-07 00:30:23 -08:00
Josh Stone 0d6323f44d rustbuild: enable an initial local cargo
This allows the initial build of src/bootstrap itself to use a local
cargo taken from `configure --local-rust-root`.  It was already finding
rustc this way, but was always downloading cargo since it didn't know
where to find it.

It now matches the same logic that `config.rs` will use for stage0,
where both rustc and cargo are taken from `CFG_LOCAL_RUST_ROOT`.
2016-11-09 22:25:17 -08:00
Eduard-Mihai Burtescu 3d2ffa06ea Rollup merge of #37524 - alexcrichton:vendor, r=brson
Vendor all rustbuild dependencies in this repo

This commit vendors all crates.io dependencies into the rust-lang/rust repository using the `cargo-vendor` tool. This is done in an effort to make rustbuild distro-ready by ensuring that our source tarballs are self-contained units which don't need extraneous network downloads.

A new `src/vendor` directory is created with all vendored crates, and Cargo, when using rustbuild, is configured to use this directory. Over time we can deduplicate this directory with the actual src tree (e.g. src/librustc_serialize, src/liblibc, src/libgetopts, ...). For now though that's left to a separate commit.
2016-11-09 20:51:17 +02:00
Alex Crichton 31a8638e5e rustbuild: Tweak for vendored dependencies
A few changes are included here:

* The `winapi` and `url` dependencies were dropped. The source code for these
  projects is pretty weighty, and we're about to vendor them, so let's not
  commit to that intake just yet. If necessary we can vendor them later but for
  now it shouldn't be necessary.

* The `--frozen` flag is now always passed to Cargo, obviating the need for
  tidy's `cargo_lock` check.

* Tidy was updated to not check the vendor directory

Closes #34687
2016-11-08 07:32:05 -08:00
Wang Xuerui 0d433a8feb rustbuild: support MIPS host builds
There is a *little* code duplication, but primarily for sake of "match
exhaustiveness". Let's blame Linux/MIPS for not exposing endianness
explicitly in `uname -m` (that's user-space interface and as such is
frozen).

Currently the build won't work as we have to wait for a new stage0 for
the MIPS host compilers, but this paves the way to self-hosted Rust on
MIPS. The cross-compiled MIPS binaries are confirmed to work on the
Loongson 3A2000 (MIPS64r2-compatible) so we have plenty of confidence
that they'll work on other MIPS platforms too, as Linux/MIPS user-space
ABI is consistent across machines of the same bitness.
2016-11-07 14:29:15 +08:00
Alex Crichton a270b8014c rustbuild: Rewrite user-facing interface
This commit is a rewrite of the user-facing interface to the rustbuild build
system. The intention here is to make it much easier to compile/test the project
without having to remember weird rule names and such. An overall view of the new
interface is:

    # build everything
    ./x.py build

    # document everyting
    ./x.py doc

    # test everything
    ./x.py test

    # test libstd
    ./x.py test src/libstd

    # build libcore stage0
    ./x.py build src/libcore --stage 0

    # run stage1 run-pass tests
    ./x.py test src/test/run-pass --stage 1

The `src/bootstrap/bootstrap.py` script is now aliased as a top-level `x.py`
script. This `x` was chosen to be both short and easily tab-completable (no
collisions in that namespace!). The build system now accepts a "subcommand" of
what to do next, the main ones being build/doc/test.

Each subcommand then receives an optional list of arguments. These arguments are
paths in the source repo of what to work with. That is, if you want to test a
directory, you just pass that directory as an argument.

The purpose of this rewrite is to do away with all of the arcane renames like
"rpass" is the "run-pass" suite, "cfail" is the "compile-fail" suite, etc. By
simply working with directories and files it's much more intuitive of how to run
a test (just pass it as an argument).

The rustbuild step/dependency management was also rewritten along the way to
make this easy to work with and define, but that's largely just a refactoring of
what was there before.

The *intention* is that this support is extended for arbitrary files (e.g.
`src/test/run-pass/my-test-case.rs`), but that isn't quite implemented just yet.
Instead directories work for now but we can follow up with stricter path
filtering logic to plumb through all the arguments.
2016-11-02 17:57:28 -07:00
Eitan Adler 9c3cf06b29 inherit from object 2016-09-17 23:31:06 -07:00
Simonas Kazlauskas 3f79310174 Try to support py3 with rustbuild better 2016-09-16 01:52:26 +03:00
Steve Klabnik 92c0ab01b1 Rollup merge of #34558 - GlenDC:master, r=alexcrichton
rustbuild: propagate bootstrap.py '--help' flag

Fixes #34534.
r? @alexcrichton
2016-07-06 19:13:06 -04:00
Ximin Luo 933a1036ae Tweak verbosity to hopefully better match intuitive expectations 2016-07-06 00:44:31 +02:00
Ximin Luo 912a9d0ad8 Have verify() return a bool rather than a generic RuntimeError 2016-07-06 00:07:26 +02:00
Ximin Luo ab5309e9e8 Avoid redundant downloads when bootstrapping
If the local file is available, then verify it against the hash we just
downloaded, and if it matches then we don't need to download it again.
2016-07-04 16:37:46 +02:00
bors da099c2322 Auto merge of #34614 - cynicaldevil:build-time, r=alexcrichton
Build: Shows total time taken to build the compiler

Fixes #34600
Prints the total time taken to build rustc by executing `src/bootstrap/bootstrap.py`; also includes time taken to download `stage0` compiler and deps.

r? @alexcrichton
2016-07-03 02:17:58 -07:00
Nikhil Shagrithaya 4dbe14005f Build: Shows total time taken to build the compiler 2016-07-02 19:53:02 +05:30
CensoredUsername ad88d50fba Older versions of python 2.7 can raise a WindowsError instead of a subprocess.CalledProcessError when `uname` does not exist 2016-07-01 18:36:28 +02:00
decauwsemaecker.glen@gmail.com 3f6c38c5e0 propagate rustbuild's bootstrap.py '--help' flag 2016-06-29 12:44:50 -05:00
bors 4fb145867b Auto merge of #33991 - alexcrichton:rustbuild-more-clean, r=aturon
rustbuild: Clean more on `make clean`

Be sure to not use the old build cache for the bootstrap build system nor the
old caches of the compiler/cargo extractions (in case something went wrong).

Closes #33986
2016-06-04 01:23:02 -07:00
Steven Allen cde72b071c build: avoid repeated string concatenation in python 2016-06-01 12:29:39 -04:00
bors 433d70cda2 Auto merge of #33141 - tshepang:python-love, r=brson
some Python nits and fixes
2016-05-31 21:37:42 -07:00
Alex Crichton ac19420535 rustbuild: Clean more on `make clean`
Be sure to not use the old build cache for the bootstrap build system nor the
old caches of the compiler/cargo extractions (in case something went wrong).

Closes #33986
2016-05-31 13:24:28 -07:00
Cyryl Płotnicki-Chudyk 6bce110c3e Remove sha256 file only if present. 2016-05-08 10:00:36 +02:00
Cyryl Płotnicki-Chudyk 15de207b9c Better error handling for bootstrap file downloads.
Remove the temp files if something goes wrong.
2016-05-08 09:54:50 +02:00
Cyryl Płotnicki-Chudyk 18dafe83b5 Code cleanup in download() in bootstrap.py
Make download() receive less parameters and use it explicitly 2 times
in get().
2016-04-30 08:43:01 +02:00
Cyryl Płotnicki-Chudyk f5884f6824 Get a file during bootstrap to a temp location.
When downloading a file in the bootstrap phase - get it to a temp
location first. Verify it there and only if downloaded properly move it
to the `cache` directory.

This should prevent `make` being stuck if the download was interrupted
or otherwise corrupted.

The temporary files are deleted in case of an exception.
2016-04-30 08:09:53 +02:00
Tshepang Lekhonkhobe a422b7e4ed some Python nits and fixes 2016-04-26 00:34:19 +02:00
Alex Crichton 02538d463a 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
2016-04-19 10:56:49 -07:00
Alex Crichton b325baf0ae rustbuild: Add support for compiletest test suites
This commit adds support in rustbuild for running all of the compiletest test
suites as part of `make check`. The `compiletest` program was moved to
`src/tools` (like `rustbook` and others) and is now just compiled like any other
old tool. Each test suite has a pretty standard set of dependencies and just
tweaks various parameters to the final compiletest executable.

Note that full support is lacking in terms of:

* Once a test suite has passed, that's not remembered. When a test suite is
  requested to be run, it's always run.
* The arguments to compiletest probably don't work for every possible
  combination of platforms and testing environments just yet. There will likely
  need to be future updates to tweak various pieces here and there.
* Cross compiled test suites probably don't work just yet, support for that will
  come in a follow-up patch.
2016-04-18 16:30:01 -07:00
Nick Platt e0f997d347 rustbuild: Verify sha256 of downloaded tarballs 2016-04-13 22:10:42 -04:00
Nick Platt ffff91a8e8 rustbuild: Improve error messaging in bootstrap.py
For normal invocations, print a short error message and exit. When
the verbose option is enabled, also print the backtrace.
2016-04-13 22:10:25 -04:00
Alex Crichton 613f449edd rustbuild: Fix building from an empty directory
A stray shutil.rmtree happened when it shouldn't have happened, causing the
entire build to fail.
2016-03-01 12:02:11 -08:00
Alex Crichton 17ae752093 rustbuild: Update nightly date
Also fix a bug where we didn't clean out previous nightlies
2016-02-28 10:50:13 -08:00
Alex Crichton 0a54e4dd87 bootstrap: Read configuration from config.mk
During the transition period where we're still using ./configure and makefiles,
read some extra configuration from `config.mk` if it's present. This means that
the bootstrap build should be configured the same as the original ./configure
invocation.

Eventually this will all be removed in favor of only storing information in
`config.toml` (e.g. the configure script will generate config.toml), but for now
this should suffice.
2016-02-11 10:42:43 -08:00
Alex Crichton 046e6874c4 Add a Cargo-based build system
This commit is the start of a series of commits which start to replace the
makefiles with a Cargo-based build system. The aim is not to remove the
makefiles entirely just yet but rather just replace the portions that invoke the
compiler to do the bootstrap. This commit specifically adds enough support to
perform the bootstrap (and all the cross compilation within) along with
generating documentation.

More commits will follow up in this series to actually wire up the makefiles to
call this build system, so stay tuned!
2016-02-11 10:42:28 -08:00