Commit Graph

8107 Commits

Author SHA1 Message Date
Zalathar 8b1879864b tool_check_step! no longer needs a builder to determine mode 2025-09-28 17:18:07 +10:00
Zalathar 193f7179cc Build and test compiletest as a stage0 bootstrap tool 2025-09-28 17:18:07 +10:00
Zalathar 7b8ae74da1 Add a bootstrap snapshot test for x test compiletest 2025-09-28 17:18:07 +10:00
Zalathar cc7bd291cd Fix change-tracker entry for 147046 2025-09-28 17:18:07 +10:00
Matthias Krüger 4e9cfc726c Rollup merge of #142139 - erickt:include-hashes, r=Mark-Simulacrum
Include additional hashes in src/stage0

This patch changes `bump-stage0` to include:

* The sha256 hash of the channel manifest used to create `src/stage0`.
* The rust and rustfmt git commit in `src/stage0`.
* Hashes of all the artifacts, like the source tarball, in `src/stage0`.

Combined this will allow for:

* Projects that bootstrap their own compiler, such as Fuchsia, or users of [bootstrap], to build their compilers offline without needing to communicate with static.rust-lang.org.

* Auditors to detect if the channel manifest, and all the artifacts inside the manifest, were modified after it was used to generate `src/stage0`. Furthermore, if they did find modified artifacts, they could determine if the Rust Signing Key was compromised by checking if any modified file was signed properly.

finally, it allows regeneration of `src/stage0` when specifying both the day of the build for rust, and the day of the build for rustfmt, which can allow a maintainer to regenerate `src/stage0` to verify nothing changed.

[bootstrap]: https://github.com/dtolnay/bootstrap
[mrustc]: https://github.com/thepowersgang/mrustc
2025-09-28 09:15:22 +02:00
bors 848e6746fe Auto merge of #147104 - matthiaskrgr:rollup-gap1v0w, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - rust-lang/rust#146037 (Introduce CoerceShared lang item and trait, and basic Reborrow tests)
 - rust-lang/rust#146732 (tests: relax expectations after llvm change 902ddda120a5)
 - rust-lang/rust#147018 (re-order normalizations in run-make linker-warning test)
 - rust-lang/rust#147032 (Fix doctest compilation time display)
 - rust-lang/rust#147046 (Rename `rust.use-lld` to `rust.bootstrap-override-lld`)
 - rust-lang/rust#147050 (PassWrapper: update for new PGOOptions args in LLVM 22)
 - rust-lang/rust#147075 (Make `def_path_hash_to_def_id` not panic when passed an invalid hash)
 - rust-lang/rust#147076 (update issue number for more_float_constants)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-09-27 22:30:56 +00:00
bors 4082d6a3f0 Auto merge of #146927 - Kobzol:install-clif, r=jieyouxu
Make it possible to `x install` Cranelift and LLVM bitcode linker

It was not possible to install these before, as they were not in the install step description list.

Fixes: https://github.com/rust-lang/rust/issues/140331

r? `@jieyouxu`
2025-09-27 19:26:29 +00:00
Matthias Krüger 82dff12cdf Rollup merge of #147046 - Kobzol:bootstrap-ll, r=jieyouxu
Rename `rust.use-lld` to `rust.bootstrap-override-lld`

First part of https://github.com/rust-lang/rust/issues/146640. The old option is kept for backwards compatibility, we can remove it in ~6 months, as usually.

I'm not sure if the bootstrap prefix is ideal, after all we have a bunch of other configs that only affect bootstrap's behavior and not the built artifacts. Maybe `build.override-lld`? But I don't think it matters that much, as long as it's clear that it is an override, and how does it differ from `rust.lld`.

r? ``@jieyouxu``
2025-09-27 21:25:58 +02:00
Erick Tryzelaar d42acf522f Include additional hashes in src/stage0
This patch changes `bump-stage0` to include:

* The sha256 hash of the channel manifest used to create `src/stage0`.
* The rust and rustfmt git commit in `src/stage0`.
* Hashes of all the artifacts, like the source tarball, in `src/stage0`.

Combined this will allow for:

* Projects that bootstrap their own compiler, such as Fuchsia, or users
  of [bootstrap], to build their compilers offline without needing to
  communicate with static.rust-lang.org.

* Auditors to detect if the channel manifest, and all the artifacts
  inside the manifest, were modified after it was used to generate
  `src/stage0`. Furthermore, if they did find modified artifacts, they
  could determine if the Rust Signing Key was compromised by checking if
  any modified file was signed properly.

Finally, it allows regeneration of `src/stage0` when specifying both the
day of the build for rust, and the day of the build for rustfmt, which
can allow a maintainer to regenerate `src/stage0` to verify nothing
changed.

[bootstrap]: https://github.com/dtolnay/bootstrap
[mrustc]: https://github.com/thepowersgang/mrustc
2025-09-27 08:43:22 -04:00
bors 959b450747 Auto merge of #146636 - Mark-Simulacrum:bootstrap-bump, r=jieyouxu
Bump bootstrap compiler to 1.91 beta

