about summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2023-03-20Auto merge of #106610 - euclio:windows-rs, r=ChrisDentonbors-129/+183
migrate compiler, bootstrap and compiletest to windows-rs This PR migrates the compiler, bootstrap, and compiletest to use [windows-rs](https://github.com/microsoft/windows-rs) instead of winapi-rs. windows-rs is the bindings crate provided by Microsoft, and is actively maintained compared to winapi-rs. Not all ecosystem crates have migrated over yet, so there will be a period of time where both crates are used. windows-rs also provides some nice ergonomics over winapi-rs to convert return values to `Result`s (which found a case where we forgot to check the return value of `CreateFileW`).
2023-03-20migrate compiler, bootstrap, and compiletest to windows-rsAndy Russell-129/+183
2023-03-20Rollup merge of #109267 - jyn514:test-configure, r=Mark-SimulacrumMatthias Krüger-198/+258
Add tests for configure.py I highly recommend reviewing this with whitespace disabled. Notably, verifying that we generate valid toml relies on python 3.11 so we can use `tomllib`, so this also switches`x86_64-gnu-llvm-14` (one of the PR builders) to use 3.11. While fixing that, I noticed that we stopped testing python2.7 support on PR CI in https://github.com/rust-lang/rust/pull/106085. `@fee1-dead` `@pietroalbini` please be more careful in the future, there is no CI for CI itself that verifies we are testing everything we should be. - Separate out functions so that each unit test doesn't create a file on disk - Add a few unit tests
2023-03-20Rollup merge of #109170 - eggyal:xc-linux-cmake, r=Mark-SimulacrumMatthias Krüger-0/+2
Set `CMAKE_SYSTEM_NAME` for Linux targets When bootstrap compiles native dependencies like LLVM, it should set `CMAKE_SYSTEM_NAME` for the target system; otherwise cmake may not identify that it is cross-compiling. In particular, when building a Linux rustc on a macOS host, cmake was including `-isysroot /path/to/macOS.sdk` options that caused things to break. By setting `CMAKE_SYSTEM_NAME=Linux` when building for Linux targets, the macOS SDK is no longer passed as sysroot to the compiler. r? bootstrap
2023-03-18Always enable MIR inlining when building stdBen Kimock-0/+6
2023-03-18Auto merge of #107224 - nikic:llvm-16, r=cuviperbors-4/+5
Upgrade to LLVM 16 This updates Rust to LLVM 16. It also updates our host compiler for dist-x86_64-linux to LLVM 16. The reason for that is that Bolt from LLVM 15 is not capable of compiling LLVM 16 (https://github.com/llvm/llvm-project/issues/61114). LLVM 16.0.0 has been [released](https://discourse.llvm.org/t/llvm-16-0-0-release/69326) on March 18, while Rust 1.70 will become stable on June 1. Tested images: `dist-x86_64-linux`, `dist-riscv64-linux` (alt), `dist-x86_64-illumos`, `dist-various-1`, `dist-various-2`, `dist-powerpc-linux`, `wasm32`, `armhf-gnu` Tested images until the usual IPv6 failures: `test-various`
2023-03-18refactor `fn bootstrap::builder::Builder::compiler_for`ozkanonur-8/+9
- check compiler stage before forcing for stage2. - check if download_rustc is not set before forcing for stage1. Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-03-18Rollup merge of #108772 - jyn514:faster-tidy, r=the8472Matthias Krüger-1/+5
Speed up tidy quite a lot I highly recommend reviewing this commit-by-commit. Based on #106440 for convenience. ## Timings These were collected by running `x test tidy -v` to copy paste the command, then using [`samply record`](https://github.com/mstange/samply). before (8 threads) ![image](https://user-images.githubusercontent.com/23638587/222965319-352ad2c8-367c-4d74-960a-e4bb161a6aff.png) after (8 threads) ![image](https://user-images.githubusercontent.com/23638587/222965323-fa846f4e-727a-4bf8-8e3b-1b7b40505cc3.png) before (64 threads) ![image](https://user-images.githubusercontent.com/23638587/222965302-dc88020c-19e9-49d9-a87d-cad054d717f3.png) after (64 threads) ![image](https://user-images.githubusercontent.com/23638587/222965335-e73d7622-59de-41d2-9cc4-1bd67042a349.png) The last commit makes tidy use more threads, so comparing "before (8 threads)" to "after (64 threads)" is IMO the most realistic comparison. Locally, that brings the time for me to run tidy down from 4 to .9 seconds, i.e. the majority of the time for `x test tidy` is now spend running `fmt --check`. r? `@the8472`
2023-03-18Let tidy use more threadsJoshua Nelson-1/+5
This has a significant speedup for me locally, from about 1.3 seconds to .9 seconds.
2023-03-18Rollup merge of #109256 - chaitanyav:fix_108948, r=albertlarsan68Matthias Krüger-4/+7
Check for llvm-tools before install Fixes #108948 ````@jpalus```` Please review
2023-03-17Use python3.11 in CI to make sure toml is validatedJoshua Nelson-3/+2
This also fixes a regression from https://github.com/rust-lang/rust/pull/106085 which stopped testing that we support python2 in PR CI.
2023-03-17Add tests for configure.pyJoshua Nelson-198/+259
- Separate out functions so that each unit test doesn't create a file on disk - Add a few unit tests Notably, verifying that we generate valid toml relies on python 3.11 so we can use `tomllib`.
2023-03-17Check for llvm-tools before installNagaChaitanya Vellanki-4/+7
2023-03-17Initialize rust_info before is_ci_llvm_available()Nikita Popov-4/+5
2023-03-17Rollup merge of #109044 - thomcc:disallow-unstable-libtest, r=jyn514Matthias Krüger-0/+6
Prevent stable `libtest` from supporting `-Zunstable-options` Took a while for me to get around to this but seems trivial (unless I'm missing some reason this will break all our tests). Fixes #75526 Basically `libtest` already tries to handle this in https://github.com/rust-lang/rust/blob/501ad021b9a4fb2cd6a39e0302d22f169f6166b0/library/test/src/cli.rs#L310-L318 But that env var was not passed. I'm guessing at one point [this code](https://github.com/rust-lang/rust/blob/501ad021b9a4fb2cd6a39e0302d22f169f6166b0/src/bootstrap/compile.rs#L842-L844) (or a common ancestor) was used to compile the standard library/libtest, but that is no longer the case (or perhaps it never worked, I don't have time to go digging). I don't love that this is a "allow unstable by default" situation, as it means things like [`rustc-build-sysroot`](https://github.com/RalfJung/rustc-build-sysroot) could accidentally get unstable (CC ````@RalfJung)```` even if this is fixed here, but it's consistent with what happens in `rustc_feature`, so... yeah. This is user-facing after all, even if it's hard to imagine the outcome of that conversation being "lets continue allowing use of `-Zunstable-features` from stable rust" (especially since a `RUSTC_BOOTSTRAP=1`-shaped loophole remains)... I think it probably should get a vibe check in the t-libs meeting (and plausibly a relnote along the lines of "hey `cargo test -- -Zunstable-options --some --unstable --stuff=here` used to work on stable, that's been fixed, sorry"). I'll nominate it for that after CI comes up green (I've done a smoke check but don't know what (if anything) will need `bootstrap` to enable `RUSTC_BOOTSTRAP=1` when running tests) r? ````@jyn514````
2023-03-15Set CMAKE_SYSTEM_NAME for Linux targetsAlan Egerton-0/+2
When bootstrap compiles native dependencies like LLVM, it should set CMAKE_SYSTEM_NAME for the target system; otherwise cmake may not identify that it is cross-compiling. In particular, when building a Linux rustc on a macOS host, cmake was including `-isysroot /path/to/macOS.sdk` options that caused things to break. By setting `CMAKE_SYSTEM_NAME=Linux` when building for Linux targets, the macOS SDK is no longer passed as sysroot to the compiler.
2023-03-15Rollup merge of #109111 - MU001999:master, r=jyn514Dylan DPC-0/+1
Create dirs for build_triple Fixes #109103
2023-03-15add `enable-warnings` flag for llvmozkanonur-6/+9
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-03-14add dist.compression-profile option to control compression speedPietro Albini-0/+5
2023-03-14Create dir for build_tripleMu001999-0/+1
2023-03-13Rollup merge of #109055 - ozkanonur:detect_src_and_out, r=albertlarsan68Matthias Krüger-2/+33
create `config::tests::detect_src_and_out` test for bootstrap Resolves one of the `FIXME` in bootstrap
2023-03-13Rollup merge of #108607 - psumbera:solaris-no-flock-bootstrap, r=albertlarsan68Matthias Krüger-8/+15
Don't use fd-lock on Solaris in bootstrap ...as Solaris is missing flock() fixes #103630
2023-03-13Don't use fd-lock on Solaris in bootstrapPetr Sumbera-8/+15
...as Solaris is missing flock() fixes #103630
2023-03-12create `config::tests::detect_src_and_out` test for bootstrapozkanonur-2/+33
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-03-12Rollup merge of #109031 - thomcc:config-example-toml, r=ozkanonurMatthias Krüger-12/+12
Rename `config.toml.example` to `config.example.toml` This had bothered me for a while as it leads to bad (missing) syntax highlighting in most editors I've used, and `@jyn514` suggested I just make the change and that the compatibility concerns I had don't really matter. I suspect it will be a contentious one, so will not be offended if the outcome of this is to close the PR.
2023-03-12Prevent stable `libtest` from supporting `-Zunstable-options`Thom Chiovoloni-0/+6
2023-03-12Rollup merge of #108984 - Teapot4195:issue-106803-fix, r=ozkanonurMatthias Krüger-0/+2
bootstrap: document tidy Enable documentation of tidy, as suggested in #106803. Jyn mentioned they should probably be added to `doc.rust-lang.org`, how should that be done?
2023-03-11Rename `config.toml.example` to `config.example.toml`Thom Chiovoloni-12/+12
2023-03-10bootstrap: document tidyAlex Huang-0/+2
2023-03-10Rollup merge of #108963 - jhheider:fix-CI-non-git-builds, r=albertlarsan68Matthias Krüger-1/+1
only call git on git checkouts during bootstrap fixes https://github.com/rust-lang/rust/issues/108959
2023-03-09only call git on git checkoutsJacob Heider-1/+1
2023-03-09Rollup merge of #108778 - jyn514:quiet-fmt, r=albertlarsan68Matthias Krüger-1/+7
x fmt: Don't print all modified files if there's more than 10 This avoids spam for dozens of modified files. Fixes https://github.com/rust-lang/rust/issues/106920.
2023-03-09Don't print all modified files if there's more than 10Joshua Nelson-1/+7
This avoids spam for dozens of modified files.
2023-03-08Rollup merge of #108898 - ferrocene:pa-libc-check-cfg, r=Mark-SimulacrumMatthias Krüger-0/+9
Set `LIBC_CHECK_CFG=1` when building Rust code in bootstrap Downstream forks of the Rust compiler might want to use a custom `libc` to add support for targets that are not yet available upstream. Adding a patch to replace `libc` with a custom one would cause compilation errors though, because Cargo would interpret the custom `libc` as part of the workspace, and apply the check-cfg lints on it. Since https://github.com/rust-lang/libc/pull/3037, the `libc` build script emits check-cfg flags only when the `LIBC_CHECK_CFG` environment variable is set, so this PR allows the use of custom `libc`s.
2023-03-08set LIBC_CHECK_CFG=1 when building Rust code in bootstrapPietro Albini-0/+9
2023-03-08Auto merge of #108534 - Mark-Simulacrum:compression, r=pietroalbinibors-6/+57
Import rust-installer & adjust compression settings This brings in rust-lang/rust-installer#123, which enables a larger compression window (8 -> 64MB) amongst other changes to the xz compression settings. The net effect should be smaller compressed tarballs which will decrease bandwidth usage for static.rust-lang.org, download times, and decompression time. This comes at the cost of higher baseline requirements for running rustup to use these files, which we believe should be largely acceptable (running rustc is likely to use at least this much memory) but if we get specific reports we may explore options to decrease impact (e.g., using the gzip tarballs automatically in rustup). To simplify iteration on compression settings this also imports the rust-lang/rust-installer submodule, it is now hosted fully inside rust-lang/rust. Once we land this I'll file a followup to add a note to that repo and we can subsequently archive it. -- CI times for dist-x86_64-linux builds: * threads=6, master - 2h 50m * threads=1, new - 3h 40m * threads=6, new - 2h 50m
2023-03-07Rollup merge of #108866 - Kohei316:master, r=ozkanonurMatthias Krüger-2/+13
Force to use the stage 2 compiler when config.download_rustc is set Fixes #108768
2023-03-07Rollup merge of #108581 - jfgoog:include-mingw-linker, r=petrochenkovMatthias Krüger-2/+6
Add a new config flag, dist.include-mingw-linker. The flag controls whether to copy the linker, DLLs, and various libraries from MinGW into the rustc toolchain. It applies only when the host or target is pc-windows-gnu. The flag is true by default to preserve existing behavior.
2023-03-08Add force to use the stage 2 compiler in compiler_for when ↵morine0122-2/+13
config.download_rustc is set
2023-03-07Rollup merge of #108619 - jyn514:llvm-version-check, r=cuviperYuki Okushi-9/+1
Remove the option to disable `llvm-version-check` We don't support old versions of LLVM; there's no reason to have an easy way to force bootstrap to use them anyway. If someone really needs to use an unsupported version, they can modify bootstrap to change the version range. r? ``@cuviper`` on whether we want to do this or not, since you maintain rust on Fedora and touched this config last.
2023-03-07Add bootstrap support for rust-installerMark Rousskov-6/+57
2023-03-07switch to termcolorPietro Albini-47/+78
2023-03-06fix name of the field containing the ignore reasonPietro Albini-3/+3
2023-03-05Rollup merge of #108776 - jyn514:quiet-tidy, r=ozkanonurMatthias Krüger-2/+4
Make `x test tidy` less noisy Before: ``` Building tool tidy (stage0) Finished release [optimized + debuginfo] target(s) in 0.29s fmt check skip untracked path chrome_profiler.json during rustfmt invocations skip untracked path query_impl-default,args.mm_profdata during rustfmt invocations skip untracked path query_impl-llvm.txt during rustfmt invocations skip untracked path query_impl-mono_items.txt during rustfmt invocations skip untracked path query_impl-summarize.txt during rustfmt invocations skip untracked path rustc.svg during rustfmt invocations skip untracked path rustc_middle.mono_items.json during rustfmt invocations skip untracked path rustc_middle.mono_items.md during rustfmt invocations skip untracked path rustc_query_impl.mono_items-thread_local_attr.json during rustfmt invocations skip untracked path rustc_query_impl.mono_items-thread_local_macro.json during rustfmt invocations skip untracked path rustc_query_impl.mono_items.md during rustfmt invocations tidy check Found 505 error codes Highest error code: `E0793` * 397 features Ensuring the YAML anchors in the GitHub Actions config were expanded Building tool expand-yaml-anchors (stage0) Finished release [optimized + debuginfo] target(s) in 0.14s Build completed successfully in 0:00:54 ``` After: ``` Building tool tidy (stage0) Finished release [optimized + debuginfo] target(s) in 2.24s fmt check tidy check Ensuring the YAML anchors in the GitHub Actions config were expanded Building tool expand-yaml-anchors (stage0) Finished release [optimized + debuginfo] target(s) in 0.14s Build completed successfully in 0:00:04 ```
2023-03-05Rollup merge of #108773 - jyn514:faster-tidy-fmt, r=albertlarsan68Matthias Krüger-1/+5
x fmt: Only check modified files locally Previously, `x fmt` would only format modified files, while `x fmt .` and `x fmt --check` would still look at all files. After this change, `x fmt --check` only looks at modified files locally. I feel pretty confident in this change - other than https://github.com/rust-lang/rust/issues/106261, no one has reported bugs in `get_modified_rs_files` since it was added in https://github.com/rust-lang/rust/pull/105702. Combined with the changes in https://github.com/rust-lang/rust/pull/108772, this brings the time for me to run `x t tidy` with a hot FS cache down from 5 to 2 seconds (and moves the majority of the time spent back to `tidy check`, which means it can be sped up more in the future).
2023-03-05Make `x test tidy` less noisyJoshua Nelson-2/+4
Before: ``` Building tool tidy (stage0) Finished release [optimized + debuginfo] target(s) in 0.29s fmt check skip untracked path chrome_profiler.json during rustfmt invocations skip untracked path query_impl-default,args.mm_profdata during rustfmt invocations skip untracked path query_impl-llvm.txt during rustfmt invocations skip untracked path query_impl-mono_items.txt during rustfmt invocations skip untracked path query_impl-summarize.txt during rustfmt invocations skip untracked path rustc.svg during rustfmt invocations skip untracked path rustc_middle.mono_items.json during rustfmt invocations skip untracked path rustc_middle.mono_items.md during rustfmt invocations skip untracked path rustc_query_impl.mono_items-thread_local_attr.json during rustfmt invocations skip untracked path rustc_query_impl.mono_items-thread_local_macro.json during rustfmt invocations skip untracked path rustc_query_impl.mono_items.md during rustfmt invocations tidy check Found 505 error codes Highest error code: `E0793` * 397 features Ensuring the YAML anchors in the GitHub Actions config were expanded Building tool expand-yaml-anchors (stage0) Finished release [optimized + debuginfo] target(s) in 0.14s Build completed successfully in 0:00:54 ``` After: ``` Building tool tidy (stage0) Finished release [optimized + debuginfo] target(s) in 2.24s fmt check tidy check Ensuring the YAML anchors in the GitHub Actions config were expanded Building tool expand-yaml-anchors (stage0) Finished release [optimized + debuginfo] target(s) in 0.14s Build completed successfully in 0:00:04 ```
2023-03-05Remove the option to disable `llvm-version-check`Joshua Nelson-9/+1
We don't support old versions of LLVM; there's no reason to have an easy way to force bootstrap to use them anyway. If someone really needs to use an unsupported version, they can modify bootstrap to change the version range.
2023-03-05x fmt: Only check modified files locallyJoshua Nelson-1/+5
Previously, `x fmt` would only format modified files, while `x fmt .` and `x fmt --check` would still look at all files. After this change, `x fmt --check` only looks at modified files locally. I feel pretty confident in this change - other than https://github.com/rust-lang/rust/issues/106261, no one has reported bugs in `get_modified_rs_files` since it was added in https://github.com/rust-lang/rust/pull/105702.
2023-03-05Rollup merge of #108618 - KittyBorgX:master, r=Mark-SimulacrumMatthias Krüger-8/+8
Rename `src/etc/vscode_settings.json` to `rust_analyzer_settings.json` Fixes https://github.com/rust-lang/rust/issues/108614
2023-03-05Rollup merge of #108616 - jyn514:sync-codegen, r=albertlarsan68Matthias Krüger-0/+2
Sync codegen defaults with compiler defaults and add a ping message so they stay in sync Looks like this got missed in https://github.com/rust-lang/rust/pull/107241.