Commit Graph

145 Commits

Author SHA1 Message Date
Alex Crichton b47c9690d2 bootstrap: Merge the libtest build step with libstd
Since its inception rustbuild has always worked in three stages: one for
libstd, one for libtest, and one for rustc. These three stages were
architected around crates.io dependencies, where rustc wants to depend
on crates.io crates but said crates don't explicitly depend on libstd,
requiring a sysroot assembly step in the middle. This same logic was
applied for libtest where libtest wants to depend on crates.io crates
(`getopts`) but `getopts` didn't say that it depended on std, so it
needed `std` built ahead of time.

Lots of time has passed since the inception of rustbuild, however,
and we've since gotten to the point where even `std` itself is depending
on crates.io crates (albeit with some wonky configuration). This
commit applies the same logic to the two dependencies that the `test`
crate pulls in from crates.io, `getopts` and `unicode-width`. Over the
many years since rustbuild's inception `unicode-width` was the only
dependency picked up by the `test` crate, so the extra configuration
necessary to get crates building in this crate graph is unlikely to be
too much of a burden on developers.

After this patch it means that there are now only two build phasese of
rustbuild, one for libstd and one for rustc. The libtest/libproc_macro
build phase is all lumped into one now with `std`.

This was originally motivated by rust-lang/cargo#7216 where Cargo was
having to deal with synthesizing dependency edges but this commit makes
them explicit in this repository.
2019-08-23 16:46:11 -07:00
Mateusz Mikuła c7e16c5f47 Check links on all platforms when running locally 2019-08-09 10:32:34 +02:00
Alex Crichton 3dd00bac7c ci: Remove Travis/AppVeyor configuration
Now that we've fully moved to Azure Pipelines and bors has been updated
to only gate on Azure this commit removes the remaining Travis/AppVeyor
support contained in this repository. Most of the deletions here are
related to producing better output on Travis by folding certain
sections. This isn't supported by Azure so there's no need to keep it
around, and if Azure ever adds support we can always add it back!
2019-07-15 09:18:32 -07:00
Alex Crichton 278e5fd215 rustbuild: Improve assert about building tools once
In developing #61557 I noticed that there were two parts of our tools
that were rebuilt twice on CI. One was rustfmt fixed in #61557, but
another was Cargo. The actual fix for Cargo's double compile was
rust-lang/cargo#7010 and took some time to propagate here. In an effort
to continue to assert that Cargo is itself not compiled twice, I updated
the assertion in rustbuild at the time of working on #61557 but couldn't
land it because the fix wouldn't be ready until the next bootstrap.

The next bootstrap is now here, so the fix can now land! This does not
change the behavior of rustbuild but it is intended to catch the
previous iteration of compiling cargo twice. The main update here was to
consider more files than those in `$target/release/deps` but also
consider those in `$target/release`. That's where, for example,
`libcargo.rlib` shows up and it's the file we learn about, and that's
what we want to deduplicate.
2019-07-12 13:51:56 -07:00
Mark Rousskov 7234d8cb5e Inline prepare_tool_cmd
Removing the tool argument in the previous commit means it's no longer
restricted to just bootstrap tools despite being written as such.
Inlining it prevents accidental use.
2019-06-13 08:57:55 -06:00
Mark Rousskov 0e14818321 Delete unnecessary command 2019-06-13 08:57:55 -06:00
Alex Crichton f708228508 rustbuild: Include `rustfmt` in deduplicated dependencies
Currently `rustfmt` is excluded from the "don't build dependencies
twice" check but it's currently building dependencies twice! Namely big
dependencies like `rustc-ap-syntax` are built once for rustfmt and once
for the RLS. This commit includes `rustfmt` in these checks and then
fixes the resulting feature mismatches for winapi.
2019-06-05 12:40:02 -07:00
bors 19e0ddbb9f Auto merge of #61212 - alexcrichton:skip-rustc, r=pietroalbini
ci: Attempt to skip a full rustc compile on dist*

Currently when we're preparing cross-compiled compilers it can take
quite some time because we have to build the compiler itself three
different times. The first is the normal bootstrap, the second is a
second build for the build platform, and the third is the actual target
architecture compiler. The second compiler was historically built
exclusively for procedural macros, and long ago we didn't actually need
it.

This commit tries out avoiding that second compiled compiler, meaning we
only compile rustc for the build platform only once. Some local testing
shows that this is promising, but bors is of course the ultimate test!
2019-05-30 00:38:51 +00:00
Alex Crichton ad52c77a46 ci: Attempt to skip a full rustc compile on dist*
Currently when we're preparing cross-compiled compilers it can take
quite some time because we have to build the compiler itself three
different times. The first is the normal bootstrap, the second is a
second build for the build platform, and the third is the actual target
architecture compiler. The second compiler was historically built
exclusively for procedural macros, and long ago we didn't actually need
it.

