Commit graph

8064 commits

Author SHA1 Message Date
Stuart Cook
62b72bd545
Rollup merge of #147189 - yotamofek:pr/rustdoc/highlight-optimizations-2, r=GuillaumeGomez
Replace `rustc_span::Span` with a stripped down version for librustdoc's highlighter

While profiling rustdoc's syntax highlighter, I noticed a lot of time being spent in the `Span` interner, due to the highlighter creating a lot of (new) spans.
Since the only data from the `Span` that we use is the `hi` and `lo` byte positions - I replaced the regular `Span` with a simple one with two fields, and in my benchmarks it seemed to make a big dent in the highlighter's perf, so thought I would see what the perf runner says.
2025-10-01 22:15:00 +10:00
Stuart Cook
ca8ed7eb80
Rollup merge of #147188 - Kobzol:remove-compiletest-stage-1, r=Zalathar,jieyouxu
Remove usage of `compiletest-use-stage0-libtest` from CI

It shouldn't be needed anymore after https://github.com/rust-lang/rust/pull/146929.

r? `@Zalathar`
2025-10-01 22:15:00 +10:00
Matthias Krüger
4cbaa70101
Rollup merge of #147172 - notriddle:tooldoc, r=Kobzol
bootstrap: build bootstrap docs with in-tree rustdoc

All of the docs need to be built with the same rustdoc. Otherwise, any change to the search index breaks everything, because the two rustdocs don't agree on the format.

Fixes https://github.com/rust-lang/rust/issues/147142
2025-09-30 20:46:46 +02:00
Yotam Ofek
6edf05b740 Add #[bench] for librustdoc's syntax highlighter 2025-09-30 21:13:45 +03:00
Michael Howell
ba13b6ec6f bootstrap: build bootstrap docs with in-tree rustdoc
All of the docs need to be built with the same rustdoc. Otherwise,
any change to the search index breaks everything, because the two
rustdocs don't agree on the format.
2025-09-30 08:31:08 -07:00
Jakub Beránek
5f54d8bfd8
Remove usage of compiletest-use-stage0-libtest from CI 2025-09-30 16:08:48 +02:00
Jynn Nelson
73f6b08022 Don't condition RUSTDOC_LIBDIR on --no-doc
In d94e7ff065, `rustdoc_path` was changed
to ignore `want_rustdoc` (which is just whether `--no-doc` was passed).
But RUSTDOC_LIBDIR wasn't kept in sync. Rather than trying to keep
`rustdoc_path` in sync with `RUSTDOC_LIBDIR`, just pass LIBDIR to the
rustc shim unconditionally.

This fix allows calling `ensure(doc::Step)` from a non-doc top-level
Step, even if `--no-doc` was present in the command line.
2025-09-29 16:02:22 -07:00
Stuart Cook
3ea1bab982
Rollup merge of #146929 - Zalathar:capture, r=Kobzol,jieyouxu
compiletest: Remove old-output-capture and become a stage0 bootstrap tool

The new compiletest output-capture system became the default in rust-lang/rust#146574, and no problems have been reported since.

This PR therefore removes the old output-capture implementation from compiletest, and adjusts bootstrap to always build and test compiletest as a stage0 bootstrap tool.

In other words, compiletest no longer relies on any unstable features (such as `libtest` or `internal_output_capture`), and is now written entirely in stable Rust!

The compiletest self-tests still need access to an in-tree rustc, in order to obtain information via `rustc --print`, so we interpret `--stage` as indicating the stage of that secondary compiler, but always use the stage0 compiler to build compiletest itself.

r? Kobzol
2025-09-29 11:56:41 +10:00
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
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