https://forge.rust-lang.org/release/process.html#default-branch-bootstrap-update-tuesday
2025-09-27 03:50:03 +00:00
Mark Rousskov 201f299ef6 Apply cfg(bootstrap) replacement 2025-09-26 19:09:23 -04:00
Jakub Beránek 852aa20c90 Rename rust.use-lld to rust.bootstrap-override-lld 2025-09-26 20:21:21 +02:00
Matthias Krüger ebe90c7ae7 Rollup merge of #146758 - mati865:amd64_mingw_no_rs_objects, r=petrochenkov
Stop linking rs{begin,end} objects on x86_64-*-windows-gnu

Until now, x86_64-pc-windows-gnu linked `rsbegin.o` and `rsend.o` just like i686-pc-windows-gnu, even though they were no-ops for it. This was likely done for the simplicity back when it was introduced.
Today the things are different and these startup/end objects harm other features, like `build-std`. Given the demotion of i686-pc-windows-gnu from tier 1, there is no point in hurting x86_64-pc-windows-gnu, which remains a tier 1.

The files are still shipped in case downstream crates expect them, as in case of the unmaintained `xargo`.

Fixes https://github.com/rust-lang/rust/issues/146739
2025-09-26 18:11:10 +02:00
bors a885811104 Auto merge of #146595 - Shourya742:make-cargo-test-work-for-self-test, r=Kobzol
Make cargo test work for  bootstrap self test

This PR enables the bootstrap self-test to run via cargo test. I have removed the detect_src_and_out test for now, but it will be reintroduced in a follow-up PR where all bootstrap tests will be migrated to use testCtx.

r? `@Kobzol`

try-job: aarch64-apple
2025-09-26 12:55:15 +00:00
Matthias Krüger 610a601f36 Rollup merge of #147038 - Kobzol:bootstrap-verbose-fn, r=jieyouxu
Rename verbosity functions in bootstrap

Just a small cleanup, these function names have been bothering me for a while. I realized that we can delete some of them outright, rather than just renaming them.

r? ``@jieyouxu``
2025-09-26 06:36:33 +02:00
Matthias Krüger 07d13a6469 Rollup merge of #146994 - cuviper:clippy-ci-recursion, r=Kobzol
Add `clippy::unconditional_recursion` to `./x clippy ci`

The clippy lint catches some things that rustc's equivalent builtin lint
does not, for example rust-lang/rust#146940:

    error: function cannot return without recursing
        --> library/std/src/path.rs:3428:5
         |
    3428 | /     fn eq(&self, other: &String) -> bool {
    3429 | |         self == &*other
    3430 | |     }
         | |_____^
         |
    note: recursive call site
        --> library/std/src/path.rs:3429:9
         |
    3429 |         self == &*other
         |         ^^^^^^^^^^^^^^^
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unconditional_recursion
         = note: requested on the command line with `-D clippy::unconditional-recursion`
2025-09-26 06:36:32 +02:00
Josh Stone a2d2869924 Add clippy::unconditional_recursion to ./x clippy ci
The clippy lint catches some things that rustc's equivalent builtin lint
does not, for example rust-lang/rust#146940:

    error: function cannot return without recursing
        --> library/std/src/path.rs:3428:5
         |
    3428 | /     fn eq(&self, other: &String) -> bool {
    3429 | |         self == &*other
    3430 | |     }
         | |_____^
         |
    note: recursive call site
        --> library/std/src/path.rs:3429:9
         |
    3429 |         self == &*other
         |         ^^^^^^^^^^^^^^^
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unconditional_recursion
         = note: requested on the command line with `-D clippy::unconditional-recursion`
2025-09-25 10:08:23 -07:00
Jakub Beránek 8ea9122c9b Rename verbose to do_if_verbose 2025-09-25 18:55:59 +02:00
Jakub Beránek 5a6e3ccceb Remove is_verbose_than function 2025-09-25 18:14:33 +02:00
Jakub Beránek 5595f437c7 Remove verbose_than function 2025-09-25 18:13:34 +02:00
Jakub Beránek 191c7ed10f Make cargo test work again 2025-09-25 18:05:26 +02:00
Jakub Beránek 079addf985 Ensure that --build-dir is always specified in tests 2025-09-25 15:07:34 +02:00
J. Neuschäfer 747019ce46 bootstrap.py: Respect build.jobs while building bootstrap tool
On resource-constrained systems, it is vital to respect the value of
build.jobs, in order to avoid overwhelming the available memory.
2025-09-25 12:08:58 +02:00
Jakub Beránek a22334371c Make install test target independent 2025-09-24 21:49:12 +02:00
Jakub Beránek ffca2f0a1e Make it possible to x install Cranelift and LLVM bitcode linker 2025-09-23 11:53:38 +02:00
bit-aloo aaa82aea05 move config check logic from get_toml to parse_inner 2025-09-23 09:02:30 +05:30
Tshepang Mbambo 24144ff499 make rust-analyzer settings use dedicated directory
This avoids rust-analyzer having to wait for a build lock due to ./x
running other commands (and the other way around).
2025-09-22 21:02:37 +02:00
bit-aloo 83b784fda1 add comment explaining the test_build_dir 2025-09-22 18:54:23 +05:30
bit-aloo 8a0e3808c0 add check for toml file 2025-09-22 18:46:18 +05:30
bit-aloo 6adbb3a189 remove explicit target assignment in config during rustc initialization 2025-09-22 18:06:07 +05:30
U. Lasiotus 0138bbd495 Add x86_64-unknown-motor (Motor OS) tier 3 target
Add the initial no-std Motor OS compiler target.

