about summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2024-06-11cargo -Zcheck-cfg is now stablePietro Albini-1/+0
2024-06-11remove cfg(bootstrap)Pietro Albini-8/+2
2024-06-10Revert "Update `rustc-perf` submodule before running tidy"onur-ozkan-2/+0
This reverts commit faac70b66e5135717a651dd3f13e6504e7b0c8c9.
2024-06-10Update `rustc-perf` submodule before running tidyJakub Beránek-0/+2
2024-06-10Auto merge of #126206 - Kobzol:disable-libstdc++-version-check, ↵bors-1/+0
r=Mark-Simulacrum Remove libstdc++ version check error This keeps the error message from https://github.com/rust-lang/rust/pull/125411, but removes the `exit(1)` call. This PR is mostly a hotfix to unblock bootstrap benchmarks in rustc-perf. However, I think that it might be better to just print a warning, in general. If the ABI version does not match, the build might or might not work locally (as we can see on rustc-perf, where it works even if the reported ABI is 7). If it does not work (and **if** we can always recognize this during the LLVM wrapper build, instead of having some silent miscompilations), then the user will have to update their libstdc++ anyway, the error does not help them out on its own. So it should be enough to just provide a better error message, without blocking the build. But I'm not adamant on that, I just want to unblock bootstrap benchmarks until we can find a way to update libstdc++ on the collector machine. CC `@onur-ozkan` r? `@Mark-Simulacrum`
2024-06-10Auto merge of #126153 - onur-ozkan:fix-rustdoc-issue-with-ci-rustc, ↵bors-27/+40
r=Mark-Simulacrum resolve rustdoc incompatibility with `rust.download-rustc=true` + `rust.channel= beta/stable` Previously, we were unable to use `rust.download-rustc` with the beta or stable channel settings through `rust.channel` due to breaking rustdoc UI tests. This was because when using a precompiled nightly compiler from CI, we must use the channel of precompiled compiler and ignore `rust.channel` from the configuration. This change addresses that issue in `Builder::doc_rust_lang_org_channel` and allows rustdoc UI tests to work with the precompiled compiler even if the channel specified in config.toml is "beta" or "stable". Blocker for https://github.com/rust-lang/rust/pull/122709
2024-06-09Remove libstdc++ version checkJakub Beránek-1/+0
2024-06-09remove the outdated incompatibility checkonur-ozkan-13/+2
This check is no longer needed as rustdoc ui tests works with any channel + precompiled compiler. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-09fix `Builder::doc_rust_lang_org_channel`onur-ozkan-14/+38
Previously, we were unable to use `rust.download-rustc` with the beta or stable channel settings through `rust.channel` due to breaking rustdoc UI tests. This was because when using a precompiled nightly compiler from CI, we must use the channel of precompiled compiler and ignore `rust.channel` from the configuration. This change addresses that issue in `Builder::doc_rust_lang_org_channel` and allows rustdoc UI tests to work with the precompiled compiler even if the channel specified in config.toml is "beta" or "stable". Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-09Rollup merge of #125465 - weihanglo:opt-dist-vendor, r=Mark-Simulacrum许杰友 Jieyou Xu (Joe)-0/+15
bootstrap: vendor crates required by opt-dist to collect profiles These are the default package set required by opt-dist to correctly work, hence for people wanting to build a production grade of rustc in a sandboxed / air-gapped environment, these need to be vendored. The size of `rustc-src-nightly.tar.xz` before and after this change: * Before: 298M * After: 323M (+8%) Size change might or might not be a concern. See the previous discussion: https://github.com/rust-lang/rust/pull/125166#issuecomment-2113626468 Previous efforts on making: * https://github.com/rust-lang/rust/pull/125125 * https://github.com/rust-lang/rust/pull/125166 --- Note that extra works still need to be done to make it fully vendored. * The current pinned rustc-perf uses `tempfile::Tempdir` as the working directory when collecting profiles from some of these packages. This "tmp" working directory usage make it impossible for Cargo to pick up the correct vendor sources setting in `.cargo/config.toml` bundled in the rustc-src tarball. [^1] * opt-dist verifies the final built rustc against a subset of rustc test suite. However it rolls out its own `config.toml` without setting `vendor = true`, and that results in `./vendor/` directory removed. [^2] [^1]: https://github.com/rust-lang/rustc-perf/blob/4f313add609f43e928e98132358e8426ed3969ae/collector/src/compile/benchmark/mod.rs#L164-L173 [^2]: https://github.com/rust-lang/rust/blob/606afbb617a2949a4e35c4b0258ff94c980b9451/src/tools/opt-dist/src/tests.rs#L62-L77
2024-06-09feat: vendor crates required by opt-dist to collect profilesWeihang Lo-0/+15
These are the default package set required by opt-dist to correctly work, hence for people wanting to build a production grade of rustc in a sandboxed / air-gapped environment, these need to be vendored. The size of `rustc-src-nightly.tar.xz` before and after this change: * Before: 298M * After: 323M (+8%) These crates are the default set of packages required by opt-dist to correctly work, hence for people wanting to build a production grade of rustc in an sandboxed / air-gapped environment, these need to be vendored. The size of `rustc-src-nightly.tar.xz` before and after this change: * Before: 298M * After: 323M (+8%) Size change might or might not be a concern. See the previous discussion: https://github.com/rust-lang/rust/pull/125166#issuecomment-2113626468 Previous efforts on making: * https://github.com/rust-lang/rust/pull/125125 * https://github.com/rust-lang/rust/pull/125166 --- Note that extra works still need to be done to make it fully vendored. * The current pinned rustc-perf uses `tempfile::Tempdir` as the working directory when collecting profiles from some of these packages. This "tmp" working directory usage make it impossible for Cargo to pick up the correct vendor sources setting in `.cargo/config.toml` bundled in the rustc-src tarball. [^1] * opt-dist verifies the final built rustc against a subset of rustc test suite. However it rolls out its own `config.toml` without setting `vendor = true`, and that results in `./vendor/` directory removed. [^2] [^1]: https://github.com/rust-lang/rustc-perf/blob/4f313add609f43e928e98132358e8426ed3969ae/collector/src/compile/benchmark/mod.rs#L164-L173 [^2]: https://github.com/rust-lang/rust/blob/606afbb617a2949a4e35c4b0258ff94c980b9451/src/tools/opt-dist/src/tests.rs#L62-L77
2024-06-09Remove empty test suite `tests/run-make-fulldeps`Zalathar-8/+0
2024-06-09Identify run-make tests by mode name instead of suite nameZalathar-5/+3
2024-06-08Miri std tests: don't set BOOTSTRAP_SKIP_TARGET_SANITY unnecessarilyRalf Jung-3/+4
2024-06-07Rollup merge of #125781 - onur-ozkan:improve-tool-builder, r=albertlarsan68Matthias Krüger-3/+1
prefer `compile::stream_cargo` for building tools Previously, we were running bare commands for `ToolBuild` step and were unable to utilize some of the flags which are already handled by `compile::stream_cargo`. This change makes `ToolBuild` to use `compile::stream_cargo`, allowing us to benefit from the flags supported by the bootstrap cargo. Resolves #125666
2024-06-06Rollup merge of #126086 - onur-ozkan:use-exe, r=petrochenkovJubilee-1/+1
use windows compatible executable name for libcxx-version Resolves #https://github.com/rust-lang/rust/pull/125411#discussion_r1629915724
2024-06-06Rollup merge of #126051 - nnethercote:clarify-x-fmt-error, r=NilstriebJubilee-1/+3
Clarify an `x fmt` error. For anyone who was using paths with `x fmt` previously, make the error message a bit clearer. r? ```@GuillaumeGomez```
2024-06-06use windows compatible executable name for libcxx-versiononur-ozkan-1/+1
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-06prefer compile::stream_cargo for building toolsonur-ozkan-3/+1
Previously, we were running bare commands for `ToolBuild` step and were unable to utilize some of the flags which are already handled by `compile::stream_cargo`. This change makes `ToolBuild` to use `compile::stream_cargo`, allowing us to benefit from the flags supported by the bootstrap cargo. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-06Auto merge of #125411 - onur-ozkan:sanity-check-libstdc++, r=Mark-Simulacrumbors-0/+89
check host's libstdc++ version when using ci llvm If the host's libstdc++ version is too old using ci-llvm may result in an ABI mismatch between the local libstdc++ and libLLVM.so. This PR adds a sanity check to immediately fail at the beginning of the bootstrap before starting the actual build. I am not sure if '8' is the best threshold, but it should be a good start and we can increase it anytime if needed. Fixes #123037
2024-06-06use `bootstrap-self-test` feature on libstd checkonur-ozkan-3/+8
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-06add FIXME on libcxx checkonur-ozkan-5/+1
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-06check host's libstdc++ version when using ci llvmonur-ozkan-1/+89
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-06Rollup merge of #124731 - dalance:add_translation_support, r=ehussMatthias Krüger-11/+29
Add translation support by mdbook-i18n-helpers to bootstrap This PR add translation support by [mdbook-i18n-helpers](https://github.com/google/mdbook-i18n-helpers) to bootstrap. This is draft PR because there is the dependency to my forked mdbook-i18n-helpers. If this PR is acceptable, I'll send a PR to the original mdbook-i18n-helpers and remove draft after changing the dependency to the original. Closes #124641
2024-06-06Clarify an `x fmt` error.Nicholas Nethercote-1/+3
2024-06-05Rollup merge of #125911 - onur-ozkan:wipe-broken-cache, r=albertlarsan68Matthias Krüger-1/+17
delete bootstrap build before switching to bumped rustc Technically, wiping bootstrap builds can increase the build time. But in practice, trying to manually resolve post-bump issues and even accidentally removing the entire build directory will result in a much greater loss of time. After all, the bootstrap build process is not a particularly lengthy operation. Workaround for #125578
2024-06-04bootstrap: implement new feature `bootstrap-self-test`onur-ozkan-38/+49
Some of the bootstrap logics should be ignored during unit tests because they either make the tests take longer or cause them to fail. Therefore we need to be able to exclude them from the bootstrap when it's called by unit tests. This change introduces a new feature called `bootstrap-self-test`, which is enabled on bootstrap unit tests by default. This allows us to keep the logic separate between compiler builds and bootstrap tests without needing messy workarounds (like checking if target names match those in the unit tests). Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-03Add translation support by mdbook-i18n-helpers to bootstrapdalance-11/+29
2024-06-03wipe bootstrap build before switching to bumped rustconur-ozkan-1/+17
Technically, wiping bootstrap builds can increase the build time. But in practice, trying to manually resolve post-bump issues and even accidentally removing the entire build directory will result in a much greater loss of time. After all, the bootstrap build process is not a particularly lengthy operation. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-01include missing submodule on bootstraponur-ozkan-1/+2
As of https://github.com/rust-lang/rust/pull/125408 PR, rustbook now relies on dependencies from the "src/doc/book" submodule. However, bootstrap does not automatically sync this submodule before reading metadata informations. And if the submodule is not present, reading metadata will fail because rustbook's dependencies will be missing. This change makes "src/doc/book" to be fetched/synced automatically before trying to read metadata. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-05-31Use `Builder::tool_exe` to build the coverage-dump toolZalathar-4/+1
This appears to be the canonical way to build a tool with the stage 0 compiler.
2024-05-31Use `coverage-dump --demangle` as the demangler for coverage-run testsZalathar-12/+1
This avoids the need to build `rust-demangler` when running coverage tests, since we typically need to build `coverage-dump` anyway.
2024-05-30Rollup merge of #125699 - nnethercote:streamline-rustfmt, r=GuillaumeGomezLeón Orell Valerian Liehr-114/+102
Streamline `x fmt` and improve its output - Removes the ability to pass paths to `x fmt`, because it's complicated and not useful, and adds `--all`. - Improves `x fmt` output. - Improves `x fmt`'s internal code. r? ``@GuillaumeGomez``
2024-05-29Add Xtensa as an experimental targetScott Mabin-1/+1
2024-05-29Clarify the closure in `rustfmt`.Nicholas Nethercote-7/+10
- Avoid calling `try_wait` followed immediately by `wait`. - Make the match exhaustive. - Improve the comment.
2024-05-29Rename `fmt_override`.Nicholas Nethercote-9/+8
It's a weird name, the `fmt_` prefix seems unnecessary.
2024-05-29Adjust `x fmt` printed output.Nicholas Nethercote-29/+45
Currently, `x fmt` can print two lists of files. - The untracked files that are skipped. Always done if within a git repo. - The modified files that are formatted. But if you run with `--all` (or with `GITHUB_ACTIONS=true`) it doesn't print anything about which files are formatted. This commit increases consistency. - The formatted/checked files are now always printed. And it makes it clear why a file was formatted, e.g. with "modified". - It uses the same code for both untracked files and formatted/checked files. This means that now if there are a lot of untracked files just the number will be printed, which is like the old behaviour for modified files. Example output: ``` fmt: skipped 31 untracked files fmt: formatted modified file compiler/rustc_mir_transform/src/instsimplify.rs fmt: formatted modified file compiler/rustc_mir_transform/src/validate.rs fmt: formatted modified file library/core/src/ptr/metadata.rs fmt: formatted modified file src/bootstrap/src/core/build_steps/format.rs ``` or (with `--all`): ``` fmt: checked 3148 files ```
2024-05-29Clarify `x fmt` messages.Nicholas Nethercote-17/+16
- Precede them all with `fmt` so it's clear where they are coming from. - Use `error:` and `warning:` when appropriate. - Print warnings to stderr instead of stdout
2024-05-29Remove path choice from `x fmt` and add `--all` option.Nicholas Nethercote-59/+30
By default, `x fmt` formats/checks modified files. But it also lets you choose one or more paths instead. This adds significant complexity to `x fmt`. Explicit paths are specified via `WalkBuilder::add` rather than `OverrideBuilder::add`. The `ignore` library is not simple, and predicting the interactions between the two mechanisms is difficult. Here's a particularly interesting case. - You can request a path P that is excluded by the `ignore` list in the `rustfmt.toml`. E.g. `x fmt tests/ui/` or `x fmt tests/ui/bitwise.rs`. - `x fmt` will add P to the walker (via `WalkBuilder::add`), traverse it (paying no attention to the `ignore` list from the `rustfmt.toml` file, due to the different mechanism), and call `rustfmt` on every `.rs` file within it. - `rustfmt` will do nothing to those `.rs` files, because it *also* reads `rustfmt.toml` and sees that they match the `ignore` list! It took me *ages* to debug and understand this behaviour. Not good! `x fmt` even lets you name a path below the current directory. This was intended to let you do things like `x fmt std` that mirror things like `x test std`. This works by looking for `std` and finding `library/std`, and then formatting that. Unfortuantely, this motivating case now gives an error. When support was added in #107944, `library/std` was the only directory named `std`. Since then, `tests/ui/std` was added, and so `x fmt std` now gives an error. In general, explicit paths don't seem particularly useful. The only two cases `x fmt` really needs are: - format/check the files I have modified (99% of uses) - format/check all files (While respecting the `ignore` list in `rustfmt.toml`, of course.) So this commit moves to that model. `x fmt` will now give an error if given an explicit path. `x fmt` now also supports a `--all` option. (And running with `GITHUB_ACTIONS=true` also causes everything to be formatted/checked, as before.) Much simpler!
2024-05-29Rollup merge of #125639 - ChrisDenton:run-make-support-doc, r=onur-ozkan许杰友 Jieyou Xu (Joe)-0/+9
Support `./x doc run-make-support --open` Having easy access to the run-make-support documentation is invaluable when creating run-make tests using the new Rust recipes.
2024-05-29Rollup merge of #125226 - madsmtm:fix-mac-catalyst-tests, r=workingjubilee许杰友 Jieyou Xu (Joe)-1/+1
Make more of the test suite run on Mac Catalyst Combined with https://github.com/rust-lang/rust/pull/125225, the only failing parts of the test suite are in `tests/rustdoc-js`, `tests/rustdoc-js-std` and `tests/debuginfo`. Tested with: ```console ./x test --target=aarch64-apple-ios-macabi library/std ./x test --target=aarch64-apple-ios-macabi --skip=tests/rustdoc-js --skip=tests/rustdoc-js-std --skip=tests/debuginfo tests ``` Will probably put up a PR later to enable _running_ on (not just compiling for) Mac Catalyst in CI, though not sure where exactly I should do so? `src/ci/github-actions/jobs.yml`? Note that I've deliberately _not_ enabled stack overflow handlers on iOS/tvOS/watchOS/visionOS (see https://github.com/rust-lang/rust/issues/25872), but rather just skipped those tests, as it uses quite a few APIs that I'd be weary about getting rejected by the App Store (note that Swift doesn't do it on those platforms either). r? ``@workingjubilee`` CC ``@thomcc`` ``@rustbot`` label O-ios O-apple
2024-05-28Make more of the test suite run on Mac CatalystMads Marquart-1/+1
This adds the `only-apple`/`ignore-apple` compiletest directive, and uses that basically everywhere instead of `only-macos`/`ignore-macos`. Some of the updates in `run-make` are a bit redundant, as they use `ignore-cross-compile` and won't run on iOS - but using Apple in these is still more correct, so I've made that change anyhow.
2024-05-28Don't format `tests/run-make/*/rmake.rs`.Nicholas Nethercote-2/+9
It's reasonable to want to, but in the current implementation this causes multiple problems. - All the `rmake.rs` files are formatted every time even when they haven't changed. This is because they get whitelisted unconditionally in the `OverrideBuilder`, before the changed files get added. - The way `OverrideBuilder` works, if any files gets whitelisted then no unmentioned files will get traversed. This is surprising, and means that the `rmake.rs` entries broke the use of explicit paths to `x fmt`, and also broke `GITHUB_ACTIONS=true git check --fmt`. The commit removes the `rmake.rs` entries, fixes the formatting of a couple of files that were misformatted (not previously caught due to the `GITHUB_ACTIONS` breakage), and bans `!`-prefixed entries in `rustfmt.toml` because they cause all these problems.
2024-05-28Fix comments.Nicholas Nethercote-14/+17
Some are too long, some aren't complete sentences, some are complete sentences but don't bother with an upper case letter at the start. All annoying and hurt readability.
2024-05-28Add run-make-support to x docChris Denton-0/+9
2024-05-27Rollup merge of #125535 - onur-ozkan:remove-deprecated-field, r=clubby789Guillaume Gomez-4/+5
clean-up: remove deprecated field `dist.missing-tools` It's been 5 months since this field was deprecated.
2024-05-25Auto merge of #125515 - weihanglo:target-toml-override, r=onur-ozkanbors-5/+59
bootstrap: support target specific config overrides Can't find any previous discussion about not supporting this, so I get it done. The motivation of this is from <https://github.com/rust-lang/rust/pull/125473#issuecomment-2129954990>.
2024-05-25add change entryonur-ozkan-0/+5
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-05-25Remove deprecated field `dist.missing-tools`onur-ozkan-4/+0
It's been 5 months since this field was deprecated. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-05-24bootstrap: test target specific config overridesWeihang Lo-4/+45
Debug, PartialEq, and Eq are derived for testing purposes.