about summary refs log tree commit diff
path: root/src/bootstrap/builder.rs
AgeCommit message (Collapse)AuthorLines
2020-09-16Auto merge of #76625 - jyn514:default-stages, r=Mark-Simulacrumbors-29/+2
Make the default stage for x.py configurable This also allows configuring each sub-command individually. Possibly #76617 should land before this? I don't feel strongly either way, I don't mind waiting. Closes https://github.com/rust-lang/rust/issues/76165. r? `@Mark-Simulacrum`
2020-09-15Make the default stage for x.py configurableJoshua Nelson-29/+2
This allows configuring the default stage for each sub-command individually. - Normalize the stage as early as possible, so there's no confusion about which to use. - Don't add an explicit `stage` option in config.toml This offers no more flexibility than `*_stage` and makes it confusing which takes precedence. - Always give `--stage N` precedence over config.toml - Fix bootstrap tests This changes the tests to go through `Config::parse` so that they test the actual defaults, not the dummy ones provided by `default_opts`. To make this workable (and independent of the environment), it does not read `config.toml` for tests.
2020-09-15Avoid printing dry run timingsMark Rousskov-1/+1
2020-09-14Fix generating rustc docs with non-default lib directory.Eric Huss-2/+6
2020-09-12Auto merge of #76639 - Mark-Simulacrum:ci-hosts, r=pietroalbinibors-1/+1
Add host triples to CI builders This is a follow-up to #76415, which changed how x.py interprets cross-compilation target/host flags. This should fix the known cases, but I'm still working through CI logs before/after that PR to identify if anything else is missing.
2020-09-12Print all step timingsMark Rousskov-1/+1
It is really painful to inspect differences in what was built in CI if things are appearing and disappearing randomly as they hover around the 100ms mark. No matter what we choose there's always going to be quite a bit of variability on CI in timing, so we're going to see things appear and vanish.
2020-09-11Remove host parameter from step configurationsMark Rousskov-12/+9
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-10Auto merge of #76378 - petrochenkov:lldtest, r=Mark-Simulacrumbors-6/+11
rustbuild: Build tests with LLD if `use-lld = true` was passed Addresses https://github.com/rust-lang/rust/pull/76127#discussion_r479932392. Our test suite is generally ready to run with an explicitly specified linker (https://github.com/rust-lang/rust/pull/45191), so LLD specified with `use-lld = true` works as well. Only 4 tests fail (on `x86_64-pc-windows-msvc`): ``` ui/panic-runtime/lto-unwind.rs run-make-fulldeps/debug-assertions run-make-fulldeps/foreign-exceptions run-make-fulldeps/test-harness ``` All of them are legitimate issues with LLD (or at least with combination Rust+LLD) and manifest in segfaults on access to TLS (https://github.com/rust-lang/rust/pull/76127#issuecomment-683473325). UPD: These issues are caused by https://github.com/rust-lang/rust/issues/72145 and appear because I had `-Ctarget-cpu=native` set. UPD: Further commits build tests with LLD for non-MSVC targets and propagate LLD to more places when `use-lld` is enabled.
2020-09-09Move `rustllvm` into `rustc_llvm`Vadim Petrochenkov-3/+3
2020-09-09Rollup merge of #76379 - petrochenkov:nodegen, r=Mark-SimulacrumDylan DPC-5/+5
rustbuild: Remove `Mode::Codegen` It's no longer used.
2020-09-07Dedicated rust development tarballMark Rousskov-0/+1
This currently includes libLLVM, llvm-config, and FileCheck, but will perhaps expand to more tooling overtime. It should be considered entirely unstable and may change at any time.
2020-09-07rustbuild: Deduplicate LLD checks slightlyVadim Petrochenkov-4/+3
2020-09-07rustbuild: Propagate LLD to more places when `use-lld` is enabledVadim Petrochenkov-1/+7
2020-09-07rustbuild: Build tests with LLD if `use-lld = true` was passedVadim Petrochenkov-3/+3
2020-09-05rustbuild: Remove `Mode::Codegen`Vadim Petrochenkov-5/+5
2020-09-04There isn't a way to pass --remove yet, but you can rm if u likeCassandra Fridkin-1/+1
2020-09-03Check test/example/benchmark on x.py checkMark Rousskov-1/+1
Often when modifying compiler code you'll miss that you've changed an API used by unit tests, since x.py check didn't previously catch that. It's also useful to have this for editing with rust-analyzer and similar tooling where editing tests previously didn't notify you of errors in test files.
2020-08-31rustbuild: Remove one LLD workaroundVadim Petrochenkov-6/+2
2020-08-29Allow --bess ing expect-tests in toolsAleksey Kladov-0/+5
See #75773 and #75775
2020-08-16Auto merge of #75472 - Mark-Simulacrum:mangling-config, r=eddybbors-0/+4
Add option to use the new symbol mangling in rustc/std I don't know if this causes problems in some cases -- maybe it should be on by default for at least rustc. I've never encountered problems with it other than tools not supporting it, though. cc @nnethercote r? @eddyb
2020-08-14Deal with spaces in the rust version.Eric Huss-3/+7
2020-08-14Fix crate-version with rustdoc in bootstrap.Eric Huss-2/+1
2020-08-12Add option to use the new symbol mangling in rustc/stdMark Rousskov-0/+4
2020-08-12Add a script to verify the Platform Support page is up-to-date.Eric Huss-0/+1
2020-08-03Make rust.use-lld config option work with non MSVC targetsMateusz MikuĊ‚a-1/+6
2020-07-27Use exhaustive match for assertJoshua Nelson-1/+1
2020-07-27Add assert that tests happen with stage 2 in CIJoshua Nelson-1/+15
- Use stage 2 for makefile - Move assert to builder - Don't add an assert for --help - Allow --stage 0 if passed explicitly - Don't assert defaults during tests Otherwise it's impossible to test the defaults!
2020-07-27Fix most bootstrap testsJoshua Nelson-1/+1
Uses --stage 2 for all the existing tests
2020-07-27Make the default stage dependent on the subcommandJoshua Nelson-1/+14
### x.py build/test: stage 1 I've seen very few people who actually use full stage 2 builds on purpose. These compile rustc and libstd twice and don't give you much more information than a stage 1 build (except in rare cases like https://github.com/rust-lang/rust/pull/68692#discussion_r376392145). For new contributors, this makes the build process even more daunting than it already is. As long as CI is changed to use `--stage 2` I see no downside here. ### x.py bench/dist/install: stage 2 These commands have to do with a finished, optimized version of rustc. It seems very rare to want to use these with a stage 1 build. ### x.py doc: stage 0 Normally when you document things you're just fixing a typo. In this case there is no need to build the whole rust compiler, since the documentation will usually be the same when generated with the beta compiler or with stage 1. Note that for this release cycle only there will be a significant different between stage0 and stage1 docs: https://github.com/rust-lang/rust/pull/73101. However most of the time this will not be the case.
2020-07-27Don't duplicate builder codeJoshua Nelson-19/+14
- Add Builder::new_internal
2020-07-22Rollup merge of #73893 - ajpaverd:cfguard-stabilize, r=nikomatsakisManish Goregaokar-1/+1
Stabilize control-flow-guard codegen option This is the stabilization PR discussed in #68793. It converts the `-Z control-flow-guard` debugging option into a codegen option (`-C control-flow-guard`), and changes the associated tests.
2020-07-19Do not clobber RUSTDOCFLAGSMark Rousskov-0/+7
We were setting these in both Builder::cargo and here, which ended up only setting the first of the two.
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-17Rollup merge of #74251 - shepmaster:bootstrap-target-files, r=Mark-SimulacrumManish Goregaokar-31/+30
Teach bootstrap about target files vs target triples `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-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-31/+30
`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-16Set "invalid_codeblock_attributes" lint to warning level by defaultGuillaume Gomez-2/+3
2020-07-16Update code to new invalid_codeblock_attributes lint nameGuillaume Gomez-2/+2
2020-07-16Apply review commentsGuillaume Gomez-3/+6
2020-07-16Enforce even more the code blocks attributes check through rustdocGuillaume Gomez-2/+5
2020-07-14Use local links in the alloc docs.Eric Huss-1/+2
2020-07-14Stabilize control-flow-guard codegen optionAndrew Paverd-1/+1
2020-07-04Fix caching issue when building tools.Eric Huss-4/+14
2020-07-03Add rust-analyzer submoduleAleksey Kladov-0/+3
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-01Rollup merge of #73929 - kraai:fix-comment-typo, r=jonas-schievinkManish Goregaokar-1/+1
Fix comment typo
2020-07-01Fix comment typoKRAAI, MATTHEW [VISUS]-1/+1
2020-06-29rustbuild: Move compiler-builtins build logic to manifestAlex Crichton-8/+8
This commit moves the compiler-builtins-specific build logic from `src/bootstrap/bin/rustc.rs` into the workspace `Cargo.toml`'s `[profile]` configuration. Now that rust-lang/cargo#7253 is fixed we can ensure that Cargo knows about debug assertions settings, and it can also be configured to specifically disable debug assertions unconditionally for compiler-builtins. This should improve rebuild logic when debug-assertions settings change and also improve build-std integration where Cargo externally now has an avenue to learn how to build compiler-builtins as well.
2020-06-25Support configurable deny-warnings for all in-tree crates.Eric Huss-2/+3
2020-06-20Rollup merge of #73404 - ajpaverd:cfguard_syntax, r=Mark-SimulacrumRalf Jung-2/+2
Update CFGuard syntax Update the naming and syntax of the control-flow-guard option, as discussed in #68793. r? @Mark-Simulacrum
2020-06-19Rollup merge of #73352 - ehuss:bootstrap-metadata, r=Mark-SimulacrumRalf Jung-11/+41
Speed up bootstrap a little. The bootstrap script was calling `cargo metadata` 3 times (or 6 with `-v`). This is a very expensive operation, and this attempts to avoid the extra calls. On my system, a simple command like `./x.py test -h -v` goes from about 3 seconds to 0.4. An overview of the changes: - Call `cargo metadata` only once with `--no-deps`. Optional dependencies are filtered in `in_tree_crates` (handling `profiler_builtins` and `rustc_codegen_llvm` which are driven by the config). - Remove a duplicate call to `metadata::build` when using `-v`. I'm not sure why it was there, it looks like a mistake or vestigial from previous behavior. - Remove check for `_shim`, I believe all the `_shim` crates are now gone. - Remove check for `rustc_` and `*san` for `test::Crate::should_run`, these are no longer dependencies in the `test` tree. - Use relative paths in `./x.py test -h -v` output. - Some code cleanup (remove unnecessary `find_compiler_crates`, etc.). - Show suite paths (`src/test/ui/...`) in `./x.py test -h -v` output. - Some doc comments.