Commit Graph

827 Commits

Author SHA1 Message Date
Matthew Dawson
ce3abc5801
Fix stage 2 builds with a custom libdir.
When copying libstd for the stage 2 compiler, the builder ignores the
configured libdir/libdir_relative configuration parameters.  This causes
the compiler to fail to find libstd, which cause any tools built with the
stage 2 compiler to fail.

To fix this, make the copy steps of rustbuild aware of the libdir_relative
parameter when the stage >= 2.  Also update the dist target to be aware of
the new location of libstd.
2017-07-07 23:07:01 -04:00
bors
8cab2c73d4 Auto merge of #42899 - alexcrichton:compiler-builtins, r=nikomatsakis
Switch to rust-lang-nursery/compiler-builtins

This commit migrates the in-tree `libcompiler_builtins` to the upstream version
at https://github.com/rust-lang-nursery/compiler-builtins. The upstream version
has a number of intrinsics written in Rust and serves as an in-progress rewrite
of compiler-rt into Rust. Additionally it also contains all the existing
intrinsics defined in `libcompiler_builtins` for 128-bit integers.

It's been the intention since the beginning to make this transition but
previously it just lacked the manpower to get done. As this PR likely shows it
wasn't a trivial integration! Some highlight changes are:

* The PR rust-lang-nursery/compiler-builtins#166 contains a number of fixes
  across platforms and also some refactorings to make the intrinsics easier to
  read. The additional testing added there also fixed a number of integration
  issues when pulling the repository into this tree.

* LTO with the compiler-builtins crate was fixed to link in the entire crate
  after the LTO process as these intrinsics are excluded from LTO.

* Treatment of hidden symbols was updated as previously the
  `#![compiler_builtins]` crate would mark all symbol *imports* as hidden
  whereas it was only intended to mark *exports* as hidden.
2017-07-06 02:34:29 +00:00
Alex Crichton
78fdbfc400 rustbuild: Only -Zsave-analysis for libstd
Don't pass the flag when we're compiling the compiler or other related tools
2017-07-05 13:51:34 -07:00
Alex Crichton
7e6c9f3635 Switch to rust-lang-nursery/compiler-builtins
This commit migrates the in-tree `libcompiler_builtins` to the upstream version
at https://github.com/rust-lang-nursery/compiler-builtins. The upstream version
has a number of intrinsics written in Rust and serves as an in-progress rewrite
of compiler-rt into Rust. Additionally it also contains all the existing
intrinsics defined in `libcompiler_builtins` for 128-bit integers.

It's been the intention since the beginning to make this transition but
previously it just lacked the manpower to get done. As this PR likely shows it
wasn't a trivial integration! Some highlight changes are:

* The PR rust-lang-nursery/compiler-builtins#166 contains a number of fixes
  across platforms and also some refactorings to make the intrinsics easier to
  read. The additional testing added there also fixed a number of integration
  issues when pulling the repository into this tree.

* LTO with the compiler-builtins crate was fixed to link in the entire crate
  after the LTO process as these intrinsics are excluded from LTO.

* Treatment of hidden symbols was updated as previously the
  `#![compiler_builtins]` crate would mark all symbol *imports* as hidden
  whereas it was only intended to mark *exports* as hidden.