This commit tries out avoiding that second compiled compiler, meaning we
only compile rustc for the build platform only once. Some local testing
shows that this is promising, but bors is of course the ultimate test!
2019-05-26 07:39:14 -07:00
ljedrz 2f3533b758 Add clippy and fix commands to x.py 2019-05-25 15:30:16 +02:00
Vadim Petrochenkov 28405cabd5 rustbuild: Simplify debuginfo configuration 2019-05-24 11:49:30 +03:00
Andy Russell b2f71fb540
remove unneeded `extern crate`s from build tools 2019-05-09 12:03:13 -04:00
Michael Woerister c95f5e31c7 bootstrap: Don't add LLVM's bin directory to the PATH for tool invocations. 2019-04-29 14:55:29 +02:00
Josh Stone 49b65e683d Don't ignore git for LLVM info 2019-03-30 11:14:02 -07:00
bors 33b3b136c5 Auto merge of #58897 - Mark-Simulacrum:tool-rework, r=alexcrichton
Rework how bootstrap tools are built

This makes bootstrap tools buildable and testable in stage 0 with the downloaded bootstrap compiler, futhermore, it makes it such that they cannot be built in any other stage.

Notably, this will also mean that compiletest may need to wait a cycle before it can use changes to `libtest`, as it no longer depends on the in-tree libtest.
2019-03-20 23:02:17 +00:00
bjorn3 0e0488fa53 Fix formatting 2019-03-16 10:54:38 +01:00
bjorn3 1c7d368ebe [bootstrap] Remove llvm.enabled config 2019-03-16 10:54:38 +01:00
John Kåre Alsaker f2ef283b72 Make Cargo a rustc tool again 2019-03-06 18:48:08 +01:00
John Kåre Alsaker e501a87e89 Bootstrap changes 2019-03-05 00:36:24 +01:00
Mark Rousskov 03718ed67a Permit getting stage 0 rustdoc
This allows us to e.g. test compiletest, including doctests, in stage 0
without building a fresh compiler and rustdoc.
2019-03-03 16:32:57 -07:00
Mark Rousskov 9efc93c96d Tools built by the bootstrap compiler must be built by it
This avoids building compilers that we don't need -- most tools will work
just fine with the downloaded compiler.
2019-03-03 16:32:57 -07:00
Taiki Endo 6343d6bc0d bootstrap: deny(rust_2018_idioms) 2019-02-25 19:30:32 +09:00
bors c005afcb1e Auto merge of #58238 - Mark-Simulacrum:doctest-fix, r=alexcrichton
Fixes rustdoc in stage 0, stage 1

When a request for rustdoc is passed for stage 0, x.py build --stage 0
src/tools/rustdoc or ensure(tool::Rustdoc { .. }) with top_stage = 0, we
return the rustdoc for that compiler (i.e., the beta rustdoc).

This fixes stage 0 of https://github.com/rust-lang/rust/issues/52186 as well as being part of general workflow improvements (making stage 0 testing for std work) for rustbuild.

The stage 1 fix (second commit) completely resolves the problem, so this fixes https://github.com/rust-lang/rust/issues/52186.
2019-02-13 10:27:50 +00:00
Mark Rousskov bb23b175e9 This fixes doctests in stage 1
The RUSTDOC_LIBDIR should be rustc_libdir, not sysroot_libdir; rustdoc
is like the compiler and should link against rustc's libdir.

Some people currently (i.e., in general, may not be on master) have doc
tests working, but no attempt to determine why has been attempted.
2019-02-11 06:28:36 -07:00
Mark Rousskov 861d007da3 Never build rustdoc in stage 0
When a request for rustdoc is passed for stage 0, x.py build --stage 0
src/tools/rustdoc or ensure(tool::Rustdoc { .. }) with top_stage = 0, we
return the rustdoc for that compiler (i.e., the beta rustdoc).
2019-02-11 06:23:47 -07:00
Alexander Regueiro c3e182cf43 rustc: doc comments 2019-02-10 23:42:32 +00:00
Michael Woerister 9c29517af9 bootstrap: Make LLD available to run-make tests. 2019-01-30 16:21:43 +01:00
Oliver Scherer f8033a2923 fixup 2019-01-08 15:21:06 +01:00
Oliver Scherer 83530120ea Prepare everything for distributing miri via rustup 2019-01-08 15:21:06 +01:00
Alex Crichton ea7fef1ccf bootstrap: Link LLVM as a dylib with ThinLTO
When building a distributed compiler on Linux where we use ThinLTO to
create the LLVM shared object this commit switches the compiler to
dynamically linking that LLVM artifact instead of statically linking to
LLVM. The primary goal here is to reduce CI compile times, avoiding two+
ThinLTO builds of all of LLVM. By linking dynamically to LLVM we'll
reuse the one ThinLTO step done by LLVM's build itself.

