Commit Graph

316 Commits

Author SHA1 Message Date
Alex Crichton 6cb8bbc3ff rustbuild: Fix dist of save-analysis info
We don't need an extra bare tarball, the save-analysis info is already produced
with a version/target in the filename.
2016-12-12 12:28:22 -08:00
Alex Crichton 5f07d3dea9 rustbuild: Check for .git as a dir
Git worktrees have this as a file and typically won't work inside docker
containers, but that's ok, so instead of just checking for existence check for a
directory to see if the git commands will succeed.
2016-12-12 11:05:29 -08:00
Alex Crichton 6f62fae926 rustbuild: Enable unstable features in rustdoc
This ensures that stable releases produced by rustbuild will succeed in testing
as some of the rustdoc tests use unstable features.
2016-12-12 09:03:35 -08:00
bors fd5dc05793 Auto merge of #38252 - pnkfelix:mildly-robustify-configure-msg, r=alexcrichton
Make configure message re x.py not assume build dir == src dir

Fix #38251 but perhaps not BEST fix for it.

As driveby, fix copyright year in `Makefile.in`
2016-12-11 12:33:12 +00:00
bors f82b7cbc10 Auto merge of #38231 - vadimcn:errormode, r=alexcrichton
Prevent Windows from displaying UI on errors.

Otherwise tests like run-pass/out-of-stack get wedged on Windows error reporting dialog (unless error reporting has been disabled, of course).
2016-12-10 22:08:20 +00:00
bors 39c9f184a2 Auto merge of #38233 - alexcrichton:more-errors, r=japaric
rustbuild: Print out failing commands

Just ensure that we always print out the command line which should aid in
debugging.

Closes #38228
2016-12-10 13:00:25 +00:00
Nick Cameron c49ba058a0 Create tar balls of save-analysis-api metadata for the standard libraries as part of `make dist`. 2016-12-09 08:37:42 -10:00
Alex Crichton d38db82b29 rustbuild: Implement distcheck
This commit implements the `distcheck` target for rustbuild which is only ever
run on our nightly bots. This essentially just creates a tarball, un-tars it,
and then runs a full build, validating that the release tarballs do indeed have
everything they need to build Rust.
2016-12-08 17:14:44 -08:00
Felix S. Klock II 25adc4e82e Fix #38251 but perhaps not BEST fix for it. 2016-12-08 13:09:20 -10:00
bors d9aae6362d Auto merge of #38076 - alexcrichton:another-rustbuild-bug, r=japaric
rustbuild: Use src/rustc for assembled compilers

The `src/rustc` path is intended for assembling a compiler (e.g. the bare bones)
not actually compiling the whole compiler itself. This path was accidentally
getting hijacked to represent the whole compiler being compiled, so let's
redirect that elsewhere for that particular cargo project.

Closes #38039
2016-12-08 03:03:51 +00:00
Vadim Chugunov 6404143d8a Preserve inherited mode flags. 2016-12-07 18:05:20 -08:00
Vadim Chugunov cc161225bd Prevent Windows from displaying UI on errors. 2016-12-07 17:44:29 -08:00
Alex Crichton 03fb5ad7c2 rustbuild: Print out failing commands
Just ensure that we always print out the command line which should aid in
debugging.

Closes #38228
2016-12-07 17:27:58 -08: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
Corey Farwell cf299315f6 Rollup merge of #38073 - cardoe:fix-typo, r=frewsxcv
bootstrap/README: fix small typo
2016-12-03 15:39:52 -05:00
bors 2f8fd533ac Auto merge of #38050 - alexcrichton:fix-llvm-deps, r=japaric
rustbuild: Cross-compiled LLVM depens on host

We use the host's tblgen so we need to be sure to always build the host first.