2017-07-05 07:08:36 -07:00
Mark Simulacrum
1654a2f5ac Use build.build instead of build.config.build 2017-07-04 07:39:47 -06:00
Mark Simulacrum
5809a7d0b7 Move targets, hosts, and build triple into Build. 2017-07-04 07:31:56 -06:00
Mark Simulacrum
39cf1da81c Store verbosity on Build
Prevents accidental mistakes in not using the right verbosity by going
to only config or flags.
2017-07-04 07:31:56 -06:00
Mark Simulacrum
4dc8fe9083 Store positive instead of negative fail_fast.
This makes later negation much easier to interpret.
2017-07-04 07:31:56 -06:00
Mark Simulacrum
712bd0d841 Remove src_is_git, instead call method on rust_info directly. 2017-07-04 07:31:56 -06:00
Mark Simulacrum
2cc5b084a0 Clarify meaning of Build.cargo, Build.rustc.
Rename Build.{cargo, rustc} to {initial_cargo, initial_rustc}.
2017-07-04 07:31:56 -06:00
Mark Simulacrum
743af95d4b Update a few comments. 2017-07-04 07:31:56 -06:00
Mark Simulacrum
6766abbfa9 Clippy lints 2017-07-04 07:31:55 -06:00
Mark Simulacrum
802b6db004 Cleanup dist 2017-07-04 07:31:55 -06:00
Mark Simulacrum
c6ece966ac Cleanup utils 2017-07-04 07:31:55 -06:00
Mark Simulacrum
388fca81f6 Cleanup compile.rs. 2017-07-04 07:31:55 -06:00
Mark Simulacrum
5b44cbc39f Cleanups to check code. 2017-07-04 07:31:55 -06:00
Mark Simulacrum
d3bf6e562e Remove 'static lifetimes from channels. 2017-07-04 07:31:55 -06:00
Mark Simulacrum
7ed4ee272e Clean up and restructure sanity checking. 2017-07-04 07:31:55 -06:00
Mark Simulacrum
01e83a362c Don't allocate args in order to run find. 2017-07-04 07:31:55 -06:00
bors
c3a130cffc Auto merge of #43003 - milmazz:bootstrap-pep8, r=alexcrichton
bootstrap: Fix all the pep-8 issues reported by flake8

This commit also adds a few missing docstrings.

