Commit Graph

8107 Commits

Author SHA1 Message Date
Manuel Drehwald 3e32dc27e3 update CONFIG_CHANGE_HISTORY 2025-10-19 21:04:40 +02:00
Manuel Drehwald 0f93363124 enzyme/autodiff is compatible with download-ci=true 2025-10-19 19:18:18 +02:00
bors c6efb9019b Auto merge of #147698 - Kobzol:lld-target, r=jieyouxu
Do not enable LLD if we don't build host code for targets that opt into it

Should fix the problem mentioned in https://github.com/rust-lang/rust/pull/147626#issuecomment-3402635247.

r? `@jieyouxu`
2025-10-19 11:55:04 +00:00
Matthias Krüger fa1a0c3bb4 Rollup merge of #147816 - Kobzol:bootstrap-download-rustc-lto, r=jieyouxu
Do not error out for `download-rustc` if LTO is configured

Noted [here](https://github.com/rust-lang/rust/issues/141953#issuecomment-3404838305). LTO should indeed be mostly a perf-only change.

r? ``@jieyouxu``
2025-10-18 23:54:46 +02:00
Jakub Beránek ce320bb35a Do not error out for download-rustc if LTO is configured 2025-10-17 18:15:09 +02:00
Augie Fackler 10a533417b bootstrap: migrate to object 0.37
I noticed we had a mix of 0.37 and 0.36 at work, and this was why. As
far as I can tell everything still works fine.
2025-10-16 14:07:50 -04:00
Jakub Beránek a2c7e17e2c Do not enable LLD if we don't build host code for targets that opt into it 2025-10-14 21:09:43 +02:00
bors 844264adda Auto merge of #147675 - lnicola:sync-from-ra, r=lnicola
`rust-analyzer` subtree update

Subtree update of `rust-analyzer` to https://github.com/rust-lang/rust-analyzer/commit/6d4b23478d8e5114e68278c64d4691ee6cf615e4.

Created using https://github.com/rust-lang/josh-sync.

r? `@ghost`
2025-10-14 17:45:05 +00:00
Laurențiu Nicola 7d93599fb1 Add new_zeroed_alloc to rust-analyzer ALLOW_FEATURES 2025-10-14 17:58:51 +03:00
Stuart Cook 0f6fe9112a Rollup merge of #147647 - Noratrieb:bootstrap-groups, r=Zalathar
Hide vendoring and copyright in GHA group

These two steps are currently the most verbose steps in a dist-linux build, which makes it harder to find more interesting parts. Hide them in a group like most things.

For example, see https://github.com/rust-lang/rust/actions/runs/18462295959/job/52596384752
2025-10-14 16:31:03 +11:00
Noratrieb 11977b2e65 Hide vendoring and copyright in GHA group
These two steps are currently the most verbose steps in a dist-linux
build, which makes it harder to find more interesting parts. Hide them
in a group like most things.
2025-10-13 22:00:45 +02:00
Guillaume Gomez 0e6ec72dbe Rollup merge of #147626 - Kobzol:lld-generalize2, r=jieyouxu
Generalize configuring LLD as the default linker in bootstrap

Reopen of https://github.com/rust-lang/rust/pull/147157, because apparently bors can't deal with it for some reason.

r? ``@ghost``
2025-10-13 11:25:25 +02:00
Guillaume Gomez 8ced599ba2 Rollup merge of #147625 - Kobzol:gcc-debug-assertions, r=GuillaumeGomez
Add a warning when running tests with the GCC backend and debug assertions are enabled

Discussed at https://rust-lang.zulipchat.com/#narrow/channel/233931-t-compiler.2Fmajor-changes/topic/Run.20more.20tests.20for.20rustc_codegen_gcc.20in.20t.E2.80.A6.20compiler-team.23891/with/543701828.

r? ``@GuillaumeGomez``
2025-10-13 11:25:24 +02:00
Jakub Beránek e755d71855 Add a warning when running tests with the GCC backend and debug assertions are enabled 2025-10-13 09:33:44 +02:00
bors 35456985fa Auto merge of #147518 - dianqk:update-llvm, r=cuviper,Kobzol
Update LLVM to 21.1.3

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

After rust-lang/rust#146124, we need more space to run x86_64-gnu-distcheck if building LLVM from source. According to the building log, the space freed by `free-disk-space-linux.sh` is not entirely available.

```
You are running out of disk space.
The runner will stop working when the machine runs out of disk space.
Free space left: 98 MB

disk usage:
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        72G   43G   29G  60% /
tmpfs           7.9G   84K  7.9G   1% /dev/shm
tmpfs           3.2G  1.2M  3.2G   1% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
/dev/sda16      881M   60M  760M   8% /boot
/dev/sda15      105M  6.2M   99M   6% /boot/efi
/dev/sdb1        74G   28K   70G   1% /mnt
tmpfs           1.6G   12K  1.6G   1% /run/user/1001
```
2025-10-13 05:11:33 +00:00
Matthias Krüger 13ef05d52f Rollup merge of #147592 - Shunpoco:add-tidy-to-check, r=Zalathar
Add tidy to the target of ./x check

## Context
Discussion: https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/tidy.20isn't.20in.20.2E.2Fx.20check/with/544323712

Currently `tidy` (src/tools/tidy) is not included in the list of `./x check`. It means that rust-analyzer doesn't work for codes in the directory if you use `./x check` as the analyzer on your IDE.

## Change

This PR adds src/tools/tidy into the target of `./x check`. It enables rust-analyzer highlight errors/warns on all codes in the directory.

Note that since tidy is implicitly checked by `./x test tidy`, this new check is off by default.
2025-10-12 19:07:47 +02:00
Matthias Krüger 9d9ede81f5 Rollup merge of #147168 - jyn514:no-alloc, r=Mark-Simulacrum
Don't unconditionally build alloc for `no-std` targets

It's possible for targets to only support `core` and not `alloc`. Instead of building alloc unconditionally, pass a list of crates to build into `std_cargo`, and only pass `-p alloc` if the list of crates wasn't already filtered to a subset.

The original use case was to reuse `std_cargo` for a rustc_driver that doesn't emit metadata. But this seems like a reasonable change regardless.
2025-10-12 19:07:45 +02:00
Shunpoco d70857a1e0 Add tidy into ./x check
This commit adds src/tools/tidy into `./x check`. It enables rust-analyzer hightlights errors/warns on all codes in src/tools/tidy.
Since tidy is implicitly checked by `./x test tidy`, this new check is off by default.
2025-10-12 08:49:39 +01:00
Shunpoco 340702c0c2 write x.py's help for saving output time
Currently x.py help (or x.py --help) builds bootstrap binary everytime, but it delays printing help.
This change saves the current top level help text into a file. x.py help prints the file and doesn't touch bootstrap binary.
x.py test bootstrap checks if the file is up to date.
Note that subcommand level helps (e.g., x.py check --help) aren't saved.
2025-10-11 23:16:18 +01:00
dianqk a3482d97c6 Remove the temporary directory when a check ends 2025-10-11 06:57:11 +08:00
Jakub Beránek da86710c30 Rename default linker linux field 2025-10-09 17:19:23 +02:00
bors 4b57d8154a Auto merge of #147519 - Zalathar:rollup-o5f16uo, r=Zalathar
Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#147446 (PassWrapper: use non-deprecated lookupTarget method)
 - rust-lang/rust#147473 (Do `x check` on various bootstrap tools in CI)
 - rust-lang/rust#147509 (remove intrinsic wrapper functions from LLVM bindings)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-09 10:54:43 +00:00
Zalathar 7374789331 Support x check rustdoc-gui-test
This is useful for ensuring that changes to compiletest haven't broken
rustdoc-gui-test.
2025-10-09 19:58:52 +11:00
Stuart Cook 76d4f37c40 Rollup merge of #147506 - Zalathar:isolate, r=jieyouxu
compiletest: Isolate public APIs and minimize public surface area

As part of my ongoing efforts to improve directive parsing, I would like to be able to make internal changes without worrying about whether they're going to break the rustdoc-gui-test tool. That tool currently uses compiletest as a dependency to help with directive parsing.

This PR therefore isolates all of compiletest's public APIs into two dedicated modules, one used by rustdoc-gui-test, and one used by the compiletest binary in `compiletest/src/bin/main.rs`.

All other modules (and crate-root items) are then made non-`pub` to achieve the API isolation. Doing so reveals some unused items, which have been removed.

(To reduce the amount of immediate textual churn, this PR does not comprehensively replace `pub` with `pub(crate)` throughout the whole crate; that could be done in a follow-up PR.)

---

Ideally, rustdoc-gui-test would not depend on compiletest at all, but properly fixing that is out of scope for this PR.
- rust-lang/rust#143827

r? jieyouxu
2025-10-09 18:43:27 +11:00
Stuart Cook 68f9b3b5e9 Rollup merge of #147419 - cuviper:bootstrap-rustc-libs, r=Zalathar,jieyouxu
bootstrap: add `Builder::rustc_cmd` that includes the lib path

When building with `rust.rpath = false`, every `rustc` invocation needs
to include the library path as well. I particularly ran into this in
`generate_target_spec_json_schema` when testing 1.91-beta in Fedora,
where we do disable rpath for our system builds. The new helper function
will hopefully encourage the right thing going forward.
2025-10-09 18:43:21 +11:00
Zalathar ce4699deff compiletest: Make all other modules non-public
All APIs used from outside the compiletest library crate have been isolated to
the `cli` and `rustdoc_gui_test` modules, so no other items need to be publicly
exported.
2025-10-09 14:34:01 +11:00
Jana Dönszelmann 8356f6b18a Rollup merge of #147448 - jyn514:reuse-submodules, r=kobzol
collect-license-metadata: update submodules before running

Previously, this could cause incorrect failures like the following:
```
diff --git a/license-metadata.json b/license-metadata.json
index 4fb59210854..b1291c00b94 100644
--- a/license-metadata.json
+++ b/license-metadata.json
`@@` -244,19 +172,6 `@@`
             },
             "name": "src/doc/rustc-dev-guide/mermaid.min.js",
             "type": "file"
-          },
-          {
-            "children": [],
-            "license": {
-              "copyright": [
-                "2003-2019 University of Illinois at Urbana-Champaign",
-                "2003-2019 by the contributors listed in CREDITS.TXT (https://github.com/rust-lang/llvm-project/blob/7738295178045041669876bf32b0543ec8319a5c/llvm/CREDITS.TXT)",
-                "2010 Apple Inc"
-              ],
-              "spdx": "Apache-2.0 WITH LLVM-exception AND NCSA"
-            },
-            "name": "src/llvm-project",
-            "type": "directory"
```

Additionally, this prints a warning if there were untracked files, which could cause a failure like the following:
```
diff --git a/license-metadata.json b/license-metadata.json
index 4fb59210854..ebf1c478282 100644
--- a/license-metadata.json
+++ b/license-metadata.json
`@@` -155,6 +155,22 `@@`
             "name": "src/librustdoc/html/static/fonts",
             "type": "directory"
           },
+          {
+            "directories": [],
+            "files": [
+              "2015-edition.txt",
+              "diagnostics.json",
+              "license.diff",
+              "test.fixed.rs"
+            ],
+            "license": {
+              "copyright": [
+                "NONE"
+              ],
+              "spdx": "NONE"
+            },
+            "type": "group"
+          },
           {
             "license": {
               "copyright": [
```

r? `@Kobzol` cc rust-lang/rust#147422
2025-10-08 10:06:57 +02:00
Matthias Krüger 60bbb533df Rollup merge of #147205 - alexcrichton:wasip3, r=davidtwco
Add a new `wasm32-wasip3` target to Rust

This commit adds a new tier 3 target to rustc, `wasm32-wasip3`. This follows in the footsteps of the previous `wasm32-wasip2` target and is used to represent binding to the WASIp3 set of APIs managed by the WASI subgroup to the WebAssembly Community Group.

As of now the WASIp3 set of APIs are not finalized nor standardized. They're in the process of doing so and the current trajectory is to have the APIs published in December of this year. The goal here is to get the wheels turning in Rust to have the target in a
more-ready-than-nonexistent state by the time this happens in December.

For now the `wasm32-wasip3` target looks exactly the same as `wasm32-wasip2` except that `target_env = "p3"` is specified. This indicates to crates in the ecosystem that WASIp3 APIs should be used, such as the [`wasip3` crate]. Over time this target will evolve as implementation in guest toolchains progress, notably:

* The standard library will use WASIp3 APIs natively once they're finalized in the WASI subgroup.
* Support through `wasi-libc` will be updated to use WASIp3 natively which Rust will then transitively use.
* Longer-term, features such as cooperative multithreading will be added to the WASIp3-track of targets to enable using `std::thread`, for example, on this target.

These changes are all expected to be non-breaking changes for users of this target. Runtimes supporting WASIp3, currently Wasmtime and Jco, support WASIp2 APIs as well and will work with components whether or not they import WASIp2, both WASIp2 and WASIp3, or just WASIp3 APIs. This means that changing the internal implementation details of libstd over time is expected to be a non-breaking change.

[`wasip3` crate]: https://crates.io/crates/wasip3
2025-10-07 19:39:07 +02:00
Josh Stone 03cdcb5cd5 bootstrap: add Builder::rustc_cmd that includes the lib path
When building with `rust.rpath = false`, every `rustc` invocation needs
to include the library path as well. I particularly ran into this in
`generate_target_spec_json_schema` when testing 1.91-beta in Fedora,
where we do disable rpath for our system builds. The new helper function
will hopefully encourage the right thing going forward.
2025-10-07 09:55:55 -07:00
Jynn Nelson f7c9b30b1b collect-license-metadata: update submodules before running
Previously, this could cause incorrect failures like the following:
```
diff --git a/license-metadata.json b/license-metadata.json
index 4fb59210854..b1291c00b94 100644
--- a/license-metadata.json
+++ b/license-metadata.json
@@ -244,19 +172,6 @@
             },
             "name": "src/doc/rustc-dev-guide/mermaid.min.js",
             "type": "file"
-          },
-          {
-            "children": [],
-            "license": {
-              "copyright": [
-                "2003-2019 University of Illinois at Urbana-Champaign",
-                "2003-2019 by the contributors listed in CREDITS.TXT (https://github.com/rust-lang/llvm-project/blob/7738295178045041669876bf32b0543ec8319a5c/llvm/CREDITS.TXT)",
-                "2010 Apple Inc"
-              ],
-              "spdx": "Apache-2.0 WITH LLVM-exception AND NCSA"
-            },
-            "name": "src/llvm-project",
-            "type": "directory"
```

Additionally, this prints a warning if there were untracked files, which
could cause a failure like the following:
```
diff --git a/license-metadata.json b/license-metadata.json
index 4fb59210854..ebf1c478282 100644
--- a/license-metadata.json
+++ b/license-metadata.json
@@ -155,6 +155,22 @@
             "name": "src/librustdoc/html/static/fonts",
             "type": "directory"
           },
+          {
+            "directories": [],
+            "files": [
+              "2015-edition.txt",
+              "diagnostics.json",
+              "license.diff",
+              "test.fixed.rs"
+            ],
+            "license": {
+              "copyright": [
+                "NONE"
+              ],
+              "spdx": "NONE"
+            },
+            "type": "group"
+          },
           {
             "license": {
               "copyright": [
```
2025-10-07 11:30:42 -04:00
Philipp Krones e652436f2a Allow serde_core as a dependency 2025-10-06 18:28:23 +02:00
Jakub Beránek b07d88fc72 Handle external LLVM config 2025-10-06 10:48:15 +02:00
Jakub Beránek e7c9e12ce4 Update change tracker 2025-10-06 10:32:00 +02:00
Jakub Beránek 902cec2bc6 Allow manually opting in and out of Linux linker overrides 2025-10-06 10:30:46 +02:00
Jakub Beránek 8dd97f887c Destructure TomlConfig and add missing default_linker config 2025-10-06 09:35:34 +02:00
Jakub Beránek b6c9a6a442 Generalize setting rust-lld as the default linker on Linux 2025-10-06 09:35:34 +02:00
Jubilee 0d3e4d1c2c Rollup merge of #147376 - jieyouxu:bootstrap-compiler-rt-self-test, r=Kobzol
bootstrap: relax `compiler-rt` root assertion

Not needed during tests. This would otherwise require `src/llvm-project` submodule to be initialized and `compiler-rt/` subdirectory to be present.

I need this and rust-lang/rust#147374 to get bootstrap self-tests to pass with no git submodules checked out locally.

r? `@Kobzol` (or bootstrap)
2025-10-05 11:59:24 -07:00
Jieyou Xu a8b9a57674 bootstrap: relax compiler-rt root assertion
Not needed during tests.
2025-10-05 20:30:52 +08:00
Jieyou Xu 7ed476f51f bootstrap: don't build redirect pages during dry-run/test 2025-10-05 20:18:38 +08:00
Stuart Cook a3291ede1a Rollup merge of #141839 - tshepang:ease-lsp-use, r=Mark-Simulacrum,fee1-dead
make rust-analyzer use a dedicated build directory

inspired by https://github.com/rust-lang/rust/pull/132794
2025-10-03 09:16:26 +10:00
Alex Crichton ce2087692f Add a new wasm32-wasip3 target to Rust
This commit adds a new tier 3 target to rustc, `wasm32-wasip3`. This
follows in the footsteps of the previous `wasm32-wasip2` target and is
used to represent binding to the WASIp3 set of APIs managed by the WASI
subgroup to the WebAssembly Community Group.

As of now the WASIp3 set of APIs are not finalized nor standardized.
They're in the process of doing so and the current trajectory is to have
the APIs published in December of this year. The goal here is to get the
wheels turning in Rust to have the target in a
more-ready-than-nonexistent state by the time this happens in December.

For now the `wasm32-wasip3` target looks exactly the same as
`wasm32-wasip2` except that `target_env = "p3"` is specified. This
indicates to crates in the ecosystem that WASIp3 APIs should be used,
such as the [`wasip3` crate]. Over time this target will evolve as
implementation in guest toolchains progress, notably:

* The standard library will use WASIp3 APIs natively once they're
  finalized in the WASI subgroup.
* Support through `wasi-libc` will be updated to use WASIp3 natively
  which Rust will then transitively use.
* Longer-term, features such as cooperative multithreading will be added
  to the WASIp3-track of targets to enable using `std::thread`, for
  example, on this target.

These changes are all expected to be non-breaking changes for users of
this target. Runtimes supporting WASIp3, currently Wasmtime and Jco,
support WASIp2 APIs as well and will work with components whether or not
they import WASIp2, both WASIp2 and WASIp3, or just WASIp3 APIs. This
means that changing the internal implementation details of libstd over
time is expected to be a non-breaking change.

[`wasip3` crate]: https://crates.io/crates/wasip3
2025-10-02 15:09:09 -07:00
Jynn Nelson 3e26e2a3a9 Don't unconditionally build alloc for no-std targets
It's possible for targets to only support `core` and not `alloc`.
Instead of building alloc unconditionally, pass a list of crates to
build into `std_cargo`, and only pass `-p alloc` if the list of crates
wasn't already filtered to a subset.

The original use case was to reuse `std_cargo` for a rustc_driver that
doesn't emit metadata. But this seems like a reasonable change
regardless.
2025-10-01 16:58:38 -07:00
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