Closes #38037
2016-12-02 11:35:57 +00:00
Alex Crichton 2186660b51 Update the bootstrap compiler
Now that we've got a beta build, let's use it!
2016-11-30 10:38:08 -08:00
Alex Crichton 8e9f7f5836 rustbuild: Use src/rustc for assembled compilers
The `src/rustc` path is intended for assembling a compiler (e.g. the bare bones)
not actually compiling the whole compiler itself. This path was accidentally
getting hijacked to represent the whole compiler being compiled, so let's
redirect that elsewhere for that particular cargo project.

Closes #38039
2016-11-29 13:40:43 -08:00
Doug Goldstein ffcdc19178
bootstrap/README: fix small typo 2016-11-29 13:14:37 -06:00
Alex Crichton 7506990914 rustbuild: Cross-compiled LLVM depens on host
We use the host's tblgen so we need to be sure to always build the host first.

Closes #38037
2016-11-28 07:13:47 -08:00
bors 9003e1ab6a Auto merge of #38008 - bluss:rustbuild-benches, r=alexcrichton
Add rustbuild command `bench`

Add command bench to rustbuild, so that `./x.py bench <path>` can compile and run benchmarks.

`./x.py bench --stage 1 src/libcollections` and `./x.py bench --stage 1 src/libstd` should both compile well. Just `./x.py bench` runs all benchmarks for the libstd crates.

Fixes #37897
2016-11-26 12:32:19 -06:00
Ulrik Sverdrup b1566baa0b rustbuild: Add bench subcommand
Add command `./x.py bench`; use `./x.py bench --help -v` to list all
available benchmark targets.
2016-11-25 22:15:52 +01:00
Jorge Aparicio ba07a1b58d std: make compilation of libpanic_unwind optional via a Cargo feature
with this feature disabled, you can (Cargo) compile std with
"panic=abort"

rustbuild will build std with this feature enabled, to maintain the
status quo

fixes #37252
2016-11-23 21:49:54 -05:00
bors b1da18fe9b Auto merge of #37822 - cuviper:llvm-link-shared, r=alexcrichton
rustbuild: allow dynamically linking LLVM

The makefiles and `mklldeps.py` called `llvm-config --shared-mode` to
find out if LLVM defaulted to shared or static libraries, and just went
with that.  But under rustbuild, `librustc_llvm/build.rs` was assuming
that LLVM should be static, and even forcing `--link-static` for 3.9+.

Now that build script also uses `--shared-mode` to learn the default,
which should work better for pre-3.9 configured for dynamic linking, as
it wasn't possible back then to choose differently via `llvm-config`.

Further, the configure script now has a new `--enable-llvm-link-shared`
option, which allows one to manually override `--link-shared` on 3.9+
instead of forcing static.

Update: There are now four static/shared scenarios that can happen
for the supported LLVM versions:

- 3.9+: By default use `llvm-config --link-static`
- 3.9+ and `--enable-llvm-link-shared`: Use `--link-shared` instead.
- 3.8: Use `llvm-config --shared-mode` and go with its answer.
- 3.7: Just assume static, maintaining the status quo.
2016-11-19 08:08:26 -08:00
bors 2a6d02e092 Auto merge of #37769 - alexcrichton:rustbuild-python, r=brson
rustbuild: Allow configuration of python interpreter

Add a configuration key to `config.toml`, read it from `./configure`, and add
auto-detection if none of those were specified.

Closes #35760
2016-11-18 05:03:03 -08:00
Josh Stone f13391a603 rustbuild: allow dynamically linking LLVM
The makefiles and `mklldeps.py` called `llvm-config --shared-mode` to
find out if LLVM defaulted to shared or static libraries, and just went
with that.  But under rustbuild, `librustc_llvm/build.rs` was assuming
that LLVM should be static, and even forcing `--link-static` for 3.9+.

Now that build script also uses `--shared-mode` to learn the default,
which should work better for pre-3.9 configured for dynamic linking, as
it wasn't possible back then to choose differently via `llvm-config`.

