summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2024-06-11ensure the self-contained linker is only enabled on nightly/devRémy Rakic-1/+3
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-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.
2024-05-24bootstrap: support target specific config overridesWeihang Lo-1/+14
2024-05-24Rollup merge of #125481 - iawia002:fix-dead-link, r=lqdMatthias Krüger-1/+1
Fix the dead link in the bootstrap README This link has been changed since https://github.com/rust-lang/rustc-dev-guide/pull/1939
2024-05-24Rollup merge of #125477 - nnethercote:missed-rustfmt, r=compiler-errorsMatthias Krüger-8/+31
Run rustfmt on files that need it. Somehow these files aren't properly formatted. By default `x fmt` and `x tidy` only check files that have changed against master, so if an ill-formatted file somehow slips in it can stay that way as long as it doesn't get modified(?) I found these when I ran `x fmt` explicitly on every `.rs` file in the repo, while working on https://github.com/rust-lang/compiler-team/issues/750.
2024-05-24Fix the dead link in the bootstrap READMEXinzhao Xu-1/+1
2024-05-24Run rustfmt on files that need it.Nicholas Nethercote-8/+31
Somehow these files aren't properly formatted. By default `x fmt` and `x tidy` only check files that have changed against master, so if an ill-formatted file somehow slips in it can stay that way as long as it doesn't get modified(?) I found these when I ran `x fmt` explicitly on every `.rs` file in the repo, while working on https://github.com/rust-lang/compiler-team/issues/750.
2024-05-23Move some expected cfgs to std build.rs as per Cargo recommandationUrgau-3/+0
2024-05-23Replace fake "restricted-std" Cargo feature by custom cfgUrgau-0/+1
2024-05-22Rollup merge of #125296 - tesuji:checkcfg-buildstd, r=Nilstrieb,michaelwoeristerLeón Orell Valerian Liehr-0/+3
Fix `unexpected_cfgs` lint on std closes #125291 r? rust-lang/compiler
2024-05-21maybe replace check-cfg values in bootstrap with ones in Cargo.tomlLzu Tao-0/+2
2024-05-21addresss reviewsLzu Tao-0/+1
2024-05-21Don't do cc detection for synthetic targetsBen Kimock-4/+1
2024-05-20Auto merge of #125166 - lovesegfault:embed-rustc-perf, r=Mark-Simulacrumbors-2/+46
refactor: add rustc-perf submodule to src/tools Currently, it's very challenging to perform a sandboxed `opt-dist` bootstrap because the tool requires `rustc-perf` to be present, but there is no proper management/tracking of it. Instead, a specific commit is hardcoded where it is needed, and a non-checksummed zip is fetched ad-hoc. This happens in two places: `src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile`: ```dockerfile ENV PERF_COMMIT 4f313add609f43e928e98132358e8426ed3969ae RUN curl -LS -o perf.zip https://ci-mirrors.rust-lang.org/rustc/rustc-perf-$PERF_COMMIT.zip && \ unzip perf.zip && \ mv rustc-perf-$PERF_COMMIT rustc-perf && \ rm perf.zip ``` `src/tools/opt-dist/src/main.rs` ```rust // FIXME: add some mechanism for synchronization of this commit SHA with // Linux (which builds rustc-perf in a Dockerfile) // rustc-perf version from 2023-10-22 const PERF_COMMIT: &str = "4f313add609f43e928e98132358e8426ed3969ae"; let url = format!("https://ci-mirrors.rust-lang.org/rustc/rustc-perf-{PERF_COMMIT}.zip"); let client = reqwest::blocking::Client::builder() .timeout(Duration::from_secs(60 * 2)) .connect_timeout(Duration::from_secs(60 * 2)) .build()?; let response = retry_action( || Ok(client.get(&url).send()?.error_for_status()?.bytes()?.to_vec()), "Download rustc-perf archive", 5, )?; ``` This causes a few issues: 1. Maintainers need to be careful to bump PERF_COMMIT in both places every time 2. In order to run `opt-dist` in a sandbox, you need to provide your own `rustc-perf` (https://github.com/rust-lang/rust/pull/125125), but to figure out which commit to provide you need to grep the Dockerfile 3. Even if you manage to provide the correct `rustc-perf`, its dependencies are not included in the `vendor/` dir created during `dist`, so it will fail to build from the published source tarballs 4. It is hard to provide any level of automation around updating the `rustc-perf` in use, leading to staleness Fundamentally, this means `rustc-src` tarballs no longer contain everything you need to bootstrap Rust, and packagers hoping to leverage `opt-dist` need to go out of their way to keep track of this "hidden" dependency on `rustc-perf`. This change adds rustc-perf as a git submodule, pinned to the current `PERF_COMMIT` 4f313add609f43e928e98132358e8426ed3969ae. Subsequent commits ensure the submodule is initialized when necessary, and make use of it in `opt-dist`.
2024-05-20Auto merge of #118014 - ↵bors-12/+2
keith:ks/remove-unnecessary-fembed-bitcode-usage-now-that-it-s-deprecated, r=clubby789 Remove unnecessary -fembed-bitcode usage now that it's deprecated This is a partial revert of 6d819a4b8f45b170e7c2c415df20cfa2e0cbbf7f because https://github.com/rust-lang/cc-rs/pull/812 removed this flag entirely, meaning we shouldn't have to pass this manually anymore
2024-05-20refactor(bootstrap/core/build_steps/dist): vendor dependencies needed for ↵Bernardo Meurer Costa-0/+4
opt-dist