Commit Graph

1739 Commits

Author SHA1 Message Date
Steve Klabnik aa63f54e37 Rollup merge of #33438 - birkenfeld:dup-words, r=steveklabnik
Fix some some duplicate words.
2016-05-07 15:35:19 -04:00
Nerijus Arlauskas b6fc4abe44 Add armv7-linux-androideabi target. 2016-05-07 13:29:57 +03:00
Niko Matsakis 47c8179bc2 remove unused aux-base argument 2016-05-06 16:24:48 -04:00
Brian Anderson 5ad99e2296 Distribute both rust-lldb and rust-gdb everywhere except win-msvc
Both debuggers are viable in some capacity on all tier-1 platforms,
and people often ask for rust-lldb on Linux or rust-gdb on OS X.
2016-05-06 03:09:48 +00:00
Georg Brandl 26eb2bef25 Fix some some duplicate words. 2016-05-05 21:12:37 +02:00
Alex Crichton f72bfe6661 rustbuild: Document many more parts of the build
This commit expands the bootstrap build system's `README.md` as well as ensuring
that all API documentation is present and up-to-date. Additionally a new
`config.toml.example` file is checked in with commented out versions of all
possible configuration values.
2016-05-03 15:15:27 -07: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
Alex Crichton 126e09e5e5 test: Move run-make tests into compiletest
Forcing them to be embedded in makefiles precludes being able to run them in
rustbuild, and adding them to compiletest gives us a great way to leverage
future enhancements to our "all encompassing test suite runner" as well as just
moving more things into Rust.

All tests are still Makefile-based in the sense that they rely on `make` being
available to run them, but there's no longer any Makefile-trickery to run them
and rustbuild can now run them out of the box as well.
2016-04-28 21:46:40 -07:00
Tshepang Lekhonkhobe a422b7e4ed some Python nits and fixes 2016-04-26 00:34:19 +02:00
bors f01bb5ed24 Auto merge of #33092 - alexcrichton:rustbuild-docs, r=brson
rustbuild: Run all markdown documentation tests

This commit adds support to rustbuild to run all documentation tests, basically
running `rustdoc --test` over all our documentation.
2016-04-23 05:36:28 -07:00
bors ef57fb7144 Auto merge of #33084 - alexcrichton:osx-python-sanity, r=michaelwoerister
Sanity check Python on OSX for LLDB tests

Two primary changes:

* Don't get past the configure stage if `python` isn't coming from `/usr/bin`
* Call `debugger.Terminate()` to prevent segfaults on newer versions of LLDB.

Closes #32994
2016-04-23 01:18:03 -07:00
bors 95545e7adc Auto merge of #33011 - alexcrichton:pkg-everything, r=brson
rustbuild: Package librustc & co for cross-hosts