Lots of discussion about this change can be found [here] and down. A
perf run will show whether this is worth it or not!

[here]: https://github.com/rust-lang/rust/pull/53245#issuecomment-417015334
2019-01-02 11:33:38 -08:00
Eric Huss 5739364784 Update cargo, rls, miri 2018-12-28 17:23:01 -08:00
Mark Rousskov 2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
kennytm 07f5dbc490
Revert "Rollup merge of #56944 - alexcrichton:less-thin2, r=michaelwoerister"
This reverts commit f1051b574c, reversing
changes made to 833e0b3b8a.
2018-12-25 13:25:57 +08:00
Alex Crichton bd18a9295c bootstrap: Link LLVM as a dylib with ThinLTO
When building a distributed compiler on Linux where we use ThinLTO to
create the LLVM shared object this commit switches the compiler to
dynamically linking that LLVM artifact instead of statically linking to
LLVM. The primary goal here is to reduce CI compile times, avoiding two+
ThinLTO builds of all of LLVM. By linking dynamically to LLVM we'll
reuse the one ThinLTO step done by LLVM's build itself.

Lots of discussion about this change can be found [here] and down. A
perf run will show whether this is worth it or not!

[here]: https://github.com/rust-lang/rust/pull/53245#issuecomment-417015334
2018-12-17 21:13:32 -08:00
ljedrz a5a3da541b bootstrap: fix edition 2018-12-10 13:59:28 +01:00
Alexander Regueiro ee89c088b0 Various minor/cosmetic improvements to code 2018-12-07 23:53:34 +00:00
Eduard-Mihai Burtescu e281446261 Try to make top-level Cargo.toml work without __CARGO_TEST_ROOT. 2018-11-25 23:13:58 +02:00
Eduard-Mihai Burtescu 7c166f54b2 Move Cargo.{toml,lock} to the repository root directory. 2018-11-22 12:10:04 +02:00
Oliver Scherer 33efce1c2f Forward rust version number to tools
Clippy uses it to identify the correct documentation to point to
2018-11-21 14:53:10 +01:00
Matthias Krüger 54edf32143 bootstrap: clean up a few clippy findings
remove useless format!()s
remove redundant field names in a few struct initializations
pass slice instead of a vector to a function
use is_empty() instead of comparisons to .len()

No functional change intended.
2018-10-26 16:25:55 +02:00
Alex Crichton 4f661c016f Update Cargo, build curl/OpenSSL statically via features
In addition to to updating Cargo's submodule and Cargo's dependencies,
this also updates Cargo's build to build OpenSSL statically into Cargo
as well as libcurl unconditionally. This removes OpenSSL build logic
from the bootstrap code, and otherwise requests that even on OSX we
build curl statically.
2018-10-20 18:47:01 -07:00
Collins Abitekaniza e792d1d96a remove struct CleanTools 2018-09-12 13:31:53 -06:00
Collins Abitekaniza c0af0b0213 clear_if_dirty in Builder::cargo with passed mode 2018-09-12 13:31:47 -06:00
Michael Woerister 45497e32cc bootstrap: Allow for building LLVM with ThinLTO. 2018-08-20 11:37:32 +02:00
Eduard-Mihai Burtescu 14aed81d9a Use the new Entry::or_default method where possible. 2018-08-18 20:19:45 +03:00
Alex Crichton 0e034d162a Update Cargo submodule
Bring in some fixes for `cargo fix` notably
2018-08-02 18:09:19 -07:00
Tatsuyuki Ishi 62f73dc87c Refactor is_external_tool into source_type 2018-07-26 12:36:58 +09:00
Tatsuyuki Ishi 1075ced5bc Discriminate between external and optional tools 2018-07-25 10:25:29 +09:00
Tatsuyuki Ishi e098985939 Deny bare_trait_objects globally 2018-07-25 10:25:29 +09:00
Mark Rousskov ab0092e0d4 Run the error index tool against the sysroot libdir
Previously when building the error index tool in stage 0 we would
attempt to use stage 0 libraries, but because it depends on rustdoc,
those don't exist: rustdoc is built against stage 1 libraries.

This patch aligns those two and passes the stage 1 libdir to the error
index.
2018-07-21 15:19:39 -06:00