about summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2023-10-28Rollup merge of #117322 - onur-ozkan:fix-suppressed-outputs, r=KobzolJubilee-2/+6
change default output mode of `BootstrapCommand` `SuppressOnSuccess` on `BootstrapCommand` is a problematic default mode as it affects the logs during the bootstrapping (as shown in the screenshot below). The default behavior should be to print everything unless we explicitly modify the behavior within build steps. ![image](https://github.com/rust-lang/rust/assets/39852038/8dbaaeb2-0656-4ff9-8e48-1ac0734a913f) Fixes #117315 cc `@Kobzol`
2023-10-28Ensure the rustc-codegen-cranelift-preview component is never emptybjorn3-0/+7
Either generate it with the actual codegen backend dylib or omit it entirely when the cranelift backend is disabled for this build.
2023-10-28set `BootstrapCommand` output mode for submodulesonur-ozkan-1/+5
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-28change default output mode of `BootstrapCommand`onur-ozkan-1/+1
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-28Auto merge of #81746 - bjorn3:cg_clif_rustup_component, r=Mark-Simulacrumbors-27/+135
Distribute cg_clif as rustup component on the nightly channel This makes it possible to use cg_clif using: ```bash $ rustup component add rustc-codegen-cranelift-preview --toolchain nightly $ RUSTFLAGS="-Zcodegen-backend=cranelift" cargo +nightly build ``` cc https://github.com/rust-lang/compiler-team/issues/405. r? `@Mark-Simulacrum`
2023-10-28Auto merge of #117197 - Zalathar:demangler, r=onur-ozkanbors-2/+4
Avoid unnecessary builds/rebuilds of `rust-demangler` This is a combination of two loosely-related changes: - Don't build `rust-demangler` as a dependency of `tests/run-make`, because after #112300 none of the remaining run-make tests actually use it. (If future run-make tests ever do need the demangler, it'll be easy to add it back.) - For `tests/run-coverage`, build the demangler with the stage 0 compiler instead of the current-stage compiler. This avoids having to uselessly rebuild the demangler after modifying and rebuilding the compiler itself.
2023-10-27Explicitly mark which targets to distribute cg_clif for in CIbjorn3-1/+3
This avoids needlessly building cg_clif for other targets and makes it easier for the dist code to determine if it should distribute cg_clif as component.
2023-10-27Rollup merge of #117287 - onur-ozkan:fix-miri-target-info, r=RalfJungMatthias Krüger-1/+1
fix miri target information for Test step self-explanatory r? RalfJung
2023-10-27fix miri target information for Test steponur-ozkan-1/+1
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-27Distribute cg_clif as a rustup componentbjorn3-27/+133
2023-10-27For run-coverage tests, build `rust-demangler` with the stage 0 compilerZalathar-1/+3
This avoids useless rebuilds of the demangler when modifying the compiler.
2023-10-27Don't provide `rust-demangler` to run-make testsZalathar-1/+1
The demangler was only needed by coverage tests, but those tests were migrated into their own custom test mode in #112300. This avoids having to build the demangler just for run-make tests. It will still be built as needed by run-coverage tests or for other purposes.
2023-10-26Auto merge of #117249 - matthiaskrgr:rollup-h4og5rv, r=matthiaskrgrbors-1/+4
Rollup of 6 pull requests Successful merges: - #116968 (Invalid `?` suggestion on mismatched `Ok(T)`) - #117032 (Enable cg_clif tests for riscv64gc) - #117106 (When expecting closure argument but finding block provide suggestion) - #117114 (Improve `stringify.rs` test) - #117188 (Avoid repeated interning of `env!("CFG_RELEASE")`) - #117243 (Explain implementation of mem::replace) r? `@ghost` `@rustbot` modify labels: rollup
2023-10-26Rollup merge of #117032 - bjorn3:riscv64_enable_cg_clif_tests, r=petrochenkovMatthias Krüger-1/+4
Enable cg_clif tests for riscv64gc Cranelift now has support for riscv64 on Linux.
2023-10-26Auto merge of #116581 - Kobzol:bootstrap-cmd-run, r=onur-ozkanbors-80/+158
Centralize command running in boostrap (part one) This PR tries to consolidate the various `run, try_run, run_quiet, run_quiet_delaying_failure, run_delaying_failure` etc. methods on `Builder`. This PR only touches command execution which doesn't produce output that would be later read by bootstrap, and it also only refactors spawning of commands that happens after a builder is created (commands executed during download & git submodule checkout are left as-is, for now). The `run_cmd` method is quite meaty, but I expect that it will be changing rapidly soon, so I considered it easy to kept everything in a single method, and only after things settle down a bit, then maybe again split it up a bit. I still kept the original shortcut methods like `run_quiet_delaying_failure`, but they now only delegate to `run_cmd`. I tried to keep the original behavior (or as close to it as possible) for all the various commands, but it is a giant mess, so there may be some deviations. Notably, `cmd.output()` is now always called, instead of just `status()`, which was called previously in some situations. Apart from the refactored methods, there is also `Config::try_run`, `check_run`, methods that run commands that produce output, oh my… that's left for follow-up PRs :) The driving goal of this (and following) refactors is to centralize command execution in bootstrap on a single place, to make command mocking feasible. r? `@onur-ozkan`
2023-10-26Allow ignoring the failure of command executionJakub Beránek-5/+18
2023-10-26Auto merge of #116983 - Urgau:prepare-bootstrap-for-new-check-cfg, r=Kobzolbors-8/+28
Prepare the `bootstrap` tool for the new check-cfg syntax This PR prepare the `bootstrap` tool for the [new check-cfg syntax](https://github.com/rust-lang/rust/pull/111072) as well as the according [changes to Cargo](https://github.com/rust-lang/cargo/pull/12845). ~~Note that while the new syntax can technically available on stage > 2, we actually cannot use it since we need a cargo version that supports the new syntax which won't happen until the next beta bump (if I understand everything correctly).~~ r? bootstrap
2023-10-26Auto merge of #115872 - ferrocene:pa-remap-cargo-home, r=clubby789bors-1/+33
Remap Cargo dependencies to /rust/deps :warning: **This doesn't affect user-compiled programs, it only affects building the Rust compiler itself.** :warning: Right now, `rust.remap-debuginfo = true` doesn't completely remap all paths: while LLVM and rustc sources are properly remapped (respectively to `/rust/llvm` and `/rust/$commit`), Cargo dependencies still use absolute paths from the Cargo home. This never affected builds from CI much, because `CARGO_HOME=/cargo` in CI, so users see paths like this included in the precompiled binaries and libraries: ``` /cargo/registry/src/index.crates.io-6f17d22bba15001f/gimli-0.26.2/src/read/line.rs ``` Builds outside CI don't have remapping though, and it's confusing that the config flag doesn't fully do what it advertises. This PR fixes it by adding remapping for dependencies too. *All registries's* source directory are remapped to `/rust/deps`, to account for multiple registries being able to contain crates.io crates (sparse index vs git, and source replacement mirrors). This results in paths like this being included: ``` /rust/deps/gimli-0.26.2/src/read/line.rs ```
2023-10-24update suggest-testsPietro Albini-2/+7
2023-10-24pass the correct args to compiletestPietro Albini-0/+4
2023-10-24remap cargo dependencies to /rust/depsPietro Albini-1/+33
2023-10-24allow configuring the parent GitHub repositoryPietro Albini-3/+12
The git integration in build_helper hardcoded `rust-lang/rust` as the parent GitHub repository, and `master` as the branch name. This works great for `rust-lang/rust`, but causes problems in downstream forks like Ferrocene whenever those functions are invoked (like `./x fmt`). In `src/stage0.json` there was already a configuration key for the name of the nightly branch, but it wasn't used by build_helper. This commit adds the `github_repository` key to the file, and requires both values to be passed to build_helper whenever a git function is called. This will allow downstream forks to tweak the values.
2023-10-24remove change-id assertion in bootstrap testonur-ozkan-1/+0
In the bootstrap test, the assertion of the change-id fails whenever we update the change-id next to a breaking change in build configurations. This commit removes the assertion, as it's not critical or useful to have. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-23Improve android-ndk property interfacePeter Collingbourne-61/+56
PR #105716 added support for NDK r25b, and removed support for r15. Since the switch to r25b would have broken existing r15 users anyway, let's take the opportunity to make the interface more user friendly. Firstly move the android-ndk property to [build] instead of the targets. This is possible now that the NDK has obsoleted the concept of target-specific toolchains. Also make the property take the NDK root directory instead of the "toolchains/llvm/prebuilt/<host tag>" subdirectory.
2023-10-23Use local_rebuild property to support new check-cfg in case of rebuildUrgau-5/+5
2023-10-23Prepare bootstrap tool for new check-cfg syntaxUrgau-8/+28
2023-10-22Enable cg_clif tests for riscv64gcbjorn3-1/+4
2023-10-22add bootstrap flag `--skip-stage0-validation`onur-ozkan-1/+6
This change introduces the --skip-stage0-validation flag, which permits the use of any desired version of the stage0 compiler without verifying its version. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-22re-enable stage0 compiler version checkonur-ozkan-2/+1
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-19fix(bootstrap) info message show correct path nowVitaliy Busko-1/+1
2023-10-17Simplify BehaviorOnFailureJakub Beránek-14/+17
2023-10-17Rename Supress variantJakub Beránek-5/+9
2023-10-17Remove usages of `Config::try_run`Jakub Beránek-15/+13
Commands should be run on Builder, if possible.
2023-10-17Add output mode to BootstrapCommandJakub Beránek-54/+76
2023-10-17Add behavior on failure to BootstrapCommandJakub Beránek-37/+37
2023-10-17Add BootstrapCommand and `run_cmd`Jakub Beránek-9/+47
2023-10-17Don't pass `-stdlib=libc++` when building C files on macOSZalathar-4/+3
When using *Command Line Tools for Xcode* version 15.0, clang will warn about `argument unused during compilation: '-stdlib=libc++'` if this flag is present when compiling C files only (i.e. no C++ files). To avoid this warning, we can add the flag only to CXXFLAGS and not to CFLAGS.
2023-10-17bootstrap: fix warningsonur-ozkan-2/+1
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-17rename bootstrap module utils/dylib_util->utils/dylibonur-ozkan-4/+4
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-17move bootstrap utils into bootstrap/src/utils moduleonur-ozkan-861/+297
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-17move bootstrap core implementation to bootstrap/src/core moduleonur-ozkan-189/+792
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-17improve bootstrap tests structureonur-ozkan-10/+10
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-17reorganize bootstrap bins and helper module utilizationsonur-ozkan-35/+19
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-16Rollup merge of #116430 - onur-ozkan:vendoring-in-tarball-sources, r=clubby789Matthias Krüger-6/+9
vendoring in tarball sources fixes #94782
2023-10-15add x.py.zsh to tidy checkonur-ozkan-1/+2
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-15optimize `GenerateCompletions::run`onur-ozkan-17/+18
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-15generate zsh autocompletion for xonur-ozkan-2/+5
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-15bump bootstrap:clap_complete to `4.4.3`onur-ozkan-3/+3
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-10-15Auto merge of #116635 - onur-ozkan:improve-file-read, r=Mark-Simulacrumbors-11/+50
optimize file read in `Config::verify` `Config::verify` refactored to improve the efficiency and memory usage of file hashing.
2023-10-14Auto merge of #116352 - Kobzol:rustc-driver-bolt, r=Mark-Simulacrumbors-0/+16
Optimize `librustc_driver.so` with BOLT This PR optimizes `librustc_driver.so` on 64-bit Linux CI with BOLT. ### Code One thing that's not clear yet to me how to resolve is how to best pass a linker flag that we need for BOLT (the second commit). It is currently passed unconditionally, which is not a good idea. We somehow have to: 1) Only pass it when we actually plan to use BOLT. How to best do that? `config.toml` entry? Environment variable? CLI flag for bootstrap? BOLT optimization is done by `opt-dist`, therefore bootstrap doesn't know about it by default. 2) Only pass it to `librustc_driver.so` (see performance below). Some discussion of this flag already happened on [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/Adding.20a.20one-off.20linker.20flag). ### Performance Latest perf. results can be found [here](https://github.com/rust-lang/rust/pull/102487#issuecomment-1743469053). Note that instruction counts are not very interesting here, there are only regressions on hello world programs. Probably caused by a larger C++ libstd (?). Summary: - :heavy_check_mark: `-1.8%` mean improvement in cycle counts across many primary benchmarks. - :heavy_check_mark: `-1.8%` mean Max-RSS improvement. - :heavy_multiplication_x: 34 MiB (+48%) artifact size regression of `librustc_driver.so`. - This is caused by building `librustc_driver.so` with relocations (which are required for BOLT). Hopefully, it will be [fixed](https://discourse.llvm.org/t/bolt-rfc-a-new-mode-to-rewrite-entire-binary/68674) in the future with BOLT improvements, but now trying to reduce this size increase is [tricky](https://github.com/rust-lang/rust/pull/114649). - Note that the size of this file was recently reduced in https://github.com/rust-lang/rust/pull/115554 by pretty much the same amount (33 MiB). So the size after this PR is basically the same as it was for the last ~year. - :heavy_multiplication_x: 1.4 MiB (+53%) artifact size regression of `rustc`. - This is annoying and pretty much unnecessary. It is caused by the way relocations are currently applied in this PR, because they are applied both to `librustc_driver.so` (where they are needed) and for `rustc` (where they aren't needed), since both are built with a single cargo invocation. We might need e.g. some tricks in the bootstrap `rustc` shim to only apply the relocation flag for the shared library and not for `rustc`. ### CI time CI (try build) got slower by ~5 minutes, which is fine, IMO. It can be further reduced by running LLVM and `librustc_driver` BOLT profile gathering at the same time (now they are gathered separately for LLVM and `librustc_driver`). r? `@Mark-Simulacrum` Also CC `@onur-ozkan,` primarily for the bootstrap linker flag issue.