Currently the `rust-std` package produced by rustbuild only contains the
standard library plus libtest, but the makefiles actually produce a `rust-std`
package with all known target libraries (including libsyntax, librustc, etc).
Tweak the behavior so the dependencies of the `dist-docs` step in rustbuild
depend on the compiler libraries as well (so that they're all packaged).

Closes #32984
2016-04-20 14:58:20 -07:00
bors 9bba2907ee 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
2016-04-20 01:16:55 -07:00
bors 3dd88f60de Auto merge of #32903 - alexcrichton:fix-rpath, r=brson
rustbuild: Fix --enable-rpath usage

This commit fixes the `--enable-rpath` configure flag in rustbuild to work
despite the compile-time directories being different than the runtime
directories. This unfortunately means that we can't use `-C rpath` out of the
box but hopefully the portability story here isn't too bad as
`src/librustc_back/rpath.rs` isn't *too* complicated.

Closes #32886
2016-04-19 22:53:17 -07: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 cbe6292c58 mk: Force system python for LLDB tests on OSX
Force usage of /usr/bin/python whenever we run LLDB tests on OSX because it
looks like no other Python will work.
2016-04-19 09:57:00 -07:00
Alex Crichton ede8944ea7 rustbuild: Run all markdown documentation tests
This commit adds support to rustbuild to run all documentation tests, basically
running `rustdoc --test` over all our documentation. This also includes support
for running the error index tests.
2016-04-19 09:52:56 -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
Alex Crichton 4d1e375654 rustbuild: Clean more as part of `make clean`
Clean out old documentation as well as the new test/tools directories. Should
prevent a problem that happened this morning where a PR bounced and then it left
docs with "broken links" so all future PRs bounced.
2016-04-16 14:56:37 -07:00
Alex Crichton 6ff8f4a34a rustbuild: Package librustc & co for cross-hosts
Currently the `rust-std` package produced by rustbuild only contains the
standard library plus libtest, but the makefiles actually produce a `rust-std`
package with all known target libraries (including libsyntax, librustc, etc).
Tweak the behavior so the dependencies of the `dist-docs` step in rustbuild
depend on the compiler libraries as well (so that they're all packaged).

Closes #32984
2016-04-15 13:55:25 -07:00
Manish Goregaokar 70601b8da2
Rollup merge of #32926 - caipre:rustbuild-verify-download, r=alexcrichton
rustbuild: Verify sha256 of downloaded tarballs

Here's a quick first pass at this.

I don't use Python often enough to claim that this is totally Pythonic. I've left off some (almost certainly unnecessary) error handling regarding opening and processing files. The whole tarball is read into memory to calculate the hash, but the file isn't *so* large so that should be fine. I don't care for the output from `raise RuntimeError`, but that's how `run()` does it so I'm following precedent.

Tested by manually changing the value of `expected`, and by modifying the tarball then forcing `rustc_out_of_date()`. Both cases tripped the error.

Closes https://github.com/rust-lang/rust/issues/32902
2016-04-16 01:18:01 +05:30
bors ccc7e95a96 Auto merge of #32972 - alexcrichton:cargotest, r=brson
cargotest: Put output in build directory

Right now cargotest uses `TempDir` to place output into the system temp
directory, but unfortunately this means that if the process is interrupted then
it'll leak the directory and that'll never get cleaned up. One of our bots
filled up its disk space and there were 20 cargotest directories lying around so
seems prudent to clean them up!

By putting the output in the build directory it should ensure that we don't leak
too many extra builds.
2016-04-15 10:32:10 -07:00
Alex Crichton 73c2d2a741 cargotest: Put output in build directory
Right now cargotest uses `TempDir` to place output into the system temp
directory, but unfortunately this means that if the process is interrupted then
it'll leak the directory and that'll never get cleaned up. One of our bots
filled up its disk space and there were 20 cargotest directories lying around so
seems prudent to clean them up!

By putting the output in the build directory it should ensure that we don't leak
too many extra builds.
2016-04-15 09:23:12 -07:00
bors 74b3684d00 Auto merge of #32895 - alexcrichton:rustbuild-beta, r=brson
rustbuild: Fix handling of the bootstrap key

Bring the calculation logic in line with the makefiles and also set the
RUSTC_BOOTSTRAP_KEY environment variable to enable the bootstrap on the stable
compiler.
2016-04-15 04:10:11 -07:00
Steve Klabnik d1f1f38c0e Rollup merge of #32865 - caipre:llvm-ninja, r=alexcrichton
Add rustbuild option to use Ninja for LLVM build

This change adds support for a `ninja` option in the `[llvm]` section of rustbuild's `config.toml`. When `true`, the option enables use of the Ninja build tool. Note that this change does not add support for Ninja to the old makefile based build system.

Closes https://github.com/rust-lang/rust/issues/32809

r? @alexcrichton
2016-04-14 14:49:09 -04:00
bors 374d262b3a Auto merge of #32718 - timonvo:bootstrap-skip-docs, r=alexcrichton
rustbuild: Skip generating docs if the config disables them.

r? @alexcrichton
2016-04-14 00:38:58 -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
Timon Van Overveldt 2805e83dcb rustbuild: Skip generating docs if the config disables them.
It looks like before these config variables weren't actually taken
into account. This patch should make the build system skip over the
documentation steps correctly.
2016-04-13 18:36:58 -07:00
Alex Crichton 7bfaeaaf9c tidy: Add a check to ensure Cargo.toml is in sync
This verifies that the crates listed in the `[dependencies]` section of
`Cargo.toml` are a subset of the crates listed in `lib.rs` for our in-tree
crates. This should help ensure that when we refactor crates over time we keep
these dependency lists in sync.
2016-04-12 15:55:14 -07:00
Alex Crichton 9dd3c54a2c rustbuild: Migrate tidy checks to Rust
This commit rewrites all of the tidy checks we have, namely:

* featureck
* errorck
* tidy
* binaries

into Rust under a new `tidy` tool inside of the `src/tools` directory. This at
the same time deletes all the corresponding Python tidy checks so we can be sure
to only have one source of truth for all the tidy checks.

cc #31590
2016-04-12 08:17:42 -07:00
Alex Crichton 11ef3a9c93 rustbuild: Fix --enable-rpath usage
This commit fixes the `--enable-rpath` configure flag in rustbuild to work
despite the compile-time directories being different than the runtime
directories. This unfortunately means that we can't use `-C rpath` out of the
box but hopefully the portability story here isn't too bad as
`src/librustc_back/rpath.rs` isn't *too* complicated.

Closes #32886
2016-04-11 22:54:10 -07:00
Alex Crichton 8efbfae6bf rustbuild: Fix handling of the bootstrap key
Bring the calculation logic in line with the makefiles and also set the
RUSTC_BOOTSTRAP_KEY environment variable to enable the bootstrap on the stable
compiler.
2016-04-11 17:16:32 -07:00
Nick Platt 7dd0bebff4 Remove redundant assignment 2016-04-10 00:50:16 -04:00
Nick Platt 3632278c84 Add rustbuild option to use Ninja for LLVM build 2016-04-10 00:34:05 -04:00
bors 526f2bf5c5 Auto merge of #32786 - brson:cargotest, r=alexcrichton
Fix cargotest

Tested in dev.
2016-04-09 04:44:43 -07:00
Brian Anderson 8019922621 Fix cargotest 2016-04-07 22:45:45 +00:00
Alex Crichton 5b29f9a9b0 rustbuild: Update bootstrap dependencies
Not much new, just bringing everything along.
2016-04-06 10:13:02 -07:00
Alex Crichton d78063dd84 rustbuild: Support cross rust-docs packages
Right now if you configure multiple hosts rustbuild will only build
documentation for the build triple, but we've got all the support necessary to
build documentation for different architectures as well. This commit
reinterprets the `target` field of doc `Step` instances to be the target of the
documentation rather than the target of the rustdoc/tool being run.

This should enable `make dist` to start producing a bunch of `rust-docs`
packages for all the cross architectures that rustbuild is producing now.
2016-04-06 10:13:02 -07:00
Alex Crichton 4e758722f4 rustbuild: Verify flags are configured
Building with `--target foo` should fail because that target wasn't actually
validated.
2016-04-06 10:13:02 -07:00
Alex Crichton c86e7c4950 rustbuild: Add helper to abstract hard_link/copy
Also helps provide context if it fails.
2016-04-06 10:13:02 -07:00
bors 3ec71b033a Auto merge of #32598 - alexcrichton:rustbuild-osx, r=aturon
rustbuild: Fix compile on OSX for 10.7

This commit should help configure our OSX rustbuild builder for targeting 10.7.
A key part of this is using `libc++` instead of `libstdc++` as apparently it's
more filled out and otherwise LLVM's cmake configuration would fail.
2016-04-02 10:30:03 -07:00
Alex Crichton 3d6340ffe2 rustbuild: Fix dist for non-host targets
The `rust-std` package that we produce is expected to have not only the standard
library but also libtest for compiling unit tests. Unfortunately this does not
currently happen due to the way rustbuild is structured.

There are currently two main stages of compilation in rustbuild, one for the
standard library and one for the compiler. This is primarily done to allow us to
fill in the sysroot right after the standard library has finished compiling to
continue compiling the rest of the crates. Consequently the entire compiler does
not have to explicitly depend on the standard library, and this also should
allow us to pull in crates.io dependencies into the build in the future because
they'll just naturally build against the std we just produced.

These phases, however, do not represent a cross-compiled build. Target-only
builds also require libtest, and libtest is currently part of the
all-encompassing "compiler build". There's unfortunately no way to learn about
just libtest and its dependencies (in a great and robust fashion) so to ensure
that we can copy the right artifacts over this commit introduces a new build
step, libtest.

The new libtest build step has documentation, dist, and link steps as std/rustc
already do. The compiler now depends on libtest instead of libstd, and all
compiler crates can now assume that test and its dependencies are implicitly
part of the sysroot (hence explicit dependencies being removed). This makes the
build a tad less parallel as in theory many rustc crates can be compiled in
parallel with libtest, but this likely isn't where we really need parallelism
either (all the time is still spent in the compiler).

All in all this allows the `dist-std` step to depend on both libstd and libtest,
so `rust-std` packages produced by rustbuild should start having both the
standard library and libtest.

Closes #32523
2016-04-01 10:18:36 -07:00
Alex Crichton 08ca5d9558 rustbuild: Fix compile on OSX for 10.7
This commit should help configure our OSX rustbuild builder for targeting 10.7.
A key part of this is using `libc++` instead of `libstdc++` as apparently it's
more filled out and otherwise LLVM's cmake configuration would fail.
2016-03-29 21:51:00 -07:00
bors 65bc9d7730 Auto merge of #32503 - dotdash:llvm_attrs, r=eddyb
Fix building on ARM
2016-03-26 10:25:03 -07:00
Björn Steinbrink 1eacb4a6c3 Revert "disable llvm assertions on ARM compilers"
This reverts commit afbbb74fec.
2016-03-26 13:02:54 +01:00
Brian Anderson c7049f6450 Fix the name of the 'check-cargotest' step 2016-03-25 17:33:10 +00:00
Brian Anderson 3a790acf19 Introduce 'cargotest' and the check-cargotest buildstep
This is a new suite of tests that verifies that the compiler
builds specific revisions of select crates from crates.io.

It does not run by default. It is intended that buildbot
runs these tests against all PRs, and gate on them.
2016-03-22 21:46:21 +00:00
Jorge Aparicio afbbb74fec disable llvm assertions on ARM compilers
workaround for #32360
2016-03-19 15:00:42 -05:00
Alex Crichton d7f80ca2c7 rustbuild: Fix cross to netbsd from Linux
Apparently the NetBSD compiler-rt builds into the linux directory as well.
I'm... detecting a trend!
2016-03-17 15:01:16 -07:00
Alex Crichton 6cc06b36c4 rustbuild: Implement `make dist`
This commit implements the `make dist` command in the new rustbuild build
system, porting over `dist.mk` and `prepare.mk` into Rust. There's a huge amount
of complexity between those two files, not all of which is likely justified, so
the Rust implementation is *much* smaller.

Currently the implementation still shells out to rust-installer as well as some
python scripts, but ideally we'd rewrite it all in the future to not shell out
and be in Rust proper.
2016-03-16 17:15:55 -07:00
bors 483fc715c6 Auto merge of #32239 - alexcrichton:fix-cross-to-freebsd, r=brson
rustbuild: Fix cross compiling to FreeBSD

This commit fixes our support for cross compiling a compiler to run on FreeBSD.
Over the weekend I managed to get a cross compiler from Linux to FreeBSD [1]
which I hope to soon use to start producing FreeBSD nightly compilers. With the
`make dist` support added in #32237 we should be able to produce standard
rustc/rust-std packages for FreeBSD through a new slave with this cross compiler.

Currently, however, we don't "Just Work" when cross compiling FreeBSD and a
number of changes were required (part of this PR). They include:

* A few build fixes were needed in LLVM. Our own branch has been rebased on the
  actual 3.8 release and I applied one extra commit [2] which contains two fixes:

  1. The LLVM CMake build system passes the `-Wl,-z,defs` flag on many
     platforms, but *not* when `CMAKE_SYSTEM_NAME` is "FreeBSD". Unfortunately
     this doesn't take into account when we're cross compiling, and as predicted
     the build will fail if `-Wl,-z,defs` is passed (see [3] for more info). To
     fix this we test `TARGET_TRIPLE` instead of the `CMAKE_SYSTEM_NAME` which
     is what we're compiling for which fixes the problem.
  2. The `PATH_MAX` constant is apparently defined in a different location than
     many other Unix systems, so a file which required this just needed some
     help to keep compiling.

* Support for compiling compiler-rt with CMake has been added to rustbuild. It
  looks like it just emulates Linux in what it compiles as it didn't seem to
  naturally produce anything else... At least the architecture is right, so
  seems good for now at least!

[1]: https://github.com/alexcrichton/port-of-rust/blob/master/prebuilt/freebsd/Dockerfile
[2]: https://github.com/rust-lang/llvm/commit/be89e4b5
[3]: https://bugs.webkit.org/show_bug.cgi?id=138420
2016-03-15 03:21:40 -07:00
Alex Crichton 155735aa51 rustbuild: Fix cross compiling to FreeBSD
This commit fixes our support for cross compiling a compiler to run on FreeBSD.
Over the weekend I managed to get a cross compiler from Linux to FreeBSD [1]
which I hope to soon use to start producing FreeBSD nightly compilers. With the
`make dist` support added in #32237 we should be able to produce standard
rustc/rust-std packages for FreeBSD through a new slave with this cross compiler.

Currently, however, we don't "Just Work" when cross compiling FreeBSD and a
number of changes were required (part of this PR). They include:

* A few build fixes were needed in LLVM. Our own branch has been rebased on the
  actual 3.8 release and I applied one extra commit [2] which contains two fixes:

  1. The LLVM CMake build system passes the `-Wl,-z,defs` flag on many
     platforms, but *not* when `CMAKE_SYSTEM_NAME` is "FreeBSD". Unfortunately
     this doesn't take into account when we're cross compiling, and as predicted
     the build will fail if `-Wl,-z,defs` is passed (see [3] for more info). To
     fix this we test `TARGET_TRIPLE` instead of the `CMAKE_SYSTEM_NAME` which
     is what we're compiling for which fixes the problem.
  2. The `PATH_MAX` constant is apparently defined in a different location than
     many other Unix systems, so a file which required this just needed some
     help to keep compiling.

* Support for compiling compiler-rt with CMake has been added to rustbuild. It
  looks like it just emulates Linux in what it compiles as it didn't seem to
  naturally produce anything else... At least the architecture is right, so
  seems good for now at least!

[1]: https://github.com/alexcrichton/port-of-rust/blob/master/prebuilt/freebsd/Dockerfile
[2]: https://github.com/rust-lang/llvm/commit/be89e4b5
[3]: https://bugs.webkit.org/show_bug.cgi?id=138420
2016-03-14 15:07:36 -07:00
Alex Crichton 8cd1c17d90 rustbuild: Refactor stage arguments away
The facet of a stage is rarely relevant when running a tool or building
something, it's all a question of what stage the *compiler* is built in. We've
already got a nice handy `Compiler` structure to carry this information, so
let's use it!

This refactors the signature of the `Build::cargo` function two ways:

1. The `stage` argument is removed, this was just duplicated with the `compiler`
   argument's stage field.
2. The `target` argument is now required. This was a bug where if the `--target`
   flag isn't passed then the snapshot stage0 compiler is always used, so we
   won't pick up any changes.

Much of the other changes in this commit are just propagating these decisions
outwards. For example many of the `Step` variants no longer have a stage
argument as they're baked into the compiler.
2016-03-14 14:56:49 -07:00
Alex Crichton 4a917e050d rustbuild: Use tool_cmd() instead of tool()
This sets up the dynamic loader path for dylibs required, so should fix the MSVC
build right now.
2016-03-14 14:56:49 -07:00
Alex Crichton 3e6fed3a7a rustbuild: Add the error-index-generator
This adds a step and a rule for building the error index as part of rustbuild.
2016-03-08 13:44:14 -08:00
Alex Crichton 16fefc5ead rustbuild: Fix stage1 rustdoc
Just always build stage1 rustdoc, it's really not that much more to build as
it's essentially just one library.
2016-03-08 13:44:14 -08:00
Alex Crichton defd1b3392 rustbuild: Add a link checker for documentation
Add a script to get run which verifies that `href` links in documents are
correct. We're always getting a steady stream of "fix a broken link" PRs and
issue reports, and we should probably just nip them all in the bud.
2016-03-08 13:44:14 -08:00
Alex Crichton f7b7535fd7 rustbuild: Fixup calling rustdoc in various stages
The stage0 rustdoc comes from the snapshot, and we need a shim like with `rustc`
to pass `--cfg` for now.
2016-03-08 11:52:11 -08:00
Alex Crichton 0788cd23ea rustbuild: Use an enum to indicate destination
Instead of using a `is_std: bool`, instead use a more well-typed and
self-documenting enum to indicate the mode in which Cargo is being invoked.
2016-03-08 11:52:10 -08:00
Alex Crichton ee6df13f0c rustbuild: Move rustbook to a `src/tools` directory
We've actually got quite a few tools that are compiled as part of our build,
let's start housing them all in a `tools` directory.
2016-03-08 11:52:09 -08:00
Alex Crichton 4d3d29dff3 rustbuild: Refactor adding steps manually
Use a macro so it automatically picks up new steps.
2016-03-08 11:51:49 -08:00
Alex Crichton 6a541937dc rustbuild: Add crate documentation generation
Run `cargo doc` to generate all documentation for the standard library, and also
add a target which generates documentation for the compiler as well (but don't
enable it by default).
2016-03-08 11:51:47 -08:00
Alex Crichton 063e68b0b6 rustbuild: Add `make check` and a check target
We'll tack on more steps here later
2016-03-07 22:50:55 -08:00
Jorge Aparicio 0b7fc0653b rustbuild: fix cross compilation of libstd to i686-unknown-linux-musl
- make sure we copy the third party objects (crt*.o) to the target stage directory.
- apply the x86_64-musl logic also to the i686-musl target.
2016-03-06 08:19:51 -05:00
Jorge Aparicio ddd2e99d02 [rustbuild] fix cross compilation of std for mips(el)-linux-musl
These targets don't link statically to libunwind or libc
2016-03-03 14:50:28 -05:00
bors a93bb135c8 Auto merge of #31713 - alexcrichton:rustbuild-docs, r=brson
This commit implements documentation generation of the nomicon, the book, the
style guide, and the standalone docs. New steps were added for each one as well
as appropriate makefile targets for each one as well.
2016-03-01 04:44:56 +00:00
Alex Crichton 15b4a8c2f3 rustbuild: Update dependencies
* Fixes a warning with libc
* Brings in some new flag updates for various platforms through gcc-rs
* Otherwise routine updates here/there
2016-02-28 10:50:13 -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 93a9ab1a1b rustbuild: Relax assertions about stage0
This allows bootstrapping new platforms immediately in stage0
2016-02-28 10:50:13 -08:00
Alex Crichton 506522ff4b rustbuild: Remove extra rustc flags
These should all no longer be necessary as they've been folded into the
compiler.
2016-02-28 10:50:13 -08:00
Alex Crichton e9a897c10f rustbuild: Add steps for linking a sysroot
When cross compiling for a new host, we can't actually run the host compiler to
generate its own libs. In theory, however, all stage2 compilers (for any host)
will produce the same libraries, so we just require the build compiler to
produce the necessary host libraries and then we link those into place.
2016-02-28 10:50:13 -08:00
Alex Crichton 06773878f3 rustbuild: Document what steps are 2016-02-28 10:50:13 -08:00
Alex Crichton 5abcc78ff8 rustbuild: Compile with the build compiler
This switches the defaults to ensure that everything is built with the build
compiler rather than the host compiler itself (which we're not guaranteed to be
able to run)
2016-02-28 10:50:13 -08:00
Alex Crichton ed3d46d278 rustbuild: Move assembling rustc to its own step
Right now it's implicitly done as part of building the compiler, but this was
intended to be a standalone step to ensure we tracked what built what.
2016-02-28 10:50:13 -08:00
Alex Crichton 189827bd96 rustbuild: Fix a copy/paste error
Fixes `--step librustc`
2016-02-28 10:50:13 -08:00
Alex Crichton 526640668d rustbuild: Enable cross-compiling LLVM
Currently all multi-host builds assume the the build platform can run the
`llvm-config` binary generated for each host platform we're creating a compiler
for. Unfortunately this assumption isn't always true when cross compiling, so we
need to handle this case.

This commit alters the build script of `rustc_llvm` to understand when it's
running an `llvm-config` which is different than the platform we're targeting for.
2016-02-28 10:50:13 -08:00
Alex Crichton a707a61cae rustbuild: Fix compiler-rt build on gnueabihf
Needs a different target to get built and also we apparently need to appease the
C++ compiler somehow.
2016-02-28 10:50:13 -08:00
Alex Crichton 93a3b294c7 rustbuild: Only pass RUSTC_FLAGS to target compiles
These flags aren't applicable to build scripts, and may actuall wreak havoc.
2016-02-28 10:50:13 -08:00
Alex Crichton 90d28ec372 rustbuild: Enable bootstrapping new hosts
This commit fixes a longstanding issue with the makefiles where all host
platforms bootstrap themselves. This commit alters the build logic for the
bootstrap to instead only bootstrap the build triple, and all other compilers
are compiled from that one compiler.

The benefit of this change is that we can cross-compile compilers which cannot
run on the build platform. For example our builders could start creating
`arm-unknown-linux-gnueabihf` compilers.

This reduces the amount of bootstrapping we do, reducing the amount of test
coverage, but overall it should largely just end in faster build times for
multi-host compiles as well as enabling a feature which can't be done today.

cc #5258
2016-02-28 10:50:13 -08:00
bors df128bdc4c Auto merge of #31620 - alexcrichton:fix-out-of-tree-builds, r=brson
This removes creating some extraneous directories and also fixes some submodule management with out of tree builds.

Closes #31619
2016-02-20 08:47:25 +00:00
Alex Crichton 848e78550c rustbuild: Add rustbook/standalone doc support
This commit implements documentation generation of the nomicon, the book, the
style guide, and the standalone docs. New steps were added for each one as well
as appropriate makefile targets for each one as well.
2016-02-16 10:39:55 -08:00
Alex Crichton 5aef0e8fac rustbuild: Fix submodules for out of tree builds
Be sure to put the git command into the right directory when we run the
submodule management information.

Closes #31619
2016-02-12 17:16:00 -08:00
Alex Crichton 07638b95ce bootstrap: Be resilient to job object failures
The build bots already use job objects, and they don't support nested job
objects, and we shouldn't entirely bail out in this case anyway!
2016-02-12 10:40:32 -08:00
Alex Crichton a1c13d03a5 bootstrap: Add a --clean flag
Also add a `clean` target for the makefiles to blow away everything related to
the build. Note that this specifically does not tamper with:

* the LLVM build directory
* the directory of the bootstrap system
* the cached downloads of cargo/rustc
2016-02-11 20:44:03 -08:00
Alex Crichton bb2e92171f configure: Add an option to use the cargo build system
This commit adds a `--enable-rustbuild` option to the configure script which
will copy a different `Makefile.in` into place to intercept all `make`
invocations.

Currently this makefile only has one target, but it's expected to be filled out
quite a bit over time!
2016-02-11 11:12:33 -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