Today, after reading this [article](https://blog.rust-lang.org/2017/06/27/Increasing-Rusts-Reach.html), I downloaded this project and started building from source. In the meantime, I began to read the `bootstrap.py`, to know more about the building process, and I made a few changes, this is my first contribution to the project, hope you like it.

BTW, I have a few doubts about the `bootstrap.py`, any guidance is more than welcome:

* Where can I find the unit tests for this script? In case it doesn't exist yet, do you like to include some unit tests with pytest?
* Some methods like `fix_executable`, `get_string`, and `exe_suffix` in the `RustBuild` class should be converted to a function because it doesn't use `self` anywhere. What do you think?
2017-07-02 01:51:30 +00:00
Milton Mazzarri
44c6781cef
Simplify print arguments 2017-07-01 07:16:57 -05:00
bors
7a2c09b6f5 Auto merge of #42977 - Keruspe:master, r=alexcrichton
rustbuild: set __CARGO_DEFAULT_LIB_METADATA to channel

Also, update the cargo submodule to handle the new value.
2017-07-01 09:10:13 +00:00
Milton Mazzarri
ebf24ad3e9
bootstrap: Fix some PEP8 issues
This commit also adds a few missing docstrings
2017-06-30 23:24:35 -05:00
Venkata Giri Reddy
401614b75a rustc_llvm: re-run build script when env var LLVM_CONFIG changes 2017-06-30 16:55:32 +00:00
Marc-Antoine Perennou
d23a62ba71 rustbuild: set __CARGO_DEFAULT_LIB_METADATA to channel
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2017-06-30 09:16:00 +02:00
bors
bc9822af2e Auto merge of #42784 - tlively:wasm-bot, r=alexcrichton
Make wasm32 buildbot test LLVM backend

This adds the experimental targets option to configure so it can be used
by the builders and changes the wasm32 Dockerfile accordingly. Instead
of using LLVM from the emsdk, the builder's emscripten tools now uses
the Rust in-tree LLVM, since this is the one built with wasm support.
2017-06-24 22:34:08 +00:00
Thomas Lively
447297ce59 Make wasm32 buildbot test LLVM backend
This adds the experimental targets option to configure so it can be used
by the builders and changes the wasm32 Dockerfile accordingly. Instead
of using LLVM from the emsdk, the builder's emscripten tools now uses
the Rust in-tree LLVM, since this is the one built with wasm support.
2017-06-22 18:34:56 -07:00
Ian Douglas Scott
f98ffb5bc3
Make Build.cxx() return a Result instead of panicking 2017-06-22 11:51:32 -07:00
Ian Douglas Scott
526afcb0a3
Set CXX_<target> in bootstrap 2017-06-22 10:42:10 -07:00
Mark Simulacrum
7f693e2cb9 Rollup merge of #42806 - ollie27:rustbuild_compiler_docs, r=alexcrichton
rustbuild: Fix compiler docs yet again

Add support for `-Z force-unstable-if-unmarked` to rustdoc.

r? @alexcrichton
2017-06-22 06:30:12 -06:00
Mark Simulacrum
ea7db0787d Rollup merge of #42805 - stepancheg:forward-python, r=alexcrichton
Pass path to python from bootstrap.py to bootstrap.rs

When bootstrap is executed with python not in `$PATH`, (e. g.
`c:\Python27\python.exe x.py test`) bootstrap cannot find python
and crashes.

This commit passes path to python in `BOOTSTRAP_PYTHON` env var.
2017-06-22 06:30:11 -06:00
Mark Simulacrum
a859f2bd4b Rollup merge of #42804 - Mark-Simulacrum:rustbuild-colors, r=alexcrichton
Make rustc errors colorful.

Rustbuild passes --message-format=json to Cargo to learn about the
dependencies for a given build, which then makes Cargo steal the
stderr/stdout for the compiler process, leading to non colorful output.
To avoid this, detection of stderr being a tty is added to rustbuild,
and an environment variable is used to communicate with the rustc shim.

Fixes https://github.com/rust-lang/rust/issues/42801.

r? @alexcrichton
2017-06-22 06:30:10 -06:00
bors
efdf55d048 Auto merge of #42785 - Mark-Simulacrum:fix-verbose-bootstrap, r=alexcrichton
Fixes bootstrapping with custom cargo/rustc.

config.mk is now always read when parsing the configuration to prevent
this from reoccurring in the future, hopefully.

Fixes https://github.com/rust-lang/rust/issues/42543.

r? @alexcrichton

cc @infinity0 @kyrias
2017-06-22 05:50:58 +00:00
Oliver Middleton
ae1dc2a6f9 rustbuild: Fix compiler docs yet again
Add support for `-Z force-unstable-if-unmarked` to rustdoc.
2017-06-21 17:59:10 +01:00
Mark Simulacrum
305f5263f9 Make rustc errors colorful.
Rustbuild passes --message-format=json to Cargo to learn about the
dependencies for a given build, which then makes Cargo steal the
stderr/stdout for the compiler process, leading to non colorful output.
To avoid this, detection of stderr being a tty is added to rustbuild,
and an environment variable is used to communicate with the rustc shim.
2017-06-21 10:04:21 -06:00
Stepan Koltsov
f441e07feb Pass path to python from bootstrap.py to bootstrap.rs
When bootstrap is executed with python not in `$PATH`, (e. g.
`c:\Python27\python.exe x.py test`) bootstrap cannot find python
and crashes.

This commit passes path to python in `BOOTSTRAP_PYTHON` env var.
2017-06-21 19:01:24 +03:00
Mark Simulacrum
4caa0b020f Fixes bootstrapping with custom cargo/rustc.
config.mk is now always read when parsing the configuration to prevent
this from reoccurring in the future, hopefully.
2017-06-20 18:05:34 -06:00
Alex Crichton
5c3d0e6de3 Switch to the crates.io getopts crate
This commit deletes the in-tree `getopts` crate in favor of the crates.io-based
`getopts` crate. The main difference here is with a new builder-style API, but
otherwise everything else remains relatively standard.
2017-06-20 12:43:12 -07:00
bors
380100c568 Auto merge of #42571 - tlively:wasm-dev, r=alexcrichton
Enable wasm LLVM backend

Enables compilation to WebAssembly with the LLVM backend using the target triple "wasm32-unknown-unknown". This is the beginning of my work on #38804.

**edit:** The new new target is now wasm32-experimental-emscripten instead of wasm32-unknown-unknown.
2017-06-20 09:44:40 +00:00
Alex Crichton
be7ebdd512 Bump version and stage0 compiler 2017-06-19 22:25:05 -07:00
Mark Simulacrum
c982529327 Rollup merge of #42720 - murarth:deprecated-collections, r=alexcrichton
Reintroduce deprecated `collections` crate
2017-06-18 10:34:10 -06:00
Mark Simulacrum
7eff974454 Rollup merge of #42695 - Mark-Simulacrum:fix-verbose, r=alexcrichton
Use custom cargo/rustc paths when parsing flags.

Fixes https://github.com/rust-lang/rust/issues/41779, probably also https://github.com/rust-lang/rust/issues/42543 (I think they're duplicates).

I'm not entirely happy with the implementation, since it means we parse the configuration twice, but it's the minimal solution. I think the other choice is to move both calls to Config::parse inside Flags::parse and merge them, but I don't know if that's a good idea.

r? @alexcrichton
2017-06-18 10:34:08 -06:00
Murarth
6484258f17 Reintroduce deprecated collections crate 2017-06-17 13:18:18 -07:00
Thomas Lively
a1981a64a2 Add target to use LLVM wasm backend
The new target is wasm32-experimental-emscripten. Adds a new
configuration option to opt in to building experimental LLVM backends
such as the WebAssembly backend. The target name was chosen to be
similar to the existing wasm32-unknown-emscripten target so that the
build and tests would work with minimal other code changes. When/if the
new target replaces the old target, simply renaming it should just work.
2017-06-16 15:43:43 -07:00
bors
b40be00a0c Auto merge of #42612 - est31:master, r=nagisa
Autogenerate stubs and SUMMARY.md in the unstable book

Removes a speed bump in compiler development by autogenerating stubs for features in the unstable book. See #42454 for discussion.

The PR contains three commits, separated in order to make review easy:

* The first commit converts the tidy tool from a binary crate to a crate that contains both a library and a binary. In the second commit, we'll use the tidy library
* The second and main commit introduces autogeneration of SUMMARY.md and feature stub files
* The third commit turns off the tidy lint that checks for features without a stub, and removes the stub files. A separate commit due to the large number of files touched

Members of the doc team who wish to document some features can either do this (where `$rustsrc` is the root of the rust repo git checkout):

1. cd to `$rustsrc/src/tools/unstable-book-gen` and then do `cargo run $rustsrc/src $rustsrc/src/doc/unstable-book` to put the stubs into the unstable book
2. cd to `$rustsrc` and run `git ls-files --others --exclude-standard` to list the newly added stubs
3. choose a file to edit, then `git add` it and `git commit`
4. afterwards, remove all changes by the tool by doing `git --reset hard` and `git clean -f`

Or they can do this:

1. remove the comment marker in `src/tools/tidy/src/unstable_book.rs` line 122
2. run `./x.py test src/tools/tidy` to list the unstable features which only have stubs
3. revert the change in 1
3. document one of the chosen unstable features

The changes done by this PR also allow for further development:

* tidy obtains information about tracking issues. We can now forbid differing tracking issues between differing `#![unstable]` annotations. I haven't done this but plan to in a future PR
* we now have a general framework for generating stuff for the unstable book at build time. Further changes can autogenerate a list of the API a given library feature exposes.

The old way to simply click through the documentation after it has been uploaded to rust-lang.org works as well.

r? @nagisa

Fixes #42454
2017-06-16 14:41:15 +00:00
Mark Simulacrum
73267374d4 Use custom cargo/rustc paths when parsing flags. 2017-06-16 07:44:09 -06:00
est31
b34ac5dbda Fix cross compilation 2017-06-16 15:07:55 +02:00
bors
ebbc9ea914 Auto merge of #42410 - nagisa:llvmup, r=sanxiyn
Upgrade LLVM

Includes https://github.com/rust-lang/llvm/pull/80
2017-06-16 12:18:45 +00:00
bors
c3627e25ee Auto merge of #42631 - malbarbo:wasm32, r=alexcrichton
Add a travis builder for wasm32-unknown-emscripten

This commits add an entry to travis matrix that will execute wasm32-unknown-emscripten tests suites.

- Emscripten for asmjs was updated to sdk-1.37.13-64bit
- The tests are run with node 8.0.0 (it can execute wasm)
- A wrapper script is used to run each test from the directory where it is (workaround for https://github.com/kripken/emscripten/issues/4542)
- Some tests are ignore, see #42629 and #42630
2017-06-16 07:54:59 +00:00
Corey Farwell
a5926115b4 Rollup merge of #42651 - infinity0:master, r=alexcrichton
Only run check-linkchecker when actually building docs

Otherwise the build fails, when running tests but not building docs, e.g.:
https://buildd.debian.org/status/fetch.php?pkg=rustc&arch=ppc64el&ver=1.17.0%2Bdfsg2-3&stamp=1497403375&raw=0
2017-06-16 00:32:43 -04:00
Simonas Kazlauskas
406eddf5e1 Add a no-system-llvm compilecheck header 2017-06-15 19:11:55 +03:00
bors
258ae6dd9b Auto merge of #42648 - murarth:merge-alloc-collections, r=alexcrichton
Merge crate `collections` into `alloc`

This is a necessary step in order to merge #42565
2017-06-15 12:37:54 +00:00
Ximin Luo
13b1a80505 Only run check-linkchecker when actually building docs
Otherwise the build fails, when running tests but not building docs, e.g.:
https://buildd.debian.org/status/fetch.php?pkg=rustc&arch=ppc64el&ver=1.17.0%2Bdfsg2-3&stamp=1497403375&raw=0
2017-06-15 13:25:15 +02:00
Ximin Luo
62c245281c Ensure that disable-doc builds don't depend on doc targets 2017-06-15 13:24:08 +02:00
bors
dfa7e21e4e Auto merge of #42433 - marco-c:profiling, r=alexcrichton
Build instruction profiler runtime as part of compiler-rt

r? @alexcrichton

This is #38608 with some fixes.

Still missing:
- [x] testing with profiler enabled on some builders (on which ones? Should I add the option to some of the already existing configurations, or create a new configuration?);
- [x] enabling distribution (on which builders?);
- [x] documentation.
2017-06-14 08:46:14 +00:00
Murarth
eadda7665e Merge crate collections into alloc 2017-06-13 23:37:34 -07:00
est31
c2d59067fb Autogenerate stubs and the summary of the unstable book 2017-06-14 04:59:27 +02:00
Marco Castelluccio
5c084fd8ed Add libprofiler_builtins to the list of paths for the rust-src component 2017-06-13 20:22:43 +01:00
Marco A L Barbosa
554f21bc02 Do not execute .asm.js files on wasm32 tests
Files with extensions .asm.js are used to generate .wasm files, they are
not intented to be execute.
2017-06-13 09:32:49 -03:00
bors
9454dd5d2d Auto merge of #42491 - RalfJung:bootstrap-help, r=alexcrichton
bootstrap: improve 'build --help' by explaining what exactly the last example does

I recently found myself confused about what exactly gets built how often when I run which command; I think this would have helped me.

One thing I did not touch, but I feel could also be improved, is the wording just above: "For a quick build with a usable compile, you can pass".  I am not a native speaker, but this sounds odd to me. Do you mean "For a quick build of a usable compiler" (but then it should say where the usable compiler is produced)? Or do you mean "For a quick build testing if the compiler is usable"? I can reword this, but I'd like to make sure I understand the intent of the message.

What about
```
    For a quick build of a usable compiler, you can pass:

        ./x.py build --stage 1 src/libtest

    This will first build everything once (like --stage 0 without further
    arguments would), and then use the compiler built in stage 0 to build
    src/libtest and its dependencies.
    Once this is done, build/$ARCH/stage1 contains a usable compiler.
```
However, I am not sure this is actually true. In particular, why even bother building the libstd in stage 1? AFAIK that ends up in `build/*/stage1-std`, not in `build/*/stage1` (which is filled from `build/*/stage0-*`).
2017-06-08 22:21:29 +00:00
Ralf Jung
7359c791b5 bootstrap: further clarify build --help 2017-06-07 22:08:48 -07:00
Corey Farwell
24f48d030e Rollup merge of #42485 - Mark-Simulacrum:skip-no-doc, r=alexcrichton
Skip printing for skipped doc tests.

Followup to https://github.com/rust-lang/rust/pull/42437 to further reduce noise.

r? @alexcrichton
2017-06-06 22:36:37 -04:00
Corey Farwell
b472b66454 Rollup merge of #42429 - venkatagiri:llvm_config, r=alexcrichton
rustc_llvm: re-run build script if config.toml changes

closes #35199
2017-06-06 22:36:34 -04:00
Ralf Jung
e37cfc7dd2 bootstrap: improve 'build --help' by explaining what exactly the last example does 2017-06-06 14:26:56 -07:00
Mark Simulacrum
bc8fabbabc Skip printing for skipped doc tests. 2017-06-06 12:00:22 -06:00
Mark Simulacrum
dd1d75e9ec Skip documentation files without ``` when running markdown tests.
This should reduce the 'running 0 tests' noise in builds, and is a good
heuristic for us to use.
2017-06-04 17:55:50 -06:00
Venkata Giri Reddy
40f8536449 rustc_llvm: re-run build script if config.toml changes 2017-06-04 18:35:57 +00:00
Marco Castelluccio
ecba8d6a23 Merge branch 'profiling' of github.com:whitequark/rust into profiling 2017-06-04 15:54:39 +01:00
Corey Farwell
4683500036 Rollup merge of #42382 - alexcrichton:remove-rustflags, r=Mark-Simulacrum
rustbuild: Remove RUSTFLAGS logic in rustc shim

This was added in #38072 but I can't recall why and AFAIK Cargo already handles
this. This was discovered through #42146 where passing duplicate flags was
causing problems.
2017-06-03 01:00:55 -04:00
Corey Farwell
25bbbb3119 Rollup merge of #42363 - cuviper:no-fail-fast, r=alexcrichton
rustbuild: Add `./x.py test --no-fail-fast`

This option forwards to each `cargo test` invocation, and applies the
same logic across all test steps to keep going after failures.  At the
end, a brief summary line reports how many commands failed, if any.

Note that if a test program fails to even start at all, or if an
auxiliary build command related to testing fails, these are still left
to stop everything right away.

Fixes #40219.
2017-06-03 01:00:53 -04:00
Corey Farwell
57b87c2c4f Rollup merge of #42354 - Mark-Simulacrum:reduce-verbosity, r=alexcrichton
Reduce verbosity of build logs

This does two separate things.
 - Sets sccache logging to warn instead of info.
 - Makes tests when running for a given PR (not on auto branch) quiet. (cc @eddyb)

r? @alexcrichton
2017-06-03 01:00:52 -04:00
Mark Simulacrum
98dc118c72 Reduce sccache log level. 2017-06-02 11:44:54 -06:00
Alex Crichton
225073eff8 rustbuild: Remove RUSTFLAGS logic in rustc shim
This was added in #38072 but I can't recall why and AFAIK Cargo already handles
this. This was discovered through #42146 where passing duplicate flags was
causing problems.
2017-06-02 09:57:20 -07:00
Josh Stone
617aea4c9b rustbuild: Add ./x.py test --no-fail-fast
This option forwards to each `cargo test` invocation, and applies the
same logic across all test steps to keep going after failures.  At the
end, a brief summary line reports how many commands failed, if any.

Note that if a test program fails to even start at all, or if an
auxiliary build command related to testing fails, these are still left
to stop everything right away.

Fixes #40219.
2017-06-02 09:27:44 -07:00
Mark Simulacrum
551dd7c7a2 Rollup merge of #42225 - brson:vs2017, r=alexcrichton
Support VS 2017

Fixes #38584

This replaces all the MSVC linker logic with that from the 'gcc' crate. The code looks the same, but there could be regressions.

I've only tested this with x86_64.

r? @alexcrichton
cc @vadimcn @retep998
2017-06-02 09:10:42 -06:00
Brian Anderson
da100fe0bb Support VS 2017
Fixes #38584
2017-06-01 20:41:38 +00:00
kennytm
6ac0787ff3
ci: Further tone down the test verbosity.
When `--quiet` is passed to rustbuild, suppress rustdoc test output unless
failure.

Added a `--quiet` flag to `tidy`, which suppresses the features table.

The actual `--quiet` flag is enabled in #42354.

Since details of failed tests will still be printed, and the name of slow
tests taking >60 to runtime will also be printed, the debugging difficulty
caused by information loss should be minimal; but it is very worthwhile to
keep the log under 10000 lines on Travis CI so that common errors can be
spotted without reading the raw log.
2017-06-02 01:22:37 +08:00
kennytm
e6e5dc0e9c
ci: Improve log output (mainly Travis).
* Bring back colors on Travis, which was disabled since #39036.
  Append --color=always to cargo when running in CI environment.
* Removed `set -x` in the shell scripts. The `retry` function already
  prints which command it is running, add `-x` just add noise to the
  output.
* Support travis_fold/travis_time. Matching pairs of these allow Travis CI
  to collapse the output in between. This greatly cut down the unnecessary
  "successful" output one need to scroll through before finding the failed
  statement.
2017-06-02 01:14:26 +08:00
bors
afd4b81c86 Auto merge of #42263 - alexcrichton:fix-copies, r=Mark-Simulacrum
rustbuild: Fix copying duplicate crates into the sysroot

After compiling a project (e.g. libstd, libtest, or librustc) rustbuild needs to
copy over all artifacts into the sysroot of the compiler it's assembling.
Unfortunately rustbuild doesn't know precisely what files to copy! Today it has
a heuristic where it just looks at the most recent version of all files that
look like rlibs/dylibs and copies those over. This unfortunately leads to bugs
with different versions of the same crate as seen in #42261.

This commit updates rustbuild's strategy of copying artifacts to work off the
list of artifacts produced by `cargo build --message-format=json`. The build
system will now parse json messages coming out of Cargo to watch for files being
generated, and then it'll only copy over those precise files.

Note that there's still a bit of weird logic where Cargo prints that it's
creating `libstd.rlib` where we actually want `libstd-xxxxx.rlib`, so we still
do a bit of "most recent file" probing for those. This commit should take care
of the crates.io dependency issues, however, as they're all copied over
precisely.

Closes #42261
2017-06-01 07:44:01 +00:00
Corey Farwell
2221f9c6b9 Rollup merge of #42306 - efyang:rls-packaging, r=alexcrichton
Add the RLS to .exe, .msi, and .pkg installers

This directly addresses issue #42157, adding the RLS as a non-default component in the mentioned installers. The windows installers appear to have the right functionality added, but I don't have a machine that runs OSX, so it would be great if someone could test whether my .pkg commit adds the RLS correctly. The final commit also fixes some formatting issues I'd noticed while working on the installers, but I don't know if that's within the scope of this PR, so input would be appreciated.
2017-06-01 00:09:24 -04:00
Alex Crichton
2dab1e2150 rustbuild: Fix copying duplicate crates into the sysroot
After compiling a project (e.g. libstd, libtest, or librustc) rustbuild needs to
copy over all artifacts into the sysroot of the compiler it's assembling.
Unfortunately rustbuild doesn't know precisely what files to copy! Today it has
a heuristic where it just looks at the most recent version of all files that
look like rlibs/dylibs and copies those over. This unfortunately leads to bugs
with different versions of the same craet as seen in #42261.

This commit updates rustbuild's strategy of copying artifacts to work off the
list of artifacts produced by `cargo build --message-format=json`. The build
system will now parse json messages coming out of Cargo to watch for files being
generated, and then it'll only copy over those precise files.

Note that there's still a bit of weird logic where Cargo prints that it's
creating `libstd.rlib` where we actually want `libstd-xxxxx.rlib`, so we still
do a bit of "most recent file" probing for those. This commit should take care
of the crates.io dependency issues, however, as they're all copied over
precisely.

Closes #42261
2017-05-30 08:11:42 -07:00
Edward Yang
7c362732dc Add RLS to .pkg installer 2017-05-29 21:50:23 -05:00
Edward Yang
eeebfd667b Add RLS to .exe and .msi installers 2017-05-29 21:31:33 -05:00
Ralf Jung
6620c4b078 rust-src: include everything needed to compile libstd with jemalloc 2017-05-28 21:55:54 -07:00
bors
a11c26f6ac Auto merge of #42109 - Keruspe:master, r=alexcrichton
rustbuild: don't create a source tarball when installing

This splits Install out of Dist as it is not a full dist anymore, and creates the source tarball only for the Dist command.
This will allow splitting install in a few rules if we want as it's done for other phases.
2017-05-27 11:23:45 +00:00
bors
557967766b Auto merge of #42081 - ishitatsuyuki:submodule-better, r=aidanhs
Use the improved submodule handling

r? @alexcrichton

That was a crap...
```
Updating submodules
Traceback (most recent call last):
  File "./x.py", line 20, in <module>
    bootstrap.main()
  File "/home/ishitatsuyuki/Documents/rust/src/bootstrap/bootstrap.py", line 684, in main
    bootstrap()
  File "/home/ishitatsuyuki/Documents/rust/src/bootstrap/bootstrap.py", line 662, in bootstrap
    rb.update_submodules()
  File "/home/ishitatsuyuki/Documents/rust/src/bootstrap/bootstrap.py", line 566, in update_submodules
    path = line[1:].split(' ')[1]
TypeError: a bytes-like object is required, not 'str'
```

Maybe we need to confirm the compatibility of git options, such as `git config` or `git -C` (I believe they existed long before, though). This is tested locally.
2017-05-26 18:11:54 +00:00
bors
d86d134c38 Auto merge of #41932 - wesleywiser:py-to-rust, r=alexcrichton
Rewrite make-win-dist.py in Rust

Fixes #41568
2017-05-25 10:35:04 +00:00
Tatsuyuki Ishi
15c26c92cc bootstrap.py: support verbose for submodules 2017-05-25 14:00:05 +09:00
Tatsuyuki Ishi
46ebd832e3 bootstrap.py: decode to str
Also, improve the split mechanism to address space in paths.
2017-05-25 13:58:10 +09:00
Tatsuyuki Ishi
5bcf06aa18 bootstrap.py: Filter instead of iteration 2017-05-25 13:57:51 +09:00
Tatsuyuki Ishi
1fea55ba51 Format bootstrap.py using autopep8 2017-05-25 13:57:23 +09:00
Tatsuyuki Ishi
d552e34e20 Use the improved submodule handling 2017-05-25 13:57:05 +09:00
Dennis Schridde
cd86a9ba4a bootstrap: Use common run() function to call cargo
This brings verbosity even to invocation of cargo itself
2017-05-24 10:52:57 +02:00
Dennis Schridde
604f716dbe bootstrap: Make bootstrap verbose if requested
Fixes: #42099
2017-05-24 10:52:57 +02:00
Dennis Schridde
2aa6700b25 bootstrap: Actually respect verbosity setting in config.toml 2017-05-24 10:52:52 +02:00
Marc-Antoine Perennou
d0ea705a16 rustbuild: distcheck needs rust-src too
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2017-05-24 08:45:56 +02:00
Marc-Antoine Perennou
53ae00a8ab rustbuild: make distcheck depend on dist-plain-source-tarball
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2017-05-23 18:13:53 +02:00
Marc-Antoine Perennou
9af464be8a rustbuild: drop unused macro in tets
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2017-05-23 18:13:53 +02:00
Wesley Wiser
7eebabeb92 Create the bin dir 2017-05-22 21:32:27 -04:00
Marc-Antoine Perennou
150d644c21 rustbuild: split Install out of Dist subcommand
only create source tarball for the Dist subcommand
mark install rule as default for Kind::Install
split install-docs
split install-std
factor out empty_dir handling
split install-cargo
split install-analysis
split install-src
rework install-rustc
properly handle cross-compilation setups for install
use pkgname in install
split plain source tarball generation from rust-src dist
document src-tarball in config.toml.exmaple

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2017-05-22 22:10:12 +02:00