about summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2023-04-19configure: Set `profile = user` by defaultjyn-0/+3
2023-04-19configure: Fix bug in `configure_top_level_key`jyn-5/+4
Before, it only worked for numbers, not strings.
2023-04-19Changing position of early exit and using standard error method with correct ↵Mads Ravn-4/+4
exit code
2023-04-19Rollup merge of #110507 - weihanglo:print-try-run-output, r=jyn514Matthias Krüger-1/+1
boostrap: print output during building tools Fixes #110506
2023-04-19bootstrap: Update linux-raw-sys to 0.3.2WANG Rui-2/+2
Adds support for LoongArch.
2023-04-18Don't special-case download-rustc in `maybe_install_llvm`jyn-14/+0
This is no longer necessary now that the llvm in `rust-dev` matches the one in `rustc`.
2023-04-19Auto merge of #110229 - jyn514:download-rustc-tests, r=albertlarsan68bors-17/+77
Fix no_std tests that load libc from the sysroot when download-rustc is enabled There were a series of unfortunate interactions here. Here's an MCVE of the test this fixes (committed as `tests/ui/meta/no_std-extern-libc.rs`): ```rust #![crate_type = "lib"] #![no_std] #![feature(rustc_private)] extern crate libc; ``` Before, this would give an error about duplicate versions of libc: ``` error[E0464]: multiple candidates for `rlib` dependency `libc` found --> fake-test-src-base/allocator/no_std-alloc-error-handler-default.rs:15:1 | LL | extern crate libc; | ^^^^^^^^^^^^^^^^^^ | = note: candidate #1: /home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage2/lib/rustlib/aarch64-unknown-linux-gnu/lib/liblibc-358db1024b7d9957.rlib = note: candidate #2: /home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage2/lib/rustlib/aarch64-unknown-linux-gnu/lib/liblibc-ebc478710122a279.rmeta ``` Both these versions were downloaded from CI, but one came from the `rust-std` component and one came from `rustc-dev`: ``` ; tar -tf build/cache/f2d9a3d0771504f1ae776226a5799dcb4408a91a/rust-std-nightly-x86_64-unknown-linux-gnu.tar.xz | grep liblibc rust-std-nightly-x86_64-unknown-linux-gnu/rust-std-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-68a2d9e195dd6ed2.rlib ; tar -tf build/cache/f2d9a3d0771504f1ae776226a5799dcb4408a91a/rustc-dev-nightly-x86_64-unknown-linux-gnu.tar.xz | grep liblibc rustc-dev-nightly-x86_64-unknown-linux-gnu/rustc-dev/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-f226c9fbdd92a0fd.rmeta ``` The fix was to only copy files from `rust-std` unless a Step explicitly requests for the `rustc-dev` components to be available by calling `builder.ensure(compile::Rustc)`. To avoid having to re-parse the `rustc-dev.tar.xz` tarball every time, which is quite slow, this adds a new `build/host/ci-rustc/.rustc-dev-contents` cache file which stores only the names of files we need to copy into the sysroot. This also allows reverting the hack in https://github.com/rust-lang/rust/pull/110121; now that we only copy rustc-dev on-demand, we can correctly add the `Rustc` check artifacts into the sysroot, so that this works correctly even when `download-rustc` is forced to `true` and some tool depends on a local change to `compiler`. --- See https://github.com/rust-lang/rust/issues/108767#issuecomment-1501217657 for why `no_std` is required for the MCVE test to fail; it's complicated and not particularly important. Fixes https://github.com/rust-lang/rust/issues/108767.
2023-04-18boostrap: print output during building toolsWeihang Lo-1/+1
2023-04-18Auto merge of #110492 - GuillaumeGomez:rollup-n4tpbl4, r=GuillaumeGomezbors-3/+5
Rollup of 5 pull requests Successful merges: - #110417 (Spelling compiler) - #110441 (5 little typos) - #110485 (Fix bootstrap locking) - #110488 (Add a failing rustdoc-ui test for public infinite recursive type) - #110490 (Bump `download-ci-llvm-stamp` for loong support) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-04-18Rollup merge of #110490 - jyn514:bump-llvm, r=nikicGuillaume Gomez-1/+1
Bump `download-ci-llvm-stamp` for loong support This was missed in https://github.com/rust-lang/rust/pull/96971 and resulted in the LLVM we cache in CI being different from the one built locally. We didn't catch it because nothing tested the loong support. Fixes https://github.com/rust-lang/rust/issues/110474. r? `@nikic`
2023-04-18Rollup merge of #110485 - albertlarsan68:fix-bootstrap-lock, r=ozkanonurGuillaume Gomez-2/+4
Fix bootstrap locking Fix the regression introduced in #108607 Fixes #109967
2023-04-18Bump `download-ci-llvm-stamp` for loong supportjyn-1/+1
This was missed in https://github.com/rust-lang/rust/pull/96971 and resulted in the LLVM we cache in CI being different from the one built locally. We didn't catch it because nothing tested the loong support.
2023-04-18Fix no_std tests that load libc when download-rustc is enabledJoshua Nelson-17/+77
There were a series of unfortunate interactions here. Here's an MCVE of the test this fixes (committed as `tests/ui/meta/no_std-extern-libc.rs`): ```rust #![crate_type = "lib"] #![no_std] #![feature(rustc_private)] extern crate libc; ``` Before, this would give an error about duplicate versions of libc: ``` error[E0464]: multiple candidates for `rlib` dependency `libc` found --> fake-test-src-base/allocator/no_std-alloc-error-handler-default.rs:15:1 | LL | extern crate libc; | ^^^^^^^^^^^^^^^^^^ | = note: candidate #1: /home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage2/lib/rustlib/aarch64-unknown-linux-gnu/lib/liblibc-358db1024b7d9957.rlib = note: candidate #2: /home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage2/lib/rustlib/aarch64-unknown-linux-gnu/lib/liblibc-ebc478710122a279.rmeta ``` Both these versions were downloaded from CI, but one came from the `rust-std` component and one came from `rustc-dev`: ``` ; tar -tf build/cache/f2d9a3d0771504f1ae776226a5799dcb4408a91a/rust-std-nightly-x86_64-unknown-linux-gnu.tar.xz | grep liblibc rust-std-nightly-x86_64-unknown-linux-gnu/rust-std-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-68a2d9e195dd6ed2.rlib ; tar -tf build/cache/f2d9a3d0771504f1ae776226a5799dcb4408a91a/rustc-dev-nightly-x86_64-unknown-linux-gnu.tar.xz | grep liblibc rustc-dev-nightly-x86_64-unknown-linux-gnu/rustc-dev/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-f226c9fbdd92a0fd.rmeta ``` The fix was to only copy files from `rust-std` unless a Step explicitly requests for the `rustc-dev` components to be available by calling `builder.ensure(compile::Rustc)`. To avoid having to re-parse the `rustc-dev.tar.xz` tarball every time, which is quite slow, this adds a new `build/host/ci-rustc/.rustc-dev-contents` cache file which stores only the names of files we need to copy into the sysroot. This also allows reverting the hack in https://github.com/rust-lang/rust/pull/110121; now that we only copy rustc-dev on-demand, we can correctly add the `Rustc` check artifacts into the sysroot, so that this works correctly even when `download-rustc` is forced to `true`. --- See https://github.com/rust-lang/rust/issues/108767#issuecomment-1501217657 for why `no_std` is required for the MCVE test to fail; it's complicated and not particularly important. Fixes https://github.com/rust-lang/rust/issues/108767.
2023-04-18Auto merge of #110478 - jyn514:stage1-fulldeps, r=albertlarsan68bors-7/+36
Support `x test --stage 1 ui-fulldeps` `@Nilstrieb` had an excellent idea the other day: the same way that rustdoc is able to load `rustc_driver` from the sysroot, ui-fulldeps tests should also be able to load it from the sysroot. That allows us to run fulldeps tests with stage1, without having to fully rebuild the compiler twice. It does unfortunately have the downside that we're building the tests with the *bootstrap* compiler, not the in-tree sources, but since most of the fulldeps tests are for the *API* of the compiler, that seems ok. I think it's possible to extend this to `run-make-fulldeps`, but I've run out of energy for tonight. - Move `plugin` tests into a subdirectory. Plugins are loaded at runtime with `dlopen` and so require the ABI of the running compile to match the ABI of the compiler linked with `rustc_driver`. As a result they can't be supported in stage 1 and have to use `// ignore-stage1`. - Remove `ignore-stage1` from most non-plugin tests - Ignore diagnostic tests in stage 1. Even though this requires a stage 2 build to load rustc_driver, it's primarily testing the error message that the *running* compiler emits when the diagnostic struct is malformed. - Pass `-Zforce-unstable-if-unmarked` in stage1, not just stage2. That allows running `hash-stable-is-unstable` in stage1, since it now suggests adding `rustc_private` to enable loading the crates. - Add libLLVM.so to the stage0 target sysroot, to allow fulldeps tests that act as custom drivers to load it at runtime. - Pass `--sysroot stage0-sysroot` in compiletest so that we use the correct version of std. - Move a few lint tests from ui-fulldeps to ui These had an `aux-build:lint-group-plugin-test.rs` that they never actually loaded with `feature(plugin)` nor tested. I removed the unused aux-build and they pass fine with stage 1. Fixes https://github.com/rust-lang/rust/issues/75905.
2023-04-18Fix bootstrap lockingAlbert Larsan-2/+4
Fix the regression introduced in 108607
2023-04-18Rollup merge of #110442 - ferrocene:pa-build-metrics-dry-run, r=ozkanonurMatthias Krüger-6/+22
Avoid including dry run steps in the build metrics Including steps executed during the dry run will result in a duplication of all the steps in the build metrics, which just adds noise.
2023-04-18Rollup merge of #109981 - duckymirror:issue-107094, r=albertlarsan68Matthias Krüger-0/+10
Set commit information environment variables when building tools This fixes #107094. ~I'm trying to add a regression test for this issue.~ **Update**: I've added a test and a new test header `needs-git-hash` which makes sure it doesn't run when commit hashes are ignored (`bootstrap`'s `ignore-git` option).
2023-04-17Support `x test --stage 1 ui-fulldeps`jyn-7/+36
Nils had an excellent idea the other day: the same way that rustdoc is able to load `rustc_driver` from the sysroot, ui-fulldeps tests should also be able to load it from the sysroot. That allows us to run fulldeps tests with stage1, without having to fully rebuild the compiler twice. It does unfortunately have the downside that we're running the tests on the *bootstrap* compiler, not the in-tree sources, but since most of the fulldeps tests are for the *API* of the compiler, that seems ok. I think it's possible to extend this to `run-make-fulldeps`, but I've run out of energy for tonight. - Move `plugin` tests into a subdirectory. Plugins are loaded at runtime with `dlopen` and so require the ABI of the running compile to match the ABI of the compiler linked with `rustc_driver`. As a result they can't be supported in stage 1 and have to use `// ignore-stage1`. - Remove `ignore-stage1` from most non-plugin tests - Ignore diagnostic tests in stage 1. Even though this requires a stage 2 build to load rustc_driver, it's primarily testing the error message that the *running* compiler emits when the diagnostic struct is malformed. - Pass `-Zforce-unstable-if-unmarked` in stage1, not just stage2. That allows running `hash-stable-is-unstable` in stage1, since it now suggests adding `rustc_private` to enable loading the crates. - Add libLLVM.so to the stage0 target sysroot, to allow fulldeps tests that act as custom drivers to load it at runtime. - Pass `--sysroot stage0-sysroot` in compiletest so that we use the correct version of std.
2023-04-18Auto merge of #110403 - klensy:bolt-deprecate, r=albertlarsan68,Kobzolbors-1/+1
bolt: remove deprecated option value for split-functions Noticed warning at https://github.com/rust-lang-ci/rust/actions/runs/4711883459/jobs/8356538964#step:26:40828, option value was removed at https://github.com/llvm/llvm-project/commit/96f6ec5090c2f7a1e4804693cbb84c29c574b3de. bolt only running on latest supported llvm (yes?), so it's safe to apply this patch. cc `@Kobzol`
2023-04-17Spelling src/bootstrapJosh Soref-6/+6
* although * correct * granular * libunwind * repository * section Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-17avoid including dry run steps in the build metricsPietro Albini-6/+22
Including steps executed during the dry run will result in a duplication of all the steps in the build metrics, which just adds noise.
2023-04-16Extract variableNilstrieb-4/+5
2023-04-16bootstrap.py: Use loop for `_download_component_helper`Nilstrieb-10/+11
2023-04-16bootstrap.py: Create cache before downloadNilstrieb-8/+11
This make `_download_component_helper` "pure".
2023-04-16bootstrap: switch from `stream_cargo` to `try_run_quiet`Weihang Lo-3/+3
It is unnecessary to stream cargo JSON output.
2023-04-16chore: remove `rustc-workspace-hack`Weihang Lo-132/+2
Co-authored-by: Scott Schafer <schaferjscott@gmail.com> Co-authored-by: Eric Huss <eric@huss.org>
2023-04-16chore: remove Cargo features in rustc-workspace-hackWeihang Lo-1/+0
2023-04-16bootstrap: treat src/tools/cargo as a workspace memberWeihang Lo-15/+44
We remove `src/tools/cargo` from rust-lang/rust root workspace, but some underlying mechanism still needs it to be a member. for example, `./x.py doc`. This little hack make cargo's metadata available by invoking an extra `cargo metadata` for cargo the package itself. Co-authored-by: Scott Schafer <schaferjscott@gmail.com> Co-authored-by: Eric Huss <eric@huss.org>
2023-04-16chore: allow `cargo` to have its own workspaceWeihang Lo-2/+9
This also * bumps cargo to the latest in rust-lang/cargo. * adds 0BSD to allowed list of licenses Co-authored-by: Scott Schafer <schaferjscott@gmail.com> Co-authored-by: Eric Huss <eric@huss.org>
2023-04-16bolt: remove deprecated option valueklensy-1/+1
2023-04-16Fix error due to renaming of ignore_gitErik Hofmayer-1/+1
2023-04-16Add needs-git-hash header to compiletestErik Hofmayer-0/+4
This header can be used for tests which check the output of `--version --verbose` commands.
2023-04-16Set git info env variables when building toolsErik Hofmayer-0/+6
This should fix issue #107094.
2023-04-16Rollup merge of #110356 - jyn514:rust-installer-tests, r=ozkanonurYuki Okushi-1/+3
Fix `x test rust-installer` when `cargo` is set to a relative path Previously, this would give an error because the shell script had a different working directory: ``` test: basic_install $ sh /home/jyn/src/rust/src/tools/rust-installer/gen-installer.sh --image-dir=/home/jyn/src/rust/src/tools/rust-installer/test/image1 --work-dir=/home/jyn/src/rust/build/x86_64-unknown-linux-gnu/test/rust-installer/workdir --output-dir=/home/jyn/src/rust/build/x86_64-unknown-linux-gnu/test/rust-installer/outdir /home/jyn/src/rust/src/tools/rust-installer/gen-installer.sh: 15: ../rust3/build/host/stage2-tools-bin/cargo: not found TEST FAILED! ```
2023-04-15Auto merge of #110227 - klensy:bs-win, r=Mark-Simulacrumbors-4/+0
bootstrap: drop some windows features They became unused after https://github.com/rust-lang/rust/pull/109960
2023-04-15Fix `x test rust-installer` when `cargo` is set to a relative pathjyn-1/+3
Previously, this would give an error because the shell script had a different working directory: ``` test: basic_install $ sh /home/jyn/src/rust/src/tools/rust-installer/gen-installer.sh --image-dir=/home/jyn/src/rust/src/tools/rust-installer/test/image1 --work-dir=/home/jyn/src/rust/build/x86_64-unknown-linux-gnu/test/rust-installer/workdir --output-dir=/home/jyn/src/rust/build/x86_64-unknown-linux-gnu/test/rust-installer/outdir /home/jyn/src/rust/src/tools/rust-installer/gen-installer.sh: 15: ../rust3/build/host/stage2-tools-bin/cargo: not found TEST FAILED! ```
2023-04-14Auto merge of #110331 - matthiaskrgr:rollup-9vldvow, r=matthiaskrgrbors-2/+1
Rollup of 7 pull requests Successful merges: - #108687 (Reformulate `point_at_expr_source_of_inferred_type` to be more accurate) - #109272 (Add Command environment variable inheritance docs) - #109947 (Add links from `core::cmp` derives to their traits) - #110110 (Use `Display` in top-level example for `PanicInfo`) - #110154 (Fix typos in library) - #110244 (Remove some unneeded imports / qualified paths) - #110328 ([rustdoc] Add explanations for auto-disambiguation when an intra doc link is resolved to a proc-macro and a trait at the same time) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-04-14Rollup merge of #110244 - kadiwa4:unnecessary_imports, r=JohnTitorMatthias Krüger-2/+1
Remove some unneeded imports / qualified paths Continuation of #105537.
2023-04-14Auto merge of #110263 - jyn514:ui-fulldeps-llvm, r=albertlarsan68bors-4/+24
Add `libLLVM.so` to the target libdir when download-rustc is enabled Previously, we would only add it to the host libdir, which meant it couldn't be loaded by `ui-fulldeps` tests that used rustc_private. Fixes https://github.com/rust-lang/rust/issues/110225, fixes https://github.com/rust-lang/rust/issues/110226.
2023-04-14Auto merge of #110324 - JohnTitor:rollup-jq31pd1, r=JohnTitorbors-23/+173
Rollup of 7 pull requests Successful merges: - #103682 (Stabilize rustdoc `--test-run-directory`) - #106249 (Create "suggested tests" tool in `rustbuild`) - #110047 (Add link to `collections` docs to `extend` trait) - #110269 (Add `tidy-alphabetical` to features in `core`) - #110292 (Add `tidy-alphabetical` to features in `alloc` & `std`) - #110305 (rustdoc-search: use ES6 `Map` and `Set` where they make sense) - #110315 (Add a stable MIR way to get the main function) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-04-14Rollup merge of #106249 - Ezrashaw:suggest-test-tool, r=jyn514,albertlarsan68Yuki Okushi-23/+173
Create "suggested tests" tool in `rustbuild` Not the claimed person in #97339 but: I've done a very rough implementation of this feature in-tree. I'm very new to `rustc` development (outside of docs) so some help would be greatly appreciated. The UI of this new subcommand obviously will change and I need some mentoring with the `--run` flag. r? ```@jyn514```
2023-04-14Auto merge of #110177 - RalfJung:miri-tests, r=oli-obkbors-1/+4
fix running Miri tests This partially reverts https://github.com/rust-lang/rust/pull/108659 to fix https://github.com/rust-lang/rust/issues/110102: the Miri test runner does not support any flags, they are interpreted as filters instead which leads to no tests being run. I have not checked any of the other test runners for whether they are having any trouble with these flags. Cc `@pietroalbini` `@Mark-Simulacrum` `@jyn514`
2023-04-13Rollup merge of #110265 - KittyBorgX:master, r=ozkanonurMatthias Krüger-0/+6
Automatically update the LLVM submodule for musl target (and other places) Fixes #109987
2023-04-13automatically update the LLVM submoduleKrishna Ramasimha-0/+6
2023-04-12Add `libLLVM.so` to the target libdir when download-rustc is enabledjyn-4/+24
Previously, we would only add it to the host libdir, which meant it couldn't be loaded by `ui-fulldeps` tests that used rustc_private.
2023-04-12Rollup merge of #110235 - GuillaumeGomez:fix-extend-css, r=notriddleMatthias Krüger-0/+2
Fix `--extend-css` option Fixes #110002. The file was generated in the wrong folder so I moved it into `static.files` as it made more sense to have there instead of changing the path in the templates. I also added a GUI test to ensure that this option won't break unexpectedly again.
2023-04-12Rollup merge of #110122 - jyn514:check-stage1-llvm, r=ozkanonurMatthias Krüger-74/+82
Fix x check --stage 1 when download-ci-llvm=false Bootstrap tries to avoid building LLVM unless it needs to; in particular we only build it for `x build`, not `x check`. Unfortunately, the check forgot about existence of stages - it would break if you used `x check --stage 1`: ``` = note: /usr/bin/ld: cannot find -lPolly: No such file or directory /usr/bin/ld: cannot find -lPollyISL: No such file or directory ``` Fix it to work for stage 1. I recommend reading this commit-by-commit; the first one makes a bunch of whitespace changes but otherwise doesn't change the logic.
2023-04-12Add/update tests for `--extend-css` optionGuillaume Gomez-0/+2
2023-04-12remove some unneeded importsKaDiWa-2/+1
2023-04-12drop some windows featuresklensy-4/+0