Further, the configure script now has a new `--enable-llvm-link-shared`
option, which allows one to manually override `--link-shared` on 3.9+
instead of forcing static.
2016-11-16 23:28:14 -08:00
bors 43006fcea0 Auto merge of #37742 - mrhota:llvm_debuginfo, r=alexcrichton
Add llvm debuginfo configure option

CC @nnethercote @Mark-Simulacrum

We add a new configure option, `--enable-llvm-debuginfo`, to do exactly what you'd think.

Re: #31033

Fixes #37738
2016-11-15 09:10:23 -08:00
bors c8867f8b46 Auto merge of #37672 - japaric:msp430, r=alexcrichton
enable the MSP430 LLVM backend

to let people experiment with this target out of tree.

The MSP430 architecture is used in 16-bit microcontrollers commonly used
in Digital Signal Processing applications.

---

How this was tested:

Declaring a custom target with the following specification:

``` json
{
  "arch": "msp430",
  "data-layout": "e-m:e-p:16:16-i32:16:32-a:16-n8:16",
  "executables": true,
  "linker": "msp430-gcc",
  "llvm-target": "msp430",
  "max-atomic-width": 0,
  "no-integrated-as": true,
  "os": "none",
  "panic-strategy": "abort",
  "relocation-model": "static",
  "target-endian": "little",
  "target-pointer-width": "16"
}
```

And this minimal file:

``` rust

pub fn start() -> ! {
    loop {}
}

trait Copy {}

trait Sized {}
```

Produces the following object files:

```
$ rustc --target=msp430 --emit=obj foo.rs

$ msp430-objdump -Cd foo.o

foo.o:     file format elf32-msp430

Disassembly of section .text.start:

00000000 <start>:
   0:   21 83           decd    r1
   2:   00 3c           jmp     $+2             ;abs 0x4
   4:   00 3c           jmp     $+2             ;abs 0x6
   6:   ff 3f           jmp     $+0             ;abs 0x6

$ rustc --target=msp430 --emit=obj foo.rs -O

$ msp430-objdump -Cd foo.o

foo.o:     file format elf32-msp430

Disassembly of section .text.start:

00000000 <start>:
   0:   ff 3f           jmp     $+0             ;abs 0x0
```

---

r? @alexcrichton
~~TODO get this working with Makefiles so nightly releases include this backend~~
~~TODO measure the increase in binary size~~ +187KiB (+0.47%)
~~FIXME --emit=obj produces empty object files~~
2016-11-15 01:27:47 -08:00
Alex Crichton 7cd8a497cc rustbuild: Tweak default rule inclusion
If a rule is flagged with `default(true)` then the pseudo-rule `default:foo`
will include that. If a rule is also flagged with `.host(true)`, however, then
the rule shouldn't be included for targets that aren't in the host array. This
adds a filter to ensure we don't pull in host rules for targets by accident.
2016-11-14 12:52:06 -08:00
Alex Crichton 5f626138a0 rustbuild: Allow configuration of python interpreter
Add a configuration key to `config.toml`, read it from `./configure`, and add
auto-detection if none of those were specified.

Closes #35760
2016-11-14 08:07:02 -08:00
A.J. Gardner d3574b8dc7 Make LLVM debuginfo option names consistent 2016-11-13 12:38:10 -06:00
A.J. Gardner aea1a51561 Let rustbuild parse llvm debuginfo option
update_with_config_mk() needs to read the new llvm debuginfo config
option from config.mk. Other than that, rustbuild already supports
LLVM's RelWithDebInfo build type.
2016-11-13 12:27:57 -06:00
Jorge Aparicio 7b55936869 oops, forgot to commit a rustbuild related file 2016-11-12 17:33:35 -05:00
bors fd983d02e1 Auto merge of #37611 - Mark-Simulacrum:tari-nodejs-runner-detect, r=alexcrichton
compile-test: allow overriding nodejs binary location

Add a command-line argument to manually specify which nodejs binary should be used,
which disables the default search.

Original work done by @tari.