Motor OS has been developed for several years in the open:
https://github.com/moturus/motor-os.

It has a more or less full implementation of Rust std library,
as well as tokio/mio ports.

Build instructions can be found here:
https://github.com/moturus/motor-os/blob/main/docs/build.md.

Signed-off-by: U. Lasiotus <lasiotus@motor-os.org>
2025-09-21 12:43:13 -07:00
bit-aloo 33e262e8cc remove prepare_test_specific_dir and update tests accordingly 2025-09-21 20:58:18 +05:30
bit-aloo a48cd767f6 add explicit config assignment when running the test, as the src is assigned to CARGO_MANIFEST_DIR, so the config actually use the <src>/bootstrap.toml and the /tmp/bootstrap.toml 2025-09-21 20:58:17 +05:30
bit-aloo afe380dd58 initialize out with CARGO_TARGET_DIR and then go for manifest and then for current 2025-09-21 20:58:15 +05:30
bit-aloo 671aabd4eb add dry_run flag in config builder and remove runtime test hacks 2025-09-21 20:56:13 +05:30
bit-aloo 9189bf79d4 remove create_config_without_ci_llvm_override duplication 2025-09-21 20:56:12 +05:30
bit-aloo 0c68c82957 rename config_toml to with_default_toml_config 2025-09-21 20:56:12 +05:30
bit-aloo a29474d3ff this is dicy, whether we have a method to explicitly enable_llvm_override 2025-09-21 20:56:12 +05:30
bit-aloo 05131bd5f1 move most of the test to new testCtx 2025-09-21 20:56:11 +05:30
bit-aloo 24ed1a0455 allow symlinking during test 2025-09-21 20:56:11 +05:30
bit-aloo ce4604e34e remove using default toml config for test in get_toml, we handle it via using the temp directory created via the testCtx 2025-09-21 20:56:10 +05:30
bit-aloo d488d33fd6 let verify method run in test settings 2025-09-21 20:56:10 +05:30
bit-aloo 6c79f547f9 add an API in ConfigBuilder to point to config file for toml parsing 2025-09-21 20:56:09 +05:30
bit-aloo a12969e0d1 walk up the ancestors 2025-09-21 20:56:09 +05:30
bit-aloo 1bc19932e6 make cargo test work for bootstrap self test 2025-09-21 20:56:09 +05:30
Matthias Krüger f5725f0182 Rollup merge of #146774 - Kobzol:bootstrap-relative-path, r=jieyouxu
Allow running `x <cmd> <path>` from a different directory

Fixes: https://github.com/rust-lang/rust/issues/146772

r? ``@jieyouxu``
2025-09-20 17:55:05 +02:00
bors b00998aaa5 Auto merge of #146771 - Kobzol:download-ci-llvm-default-value, r=jieyouxu
Simplify default value of `download-ci-llvm`

Just set it to true, rather than having different default values on CI and locally, and then only deny `true` on our own CI, not elsewhere.

Closes: https://github.com/rust-lang/rust/issues/146768

r? `@jieyouxu`
2025-09-20 08:04:38 +00:00
Jakub Beránek 4b755141bc Simplify default value of download-ci-llvm 2025-09-19 20:12:30 +02:00
Mateusz Mikuła 7eea65f8e0 Stop linking rs{begin,end} on x86_64-*-windows-gnu
Until now, x86_64-pc-windows-gnu linked `rsbegin.o` and `rsend.o` just
like i686-pc-windows-gnu, even though they were no-ops for it.
This was likely done for the simplicity back when it was introduced.

Today the things are different and these startup/end objects harm other
features, like `build-std`. Given the demotion of i686-pc-windows-gnu
from tier 1, there is no point in hurting x86_64-pc-windows-gnu,
which remains a tier 1.

The files are still shipped in case downstream crates expect them, as in
case of the unmaintained `xargo`.
2025-09-19 19:06:15 +02:00
Jakub Beránek 58814bce6c Allow running x <cmd> <path> from a different directory 2025-09-19 16:21:34 +02:00