about summary refs log tree commit diff
path: root/src/bootstrap/tool.rs
AgeCommit message (Collapse)AuthorLines
2019-09-23Move handling of `-Cprefer-dynamic` into `builder.rs`Alex Crichton-4/+0
This logic is *super* old and can be tweaked and moved into `builder.rs`
2019-09-23Allow adding `RUSTFLAGS` after `Builder::cargo`Alex Crichton-6/+6
This commit changes the return type of `Builder::cargo` to return a builder that allows dynamically adding more `RUSTFLAGS` values after-the-fact. While not used yet, this will later be used to delete more of `rustc.rs`
2019-08-23bootstrap: Merge the libtest build step with libstdAlex Crichton-36/+3
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-09Check links on all platforms when running locallyMateusz Mikuła-3/+23
2019-07-15ci: Remove Travis/AppVeyor configurationAlex Crichton-2/+0
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-12rustbuild: Improve assert about building tools onceAlex Crichton-21/+48
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-06-13Inline prepare_tool_cmdMark Rousskov-15/+7
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-13Delete unnecessary commandMark Rousskov-7/+3
2019-06-05rustbuild: Include `rustfmt` in deduplicated dependenciesAlex Crichton-0/+1
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-05-30Auto merge of #61212 - alexcrichton:skip-rustc, r=pietroalbinibors-15/+15
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-26ci: Attempt to skip a full rustc compile on dist*Alex Crichton-15/+15
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-25Add clippy and fix commands to x.pyljedrz-1/+1
2019-05-24rustbuild: Simplify debuginfo configurationVadim Petrochenkov-4/+0
2019-05-09remove unneeded `extern crate`s from build toolsAndy Russell-0/+2
2019-04-29bootstrap: Don't add LLVM's bin directory to the PATH for tool invocations.Michael Woerister-51/+0
2019-03-30Don't ignore git for LLVM infoJosh Stone-1/+1
2019-03-20Auto merge of #58897 - Mark-Simulacrum:tool-rework, r=alexcrichtonbors-39/+73
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-16Fix formattingbjorn3-1/+1
2019-03-16[bootstrap] Remove llvm.enabled configbjorn3-2/+2
2019-03-06Make Cargo a rustc tool againJohn Kåre Alsaker-1/+1
2019-03-05Bootstrap changesJohn Kåre Alsaker-2/+3
2019-03-03Permit getting stage 0 rustdocMark Rousskov-3/+5
This allows us to e.g. test compiletest, including doctests, in stage 0 without building a fresh compiler and rustdoc.
2019-03-03Tools built by the bootstrap compiler must be built by itMark Rousskov-36/+68
This avoids building compilers that we don't need -- most tools will work just fine with the downloaded compiler.
2019-02-25bootstrap: deny(rust_2018_idioms)Taiki Endo-18/+18
2019-02-13Auto merge of #58238 - Mark-Simulacrum:doctest-fix, r=alexcrichtonbors-18/+18
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-11This fixes doctests in stage 1Mark Rousskov-18/+12
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-11Never build rustdoc in stage 0Mark Rousskov-0/+6
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-10rustc: doc commentsAlexander Regueiro-2/+2
2019-01-30bootstrap: Make LLD available to run-make tests.Michael Woerister-14/+27
2019-01-08fixupOliver Scherer-1/+3
2019-01-08Prepare everything for distributing miri via rustupOliver Scherer-0/+8
2019-01-02bootstrap: Link LLVM as a dylib with ThinLTOAlex Crichton-1/+1
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-28Update cargo, rls, miriEric Huss-1/+1
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-25Revert "Rollup merge of #56944 - alexcrichton:less-thin2, r=michaelwoerister"kennytm-1/+1
This reverts commit f1051b574c26e20608ff26415a3dddd13f140925, reversing changes made to 833e0b3b8a9f1487a61152ca76f7f74a6b32cc0c.
2018-12-17bootstrap: Link LLVM as a dylib with ThinLTOAlex Crichton-1/+1
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-10bootstrap: fix editionljedrz-10/+10
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-1/+1
2018-11-25Try to make top-level Cargo.toml work without __CARGO_TEST_ROOT.Eduard-Mihai Burtescu-18/+2
2018-11-22Move Cargo.{toml,lock} to the repository root directory.Eduard-Mihai Burtescu-4/+24
2018-11-21Forward rust version number to toolsOliver Scherer-0/+2
Clippy uses it to identify the correct documentation to point to
2018-10-26bootstrap: clean up a few clippy findingsMatthias Krüger-4/+4
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-20Update Cargo, build curl/OpenSSL statically via featuresAlex Crichton-11/+16
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-09-12remove struct CleanToolsCollins Abitekaniza-27/+0
2018-09-12clear_if_dirty in Builder::cargo with passed modeCollins Abitekaniza-25/+2
2018-08-20bootstrap: Allow for building LLVM with ThinLTO.Michael Woerister-1/+1
2018-08-18Use the new Entry::or_default method where possible.Eduard-Mihai Burtescu-1/+1
2018-08-02Update Cargo submoduleAlex Crichton-0/+4
Bring in some fixes for `cargo fix` notably
2018-07-26Refactor is_external_tool into source_typeTatsuyuki Ishi-11/+21
2018-07-25Discriminate between external and optional toolsTatsuyuki Ishi-13/+20