about summary refs log tree commit diff
path: root/src/bootstrap/tool.rs
AgeCommit message (Collapse)AuthorLines
2021-02-08Absolute bare minimum for downloading rustc from CIJoshua Nelson-0/+1
- Use the same compiler for stage0 and stage1. This should be fixed at some point (so bootstrap isn't constantly rebuilt). - Make sure `x.py build` and `x.py check` work. - Use `git merge-base` to determine the most recent commit to download. - Copy stage0 to the various sysroots in `Sysroot`, and delegate to Sysroot in Assemble. Leave all other code unchanged. - Rename date -> key This can also be a commit hash, so 'date' is no longer a good name. - Add the commented-out option to config.toml.example - Disable all steps by default when `download-rustc` is enabled Most steps don't make sense when downloading a compiler, because they'll be pre-built in the sysroot. Only enable the ones that might be useful, in particular Rustdoc and all `check` steps. At some point, this should probably enable other tools, but rustdoc is enough to test out `download-rustc`. - Don't print 'Skipping' twice in a row Bootstrap forcibly enables a dry run if it isn't already set, so previously it would print the message twice: ``` Skipping bootstrap::compile::Std because it is not enabled for `download-rustc` Skipping bootstrap::compile::Std because it is not enabled for `download-rustc` ``` Now it correctly only prints once. ## Future work - Add FIXME about supporting beta commits - Debug logging will never work. This should be fixed.
2021-01-31rustbuild: Don't build compiler twice for error-index-generator.Eric Huss-3/+17
2021-01-19No longer require unstable for jsondocck, only build it for json testsRune Tynan-1/+1
2021-01-19Add jsondocck tool, and use it for rustdoc JSONRune Tynan-0/+1
2020-12-18Update cargoEric Huss-2/+35
2020-09-22Auto merge of #76799 - Mark-Simulacrum:fix-cross-compile-dist, r=alexcrichtonbors-1/+5
Fix cross compiling dist/build invocations I am uncertain why the first commit is not affecting CI. I suspect it's because we pass --disable-docs on most of our cross-compilation builders. The second commit doesn't affect CI because CI runs x.py dist, not x.py build. Both commits are standalone; together they should resolve #76733. The first commit doesn't really fix that issue but rather just fixes cross-compiled x.py dist, resolving a bug introduced in #76549.
2020-09-20Provide bootstrap tools with RUSTC in environmentMark Rousskov-0/+4
2020-09-18bootstrap: move the version number to a plaintext filePietro Albini-2/+1
The Rust version number is currently embedded in bootstrap's source code, which makes it hard to update it automatically or access it outside of ./x.py (as you'd have to parse the source code). This commit moves the version number to a standalone plaintext file, which makes accessing or updating it trivial.
2020-09-16Build rustdoc for cross-compiled targetsMark Rousskov-1/+5
This isn't an issue for most folks who use x.py dist, which will directly depend on this. But for x.py build, if we don't properly set target here rustdoc will not be built. Currently, there is not a default-on step for generating a rustc for a given target either, so we will fail to build a rustc as well.
2020-09-13Auto-generate lint documentation.Eric Huss-0/+1
2020-09-11Remove host parameter from step configurationsMark Rousskov-2/+3
rustc is a natively cross-compiling compiler, and generally none of our steps should care whether they are using a compiler built of triple A or B, just the --target directive being passed to the running compiler. e.g., when building for some target C, you don't generally want to build two stds: one with a host A compiler and the other with a host B compiler. Just one std is sufficient.
2020-09-06Make bootstrap build on stableMark Rousskov-2/+4
This is generally a good idea, and will help with being able to build bootstrap without Python over time as it means we can "just" build with cargo +beta build rather than needing the user to set environment variables. This is a minor step, but a necessary one on that road.
2020-07-19Auto merge of #74091 - richkadel:llvm-coverage-map-gen-4, r=tmandrybors-0/+1
Generating the coverage map @tmandry @wesleywiser rustc now generates the coverage map and can support (limited) coverage report generation, at the function level. Example commands to generate a coverage report: ```shell $ BUILD=$HOME/rust/build/x86_64-unknown-linux-gnu $ $BUILD/stage1/bin/rustc -Zinstrument-coverage \ $HOME/rust/src/test/run-make-fulldeps/instrument-coverage/main.rs $ LLVM_PROFILE_FILE="main.profraw" ./main called $ $BUILD/llvm/bin/llvm-profdata merge -sparse main.profraw -o main.profdata $ $BUILD/llvm/bin/llvm-cov show --instr-profile=main.profdata main ``` ![rust coverage report only 20200706](https://user-images.githubusercontent.com/3827298/86697299-1cbe8f80-bfc3-11ea-8955-451b48626991.png) r? @wesleywiser Rust compiler MCP rust-lang/compiler-team#278 Relevant issue: #34701 - Implement support for LLVMs code coverage instrumentation
2020-07-17Generating the coverage mapRich Kadel-0/+1
rustc now generates the coverage map and can support (limited) coverage report generation, at the function level. Example: $ BUILD=$HOME/rust/build/x86_64-unknown-linux-gnu $ $BUILD/stage1/bin/rustc -Zinstrument-coverage \ $HOME/rust/src/test/run-make-fulldeps/instrument-coverage/main.rs $ LLVM_PROFILE_FILE="main.profraw" ./main called $ $BUILD/llvm/bin/llvm-profdata merge -sparse main.profraw -o main.profdata $ $BUILD/llvm/bin/llvm-cov show --instr-profile=main.profdata main 1| 1|pub fn will_be_called() { 2| 1| println!("called"); 3| 1|} 4| | 5| 0|pub fn will_not_be_called() { 6| 0| println!("should not have been called"); 7| 0|} 8| | 9| 1|fn main() { 10| 1| let less = 1; 11| 1| let more = 100; 12| 1| 13| 1| if less < more { 14| 1| will_be_called(); 15| 1| } else { 16| 1| will_not_be_called(); 17| 1| } 18| 1|}
2020-07-17Teach bootstrap about target files vs target triplesJake Goulding-13/+13
`rustc` allows passing in predefined target triples as well as JSON target specification files. This change allows bootstrap to have the first inkling about those differences. This allows building a cross-compiler for an out-of-tree architecture (even though that compiler won't work for other reasons). Even if no one ever uses this functionality, I think the newtype around the `Interned<String>` improves the readability of the code.
2020-07-03Add rust-analyzer submoduleAleksey Kladov-1/+2
The current plan is that submodule tracks the `release` branch of rust-analyzer, which is updated once a week. rust-analyzer is a workspace (with a virtual manifest), the actual binary is provide by `crates/rust-analyzer` package. Note that we intentionally don't add rust-analyzer to `Kind::Test`, for two reasons. *First*, at the moment rust-analyzer's test suite does a couple of things which might not work in the context of rust repository. For example, it shells out directly to `rustup` and `rustfmt`. So, making this work requires non-trivial efforts. *Second*, it seems unlikely that running tests in rust-lang/rust repo would provide any additional guarantees. rust-analyzer builds with stable and does not depend on the specifics of the compiler, so changes to compiler can't break ra, unless they break stability guarantee. Additionally, rust-analyzer itself is gated on bors, so we are pretty confident that test suite passes.
2020-07-01Tests for number of times rustdoc is built with x.py test and doc.Eric Huss-2/+2
2020-06-29Compile rustdoc less often.Eric Huss-3/+3
2020-06-26Remove mdbook-linkcheck.Eric Huss-17/+2
2020-06-25Support configurable deny-warnings for all in-tree crates.Eric Huss-9/+10
2020-06-17Add src/librustdoc as an alias for src/tools/rustdocJoshua Nelson-1/+1
No one actually works with src/tools/librustdoc, it's almost empty.
2020-06-12x.py: do not build Miri by defaultRalf Jung-12/+18
2020-06-01bump Miri, update for cargo-miri being a separate projectRalf Jung-1/+3
2020-05-28Set CFG_RELEASE for tools in bootstrap/tool.rsIgor Matuszewski-0/+4
Since rustc-ap-* v659 we now need to set CFG_RELEASE for rustc-ap-rustc_attr for `#[cfg(version(...))]` to work. Co-authored-by: Eric Huss <ehuss@users.noreply.github.com>
2020-05-02Gate on clippy on CIOliver Scherer-4/+2
2020-04-20Do not build tools if user do not want themMateusz Mikuła-1/+9
2020-03-24ci: add github actions configurationPietro Albini-0/+1
2020-03-18Rename add_lib_path to add_dylib_pathJosh Stone-3/+3
2020-02-03bootstrap: fix clippy warningsMatthias Krüger-1/+1
2020-01-08Build compiletest with in-tree libtestJosh Stone-2/+8
2020-01-08Remove obsolete llvm_tools flagJosh Stone-11/+1
2019-12-22Format the worldMark Rousskov-101/+102
2019-10-28Use rustc-workspace-hack for rustbookSamuel Holland-0/+1
As rustbook now depends transitively on openssl, it needs access to the rustc-workspace-hack/all-static feature to pick up openssl-sys/vendored. This fixes the rust build with `all-static = true` on systems where openssl is not installed (e.g. when cross-compiling).
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.