Fixes #34188.
2016-11-12 12:02:40 -08:00
Eduard-Mihai Burtescu 220ff76e0b Rollup merge of #37690 - TimNN:llvm-rel-dbg, r=alexcrichton
rustbuild: support RelWithDebInfo for llvm

r? @alexcrichton
2016-11-12 10:38:41 +02:00
Eduard-Mihai Burtescu f80affac44 Rollup merge of #37682 - cuviper:local-cargo, r=alexcrichton
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-12 10:38:41 +02:00
Eduard-Mihai Burtescu 02312b1fdb Rollup merge of #37584 - alexcrichton:travis, r=brson
Move all Linux/OSX CI infastructure to Travis

This commit configures our `.travis.yml` to test the full suite of tests we have
on Buildbot right now. A whole mess of docker images are added to the `src/ci`
directory which represent all the build environments for each configuration.
Each of these environments is then configured in `.travis.yml` to run on the
auto branch.

Note that the full matrix of tests aren't intended to be run on all PRs.
Instead, we continue to run only one entry in the matrix, forcing all others to
finish quickly. Only the `auto` branch should run the full matrix of builds.

Also note that the infrastructure hasn't quite been allocated yet to the
rust-lang/rust repository, so everything is disabled for now except for the one
build that happens on PRs. Once that infrastructure is allocated though we can
enable this and let it fly!

Notable modifications from the current test suite today:

* Android tests are run in rustbuild instead of the makefiles, for whatever
  reason I couldn't get the makefiles to work on Travis.
* A debuginfo test was updated to work with the current version of the Android
  NDK.
* Some dependencies in `mk/tests.mk` were fixed to allow running tests in
  parallel.
2016-11-12 10:38:38 +02:00
Brian Anderson 9d087455ba bootstrap: rust-docs is a default package
This will cause it to be built as part of `make dist`.
2016-11-11 21:47:18 +00:00
Alex Crichton 008cc2d999 Move all Linux/OSX CI infastructure to Travis
This commit configures our `.travis.yml` to test the full suite of tests we have
on Buildbot right now. A whole mess of docker images are added to the `src/ci`
directory which represent all the build environments for each configuration.
Each of these environments is then configured in `.travis.yml` to run on the
auto branch.

Note that the full matrix of tests aren't intended to be run on all PRs.
Instead, we continue to run only one entry in the matrix, forcing all others to
finish quickly. Only the `auto` branch should run the full matrix of builds.

Also note that the infrastructure hasn't quite been allocated yet to the
rust-lang/rust repository, so everything is disabled for now except for the one
build that happens on PRs. Once that infrastructure is allocated though we can
enable this and let it fly!

Notable modifications from the current test suite today:

* Android tests are run in rustbuild instead of the makefiles, for whatever
  reason I couldn't get the makefiles to work on Travis.
* A debuginfo test was updated to work with the current version of the Android
  NDK.
* Some dependencies in `mk/tests.mk` were fixed to allow running tests in
  parallel.
2016-11-11 07:36:40 -08:00
Mark-Simulacrum c524c50edf compiletest: detect nodejs binary, allow override
Allow passing a custom nodejs directory in configure.
2016-11-10 18:37:41 -07:00
Tim Neumann 0254f12224 rustbuild: support RelWithDebInfo for llvm 2016-11-10 17:30:06 +01: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 860c6ab3c1 rustbuild: Fix check-error-index step
If it ran too soon there wasn't a `test` directory lying around but we'll need
one!
2016-11-08 13:49:48 -08: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 bdacb63f5a Only test docs and such for the host 2016-11-05 19:29:53 -07:00
Alex Crichton 18ee04b3df Merge branch 'gdb-next-gen' of https://github.com/TimNN/rust into rollup 2016-11-05 10:51:34 -07:00
Alex Crichton 11251e59b9 Fix tests from the rollup 2016-11-05 10:51:04 -07:00
Alex Crichton 0eff43ff75 Merge branch 'new-rustbuild' into rollup 2016-11-05 10:50:26 -07:00