about summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2021-05-24Bootstrap: skip rustdoc fingerprint for building docs.Eric Huss-0/+3
2021-05-23Auto merge of #81601 - jyn514:llvm-on-demand, r=Mark-Simulacrumbors-13/+97
Move llvm submodule updates to rustbuild This enables better caching, since LLVM is only updated when needed, not whenever x.py is run. Before, bootstrap.py had to use heuristics to guess if LLVM would be needed, and updated the module more often than necessary as a result. This syncs the LLVM submodule only just before building the compiler, so people working on the standard library never have to worry about it. Example output: ``` Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu) Updating submodule src/llvm-project Submodule 'src/llvm-project' (https://github.com/rust-lang/llvm-project.git) registered for path 'src/llvm-project' Submodule path 'src/llvm-project': checked out 'f9a8d70b6e0365ac2172ca6b7f1de0341297458d' ``` Implements https://github.com/rust-lang/rust/issues/76653#issuecomment-770265169. This could be easily extended to other submodules, like `rust-by-example` and `rustc-dev-guide`, which aren't needed for cargo's workspace resolution.
2021-05-22Move llvm submodule updates to rustbuildJoshua Nelson-13/+97
This enables better caching, since LLVM is only updated when needed, not whenever x.py is run. Before, bootstrap.py had to use heuristics to guess if LLVM would be needed, and updated the module more often than necessary as a result. This syncs the LLVM submodule only just before building the compiler, so people working on the standard library never have to worry about it. Example output: ``` Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu) Updating submodule src/llvm-project Submodule 'src/llvm-project' (https://github.com/rust-lang/llvm-project.git) registered for path 'src/llvm-project' Submodule path 'src/llvm-project': checked out 'f9a8d70b6e0365ac2172ca6b7f1de0341297458d' ``` - Don't try to update the LLVM submodule when using system LLVM Previously, this would try to update LLVM unconditionally. Now the submodule is only initialized if `llvm-config` is not set. - Don't update LLVM submodule in dry runs This prevents the following test failures: ``` running 17 tests fatal: invalid gitfile format: /checkout/src/llvm-project/.git test builder::tests::defaults::build_cross_compile ... FAILED ---- builder::tests::defaults::build_default stdout ---- thread 'main' panicked at 'command did not execute successfully: "git" "rev-parse" "HEAD" expected success, got: exit code: 128', src/build_helper/lib.rs:139:9 ``` - Try running git without --progress if it fails the first time This avoids having to do version detection to see if --progress is supported or not. - Don't try to update submodules when the source repository isn't managed by git - Update LLVM submodules that have already been checked out - Only check for whether the submodule should be updated in lib.rs; update it unconditionally in native.rs
2021-05-21facepalm: operator precedence fail on my part.Felix S. Klock II-1/+1
This bug was only visible on mac. Also, print_step_rusage is a relatively new internal feature, that is not heavily used, and has no tests. All of these factors contributed to how this went uncaught this long. Thanks to Josh Triplett for pointing it out!
2021-05-20Rollup merge of #85326 - infinity0:fix-cross-compile-tools, r=Mark-SimulacrumGuillaume Gomez-1/+4
bootstrap: ensure host std when cross-compiling tools, fixes #85320
2021-05-18Rollup merge of #85297 - infinity0:master, r=Mark-SimulacrumJack Huey-1/+8
bootstrap: build cargo only if requested in tools In Debian we'd like to build rustfmt and clippy alongside rustc, but we're still excluding cargo from the rustc build and doing that separately. This patch makes that possible.
2021-05-17Don't require cmake on Windows when LLVM isn't being builtJoshua Nelson-2/+3
Previously, setting `download-ci-llvm = true` when cmake wasn't installed would give the following error: ``` failed to execute command: "cmake" "--help" error: The system cannot find the file specified. (os error 2) ```
2021-05-15Auto merge of #85335 - GuillaumeGomez:rollup-0tvc14g, r=GuillaumeGomezbors-9/+22
Rollup of 4 pull requests Successful merges: - #84751 (str::is_char_boundary - slight optimization) - #85185 (Generate not more docs than necessary) - #85324 (Warn about unused `pub` fields in non-`pub` structs) - #85329 (fix version_str comment) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-05-15Rollup merge of #85185 - ↵Guillaume Gomez-9/+22
GuillaumeGomez:generate-not-more-docs-than-necessary, r=Mark-Simulacrum Generate not more docs than necessary This is something that `@Nemo157` was talking about: they wanted that when using `x.py doc std`, it only generated `std` (and the crates "before" it). r? `@Mark-Simulacrum`
2021-05-15Don't generate more docs than necessaryGuillaume Gomez-9/+22
2021-05-15bootstrap: ensure host std when cross-compiling tools, fixes #85320Ximin Luo-1/+4
2021-05-14Don't copy tool dependencies to the sysrootJoshua Nelson-4/+0
This fixes the following error: ``` error: found crates (`serde_derive` and `serde_derive`) with colliding StableCrateId values. --> /home/joshua/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/cargo_metadata-0.8.2/src/lib.rs:162:1 | 162 | extern crate serde_derive; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ``` This is a bug in resolve (https://github.com/rust-lang/rust/issues/56935) but it will be difficult to fix in the near future. This works around it in the meantime by not copying serde_derive and other dependencies to the sysroot when they're built for other tools. This rebuilds the dependencies slightly more often than necessary, but avoids the crate conflicts. This can be reverted once #56935 is fixed.
2021-05-14Update bootstrap for in-tree rustfmtJoshua Nelson-20/+12
- Add rustfmt to `x.py check` - Update Cargo.lock - Remove rustfmt from the toolstate list - Make rustfmt an in-tree tool - Give an error on `x.py test rustfmt` if rustfmt fails to build or if tests fail - Don't call `save_toolstate` when testing rustfmt
2021-05-14bootstrap: build cargo only if requested in toolsXimin Luo-1/+8
2021-05-14Auto merge of #85190 - mati865:update-cc, r=Mark-Simulacrumbors-1/+1
Update cc crate To pull in this fix: https://github.com/alexcrichton/cc-rs/commit/801a87bf2f31ad1ad8bd7e8fa4f5a52b0e2b4c00
2021-05-12update cc crateMateusz Mikuła-1/+1
To pull in this fix: https://github.com/alexcrichton/cc-rs/commit/801a87bf2f31ad1ad8bd7e8fa4f5a52b0e2b4c00
2021-05-12Rollup merge of #85191 - GuillaumeGomez:improve-rustdoc-gui-tester, ↵Yuki Okushi-6/+19
r=Mark-Simulacrum Improve rustdoc gui tester I cherry-picked the commit from https://github.com/rust-lang/rust/pull/84834 (and modified it a bit). I also used this opportunity to update it to last version (forgot to update GUI test in https://github.com/rust-lang/rust/pull/85074, really can't wait to make https://github.com/rust-lang/rust/pull/84586 finally work). cc `@Mark-Simulacrum` for the changes in bootstrap. r? `@jsha`
2021-05-11Make rustdoc-gui test suite able to run with different sub directoriesGuillaume Gomez-3/+3
2021-05-11Move rustdoc-gui rust libraries into their own folder and prepare the field ↵Guillaume Gomez-4/+17
for more libraries
2021-05-11Enable `--show-type-layout` for the rustdoc API docsCamelid-0/+1
2021-05-11Enable `--show-type-layout` for the rustc API docsCamelid-0/+1
2021-05-11Rollup merge of #85051 - jyn514:check-miri, r=Mark-SimulacrumYuki Okushi-1/+6
Allow checking miri and RLS with `x.py check src/tools/{miri,rls}` Helps with https://github.com/rust-lang/rust/issues/80639. `@Xanewok` would you find this useful for RLS too?
2021-05-11Rollup merge of #84783 - jyn514:fmt-one, r=Mark-SimulacrumYuki Okushi-7/+19
Allow formatting specific subdirectories Fixes https://github.com/rust-lang/rust/issues/71094.
2021-05-11Rollup merge of #84777 - jyn514:rustdoc-parallel, r=Mark-SimulacrumYuki Okushi-0/+1
Apply `--cfg parallel_compiler` when documenting This also reverts commit 9823c2cc700fea541bf2670fcee93af662b63022 working around the bug. Fixes https://github.com/rust-lang/rust/issues/82301.
2021-05-08Enable `-W semicolon_in_expressions_from_macros` in bootstrapAaron Hill-7/+2
Now that stdarch has been updated, we can do this without breaking the build.
2021-05-07Allow checking miri and RLS with `x.py check src/tools/{miri,rls}`Joshua Nelson-1/+6
2021-05-07Don't stop running rustdoc-gui tests at first failureGuillaume Gomez-22/+8
2021-05-07Rollup merge of #84990 - GuillaumeGomez:sort-rustdoc-gui-tests, ↵Yuki Okushi-1/+6
r=Mark-Simulacrum Sort rustdoc-gui tests The rustdoc-gui tests were randomly run. Not really a big issue but I prefer the tests to be sorted.
2021-05-07Rollup merge of #84781 - jyn514:check-bootstrap, r=Mark-SimulacrumYuki Okushi-3/+3
Don't check bootstrap artifacts by default Bootstrap has to build successfully or this won't run, so all it checks are the tests, which are uncommon to change. Fixes https://github.com/rust-lang/rust/issues/76624.
2021-05-07Rollup merge of #84779 - jyn514:cargotest-args, r=Mark-SimulacrumYuki Okushi-0/+1
Add support for --test-args to cargotest This allows running a single test without having to wait for all tests to complete. Closes https://github.com/rust-lang/rust/issues/77260.
2021-05-07Rollup merge of #84500 - tmandry:compiletest-run-flag, r=Mark-SimulacrumDylan DPC-2/+20
Add --run flag to compiletest This controls whether run-* tests actually get run. r? ```@Mark-Simulacrum```
2021-05-06Sort rustdoc-gui testsGuillaume Gomez-1/+6
2021-05-05Rollup merge of #84865 - petrochenkov:llthread, r=Mark-SimulacrumRalf Jung-8/+15
rustbuild: Pass a `threads` flag that works to windows-gnu lld MinGW driver for COFF LLD doesn't currently translate GNU-style `--threads=N` to native `/threads:N`, so we have to pass the option in its native form to avoid an error. Also pass the `threads` flag to lld-link (windows-msvc lld) as well.
2021-05-04Auto merge of #83213 - rylev:update-lints-to-errors, r=nikomatsakisbors-0/+3
Update BARE_TRAIT_OBJECT and ELLIPSIS_INCLUSIVE_RANGE_PATTERNS to errors in Rust 2021 This addresses https://github.com/rust-lang/rust/pull/81244 by updating two lints to errors in the Rust 2021 edition. r? `@estebank`
2021-05-03rustbuild: Pass a `threads` flag that works to windows-gnu lldVadim Petrochenkov-8/+15
MinGW driver for COFF LLD doesn't currently translate GNU-style `--threads=N` to native `/threads:N`, so we have to pass the option in its native form to avoid an error. Also pass the `threads` flag to lld-link as well
2021-05-02Auto merge of #84750 - jyn514:nix-cargo, r=Mark-Simulacrumbors-5/+7
Don't download cargo twice when download-rustc is set Previously, this caused a bug on NixOS: 1. bootstrap.py would download and patch stage0/cargo 2. bootstrap.py would download nightly cargo, but extract it to stage0/cargo instead of ci-rustc/cargo. It would still try (and fail) to patch ci-rustc/cargo. 3. bootstrap.py would fail to build rustbuild because stage0/cargo wasn't patched. The "proper" fix is to extract nightly cargo to ci-rustc instead, but it doesn't seem to be necessary at all, so this just skips downloading it instead. Fixes https://github.com/rust-lang/rust/issues/84702
2021-05-01Auto merge of #84471 - jyn514:linkcheck-llvm, r=Mark-Simulacrumbors-1/+4
Allow running `x.py test --stage 2 src/tools/linkchecker` with `download-rustc = true` Previously, the LD_LIBRARY_PATH for the linkchecker looked like `build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib`, because the linkchecker depends on the master copy of the standard library. This is true, but doesn't include the library path for the compiler libraries: ``` /home/joshua/src/rust/rust/build/x86_64-unknown-linux-gnu/stage1-tools-bin/error_index_generator: error while loading shared libraries: libLLVM-12-rust-1.53.0-nightly.so: cannot open shared object file: No such file or directory ``` That file is in `build/x86_64-unknown-linux-gnu/stage1/lib/libLLVM-12-rust-1.53.0-nightly.so`, which wasn't included in the dynamic path. This adds `build/x86_64-unknown-linux-gnu/stage1/lib` to the dynamic path for the linkchecker.
2021-05-01Allow formatting specific subdirectoriesJoshua Nelson-7/+19
2021-05-01Don't check bootstrap artifacts by defaultJoshua Nelson-3/+3
Bootstrap has to build successfully or this won't run, so all it checks are the tests, which are uncommon to change.
2021-05-01Add support for --test-args to cargotestJoshua Nelson-0/+1
This allows running a single test without having to wait for all tests to complete.
2021-05-01Apply `--cfg parallel_compiler` when documentingJoshua Nelson-0/+1
This also reverts commit 9823c2cc700fea541bf2670fcee93af662b63022 working around the bug.
2021-04-30Don't download cargo twice when download-rustc is setJoshua Nelson-5/+7
Previously, this caused a bug on NixOS: 1. bootstrap.py would download and patch stage0/cargo 2. bootstrap.py would download nightly cargo, but extract it to stage0/cargo instead of ci-rustc/cargo. 3. bootstrap.py would fail to build rustbuild because stage0/cargo wasn't patched. The "proper" fix is to extract nightly cargo to ci-rustc instead, but it doesn't seem to be necessary at all, so this just skips downloading it instead.
2021-04-30Fix help for profile flagsTyler Mandry-2/+2
2021-04-30Add support for --run for non-ui testsTyler Mandry-6/+1
2021-04-30Add run flag to bootstrap testTyler Mandry-0/+23
2021-04-29Auto merge of #84189 - jyn514:clippy-dev, r=Mark-Simulacrumbors-0/+25
Implement `x.py test src/tools/clippy --bless` - Add clippy_dev to the rust workspace Before, it would give an error that it wasn't either included or excluded from the workspace: ``` error: current package believes it's in a workspace when it's not: current: /home/joshua/rustc/src/tools/clippy/clippy_dev/Cargo.toml workspace: /home/joshua/rustc/Cargo.toml this may be fixable by adding `src/tools/clippy/clippy_dev` to the `workspace.members` array of the manifest located at: /home/joshua/rustc/Cargo.toml Alternatively, to keep it out of the workspace, add the package to the `workspace.exclude` array, or add an empty `[workspace]` table to the package's manifest. ``` - Change clippy's copy of compiletest not to special-case rust-lang/rust. Using OUT_DIR confused `clippy_dev` and it couldn't find the test outputs. This is one of the reasons why `cargo dev bless` used to silently do nothing (the others were that `CARGO_TARGET_DIR` and `PROFILE` weren't set appropriately). - Run clippy_dev on test failure I tested this by removing a couple lines from a stderr file, and they were correctly replaced. - Fix clippy_dev warnings
2021-04-28Rollup merge of #84585 - jyn514:check-rustdoc, r=Mark-SimulacrumJack Huey-3/+3
Add `x.py check src/librustdoc` as an alias for `x.py check src/tools/rustdoc` I keep making this typo, it would be nice for it to be supported.
2021-04-28Rollup merge of #84555 - jyn514:ice-backtrace, r=Mark-SimulacrumJack Huey-0/+4
Set `backtrace-on-ice` by default for compiler and codegen profiles If there's an ICE while bootstrapping, it's most likely because of a change to the compiler.
2021-04-28Rollup merge of #84484 - jyn514:check-tools, r=Mark-SimulacrumJack Huey-5/+3
Don't rebuild rustdoc and clippy after checking bootstrap This works by unconditionally passing -Z unstable-options to the compiler. This has no affect in practice since bootstrap doesn't use `deny(rustc::internal)`. Fixes https://github.com/rust-lang/rust/issues/82461. r? ```@Mark-Simulacrum```
2021-04-28Add `x.py check src/librustdoc` as an alias for `x.py check src/tools/rustdoc`Joshua Nelson-3/+3