This reduces check times for miri from 2m15s to 20s. And reduces check
times for miri with --compile-time-deps from 1m50s to 7s. This makes
rust-analyzer start a lot faster after switching branches.
bootstrap: Replace `Step::DEFAULT` and `default_condition` with `is_default_step`
- Revised and expanded version of https://github.com/rust-lang/rust/pull/148965
---
One of the confusing things about bootstrap's `Step::should_run` is that it combines two loosely-related but non-overlapping responsibilities:
- Registering paths/aliases to decide whether a step should be run in response to paths/aliases passed as explicit command-line arguments
- When the user invokes `./x test compiler`, this allows bootstrap to know what steps “compiler” should translate into
- Deciding whether a step marked `DEFAULT = true` should actually run or not, when no paths/aliases are explicitly specified
- When the user invokes `./x test`, this allows bootstrap to know which steps to run by default
This PR therefore splits out the latter of those responsibilities into a dedicated `is_default_step` associated function, which also replaces the existing `DEFAULT` associated constant.
A small number of steps were using `ShouldRun::lazy_default_condition` to specify a condition that should not be run repeatedly if possible, e.g. because it queries external tools. Those steps now perform memoization via fields in `Builder` instead.
r? jieyouxu
Fix typo and clarify bootstrap change tracker entry
mostly: `par` -> `per`
but also move some words around and hyphenate to (hopefully) make sentence a bit clearer
v0 mangling for std on nightly
Following rust-lang/rust#89917 and rust-lang/compiler-team#938, it doesn't make sense that `std` for these channels would have legacy mangling while the user's code would use `v0`.
r? `@Kobzol`
This allows LTO to work when compiling jemalloc, which should yield a
small performance boost, and makes miri's behaviour here match clippy
and rustdoc.
automate gpu offloading - part 1
Automates step 1 from the rustc-dev-guide offload section:
https://rustc-dev-guide.rust-lang.org/offload/usage.html#compile-instructions
`"clang-offload-packager" "-o" "host.out" "--image=file=device.bc,triple=amdgcn-amd-amdhsa,arch=gfx90a,kind=openmp"`
Verified on an MI 250X
cc `@jhuber6,` `@kevinsala,` `@jdoerfert,` `@Sa4dUs`
r? oli-obk
Bump compiler dependencies
https://github.com/rust-lang/rust/pull/145849#issuecomment-3394832713
This manually downgrades the `wasip`/`wit-bindgen`/`getrandom` deps to avoid pulling in a binary blob, but it would be good to pin this automatically in a way which doesn't cause these blobs to be pulled in.
add `rust.rustflags` and per target `rustflags` options to `bootstrap.toml`
Part of rust-lang/rust#148782; see also rust-lang/rust#148708
Add new options `rust.rustflags` for all targets and `rustflags` par target that will pass specified flags to rustc for all stages. Target specific flags override (are passed after) global `rust.rustflags` ones.
This makes easy to persistently pass any flag to the compiler when building rustc. For example you can use a different linker by putting the following in `bootstrap.toml`:
```toml
[rust]
rustflags = ["-Clinker=clang", "-Clink-arg=--ld-path=wild"]
```
r? bootstrap
This makes easy to persistently pass any flag to the compiler when
building rustc.
For example you can use a different linker by putting the following in
`bootstrap.toml`:
```toml
[rust]
rustflags = ["-Clinker=clang", "-Clink-arg=--ld-path=wild"]
```
Build rustc and tools with -Zannotate-moves by default. Adds toml config
options to set the annotation size limit.
This has no measurable effect on output binary size or compile time.
Use rustc target metadata for build-manifest target lists
This ensures that as long as the target metadata is updated to reflect the current state (tier 3 vs 1/2, host toolchain support), the manifest will also be updated. This avoids an extremely common 'oops' when we move targets between tiers.
This mostly removes a bunch of tier 3 targets from manifests. I didn't spot check against produced artifacts but given that they are tier 3 it's probably reasonable to leave it as-is and bug reporters can fix the target metadata in rustc (or we can stop producing artifacts).
Follow-up work would ideally lint the artifact list as part of nightly/beta/stable builds as well, but for now this is simple and hopefully removes at common source of extra PRs when modifying targets.
Manifest list delta:
```diff
--- old
+++ new
-host:i686-apple-darwin
-host:mips-unknown-linux-gnu
-host:mips64-unknown-linux-gnuabi64
-host:mips64el-unknown-linux-gnuabi64
-host:mipsel-unknown-linux-gnu
-host:mipsisa32r6-unknown-linux-gnu
-host:mipsisa32r6el-unknown-linux-gnu
-host:mipsisa64r6-unknown-linux-gnuabi64
-host:mipsisa64r6el-unknown-linux-gnuabi64
-target:aarch64-unknown-hermit
-target:aarch64-unknown-managarm-mlibc
-target:aarch64-unknown-redox
-target:amdgcn-amd-amdhsa
-target:arm64e-apple-darwin
-target:arm64e-apple-ios
-target:arm64e-apple-tvos
-target:armebv7r-none-eabi
-target:armebv7r-none-eabihf
-target:armv7s-apple-ios
-target:bpfeb-unknown-none
-target:bpfel-unknown-none
-target:csky-unknown-linux-gnuabiv2
-target:csky-unknown-linux-gnuabiv2hf
-target:i386-apple-ios
-target:i586-unknown-redox
-target:i686-apple-darwin
-target:loongarch32-unknown-none
-target:loongarch32-unknown-none-softfloat
-target:m68k-unknown-linux-gnu
-target:m68k-unknown-none-elf
-target:mips-mti-none-elf
-target:mips-unknown-linux-gnu
-target:mips-unknown-linux-musl
-target:mips64-unknown-linux-gnuabi64
-target:mips64-unknown-linux-muslabi64
-target:mips64el-unknown-linux-gnuabi64
-target:mips64el-unknown-linux-muslabi64
-target:mipsel-mti-none-elf
-target:mipsel-unknown-linux-gnu
-target:mipsel-unknown-linux-musl
-target:mipsisa32r6-unknown-linux-gnu
-target:mipsisa32r6el-unknown-linux-gnu
-target:mipsisa64r6-unknown-linux-gnuabi64
-target:mipsisa64r6el-unknown-linux-gnuabi64
-target:riscv32gc-unknown-linux-gnu
-target:riscv32im-risc0-zkvm-elf
-target:riscv32ima-unknown-none-elf
-target:riscv64gc-unknown-hermit
-target:riscv64gc-unknown-linux-musl
-target:riscv64gc-unknown-managarm-mlibc
-target:sparc-unknown-none-elf
-target:x86_64-unikraft-linux-musl
-target:x86_64-unknown-hermit
-target:x86_64-unknown-managarm-mlibc
```
This ensures that as long as the target metadata is updated to reflect
the current state (tier 3 vs 1/2, host toolchain support), the manifest
will also be updated. This avoids an extremely common 'oops' when we
move targets between tiers.
This mostly removes a bunch of tier 3 targets from manifests. I didn't
spot check against produced artifacts but given that they are tier 3
it's probably reasonable to leave it as-is and bug reporters can fix the
target metadata in rustc (or we can stop producing artifacts).
Follow-up work would ideally lint the artifact list as part of
nightly/beta/stable builds as well, but for now this is simple and
hopefully removes at common source of extra PRs when modifying targets.
This is for people rebuilding stdlib directly from stage 0
with the full toolchain from rust-src rustup component.
The toolchain itself should have sufficient LLVM tools,
so CMake and LLVM are not required when `build.local-rebuild = true`
bootstrap: respect `build.python` on macOS
The `python()` method was hardcoded to return `/usr/bin/python3` on macOS, ignoring the `build.python` config option. This change respects the config while maintaining the system Python as the default.