about summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
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
2024-05-20chore(bootstrap/core/build_steps/dist): add fixme for duplicated vendor logicBernardo Meurer Costa-0/+3
2024-05-20refactor(bootstrap): update rustc-perf submodule when building opt-distBernardo Meurer Costa-2/+39
This avoids having normal builds pay the cost of initializing that submodule, while still ensuring it's available whenever `opt-dist` is built. Note that, at this point, `opt-dist` will not yet use the submodule, that will be handled in a subsequent commit.
2024-05-20Auto merge of #124560 - madsmtm:update-libc, r=Mark-Simulacrumbors-2/+2
Update libc to 0.2.155 Motivation: To fix `-Zbuild-std` / Xargo for visionOS targets. EDIT: Blocked on ~https://github.com/rust-lang/libc/issues/3608 / https://github.com/rust-lang/libc/pull/3609~ ~https://github.com/rust-lang/libc/pull/3682 and https://github.com/rust-lang/libc/pull/3690~ No longer blocked.
2024-05-19Auto merge of #124674 - onur-ozkan:followup-124461, r=pietroalbinibors-6/+18
keep the `STAGE0_MISSING_TARGETS` list updated Implements https://github.com/rust-lang/rust/pull/124461#issuecomment-2092574309. r? pietroalbini
2024-05-18keep the `STAGE0_MISSING_TARGETS` list updatedonur-ozkan-6/+18
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-05-18Update libc to 0.2.155Mads Marquart-2/+2
2024-05-17Rollup merge of #125181 - onur-ozkan:set-rust-channel-properly, r=clubby789Matthias Krüger-2/+9
set `rust.channel` properly in source tarballs This change sets the appropriate channel by default when using nightly, beta or stable source tarballs. Fixes #124618
2024-05-16add bootstrap config change info about `rust.lld`Rémy Rakic-0/+5
the default value changes on `x86_64-unknown-linux-gnu`, and semantics kinda as it will impact the target's default linker
2024-05-16bootstrap: enable rust-lld when necessary for `x86_64-unknown-linux-gnu`Rémy Rakic-11/+40
`x86_64-unknown-linux-gnu` has switched to using the self-contained linker by default (unless asked not to), so we have to build rust-lld: - when we build our own llvm - when we use download-ci-llvm - otherwise, when using an external llvm we can't enable it
2024-05-16bootstrap: introduce rust-lld env var for rustcRémy Rakic-0/+5
This is used to notify we want to use rust-lld as the default linker in a target.
2024-05-16set `rust.channel` properly in source tarballsonur-ozkan-2/+9
This change sets the appropriate channel by default when using nightly, beta or stable source tarballs. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-05-15Set `debuginfo-level = "line-tables-only"` for compiler profileJubilee Young-0/+7
This profile has only undergone minimal tweaks since it was originally drafted. I asked a number of compiler contributors and they said they set rust.debug explicitly. This was even true for one contributor that set `rust.debug` = false! Almost everyone seems slightly surprised that `rust.debug = true` is not the default. However, adding full debuginfo at this level costs multiple gigabytes! We can still get much better debuginfo by setting "line-tables-only" at the cost of only 150~200 MB.
2024-05-13Use an helper to move the filesLuca Barbato-7/+24
In case the source is not in the same filesystem.
2024-05-12Auto merge of #124883 - onur-ozkan:change-stage0-file, r=Mark-Simulacrumbors-52/+32
use key-value format in stage0 file Currently, we are working on the python removal task on bootstrap. Which means we have to extract some data from the stage0 file using shell scripts. However, parsing values from the stage0.json file is painful because shell scripts don't have a built-in way to parse json files. This change simplifies the stage0 file format to key-value pairs, which makes it easily readable from any environment. See the zulip thread for more details: https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/Using.20different.20format.20in.20the.20stage0.20file
2024-05-11use shared stage0 parser from `build_helper`onur-ozkan-38/+8
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-05-11Rollup merge of #124969 - onur-ozkan:test-tests-remap, r=Mark-SimulacrumMatthias Krüger-0/+23
check if `x test tests` missing any test directory Add a unit test to ensure we don't skip any test directories for `x test tests` in the future.