Commit Graph

8107 Commits

Author SHA1 Message Date
Erick Tryzelaar 7f55f5761c Allow windows resource compiler to be overridden
It is now required to provide a resource compiler on windows when
compiling rust. This allows toolchain builders to explicitly provide a
path to an alternative, such as llvm-rc, instead of the one that's
provided by the Windows SDK.
2025-09-18 16:50:02 +00:00
Jana Dönszelmann b8a80e4f79 Rollup merge of #146654 - samueltardieu:issue142534, r=Kobzol
Do not use `git -C dir`

Older versions of git (≤ 1.8.5) do not support the `-C dir` global option. Use the `cwd` optional argument when using Python's `subprocess` functionality instead.

Fix rust-lang/rust#142534
2025-09-17 20:29:38 +02:00
Jana Dönszelmann 9303a924f4 Rollup merge of #146598 - bjorn3:feature_llvm_enzyme, r=davidtwco
Make llvm_enzyme a regular cargo feature

This makes it clearer that it is set by the build system rather than by the rustc that compiles the current rustc. It also avoids bootstrap needing to pass `--check-cfg llvm_enzyme` to rustc.
2025-09-17 20:29:36 +02:00
Jana Dönszelmann 0a2be63cf6 Rollup merge of #146458 - Hayden602:bootstrap, r=Kobzol
Add parallel-frontend-threads to bootstrap.toml and enable multi-threaded parallel compilation

Add the option to use the parallel compiler when building Rust code in bootstrap.
2025-09-17 20:29:34 +02:00
Stuart Cook f104ecfba6 Rollup merge of #145071 - cuviper:min-llvm-20, r=nikic
Update the minimum external LLVM to 20

With this change, we'll have stable support for LLVM 20 and 21.
For reference, the previous increase to LLVM 19 was rust-lang/rust#139275.

cc ```@rust-lang/wg-llvm```
r? nikic
2025-09-17 14:56:43 +10:00
Samuel Tardieu b79a4bfad6 Do not use git -C dir
Older versions of git (≤ 1.8.5) do not support the `-C dir` global
option. Use the `cwd` optional argument when using Python's
`subprocess` functionality instead.
2025-09-16 21:53:42 +02:00
Josh Stone 580b4891aa Update the minimum external LLVM to 20 2025-09-16 11:49:20 -07:00
Matthias Krüger d1ed4f4238 Rollup merge of #146611 - lolbinarycat:bootstrap-toml-wrong-section-diagnostic, r=Kobzol
bootstrap: emit hint if a config key is used in the wrong section

based on discussion on rust-lang/rust#146591

now, if the user puts `build.download-rustc` in `bootstrap.toml`, they'll get a diagnostic:
``hint: try moving `download-rustc` to the `rust` section``

and if they nest things too much (`rust.rust.download-rustc`):
``hint: section name `rust` used as a key within a section``

if they specify a top-level key within a section (`rust.profile`):
``hint: try using `profile` as a top level key``

r? `@Kobzol`
2025-09-16 20:42:24 +02:00
binarycat 9c423796bb bootstrap: emit hint if a config key is used in the wrong section 2025-09-16 12:39:49 -05:00
Haidong Zhang 929c9335dd Add parallel-frontend-threads to bootstrap.toml and enable multi-threaded parallel compilation 2025-09-16 17:53:29 +08:00
bors 8a1b39995e Auto merge of #146614 - Zalathar:rollup-hcxvdi1, r=Zalathar
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#145095 (Migrate `UnsizedConstParamTy`  to unstable impl of `ConstParamTy_`)
 - rust-lang/rust#145960 (Split `FnCtxt::report_args_error` into subfunctions)
 - rust-lang/rust#146402 (interpret: fix overlapping aggregate initialization)
 - rust-lang/rust#146466 (llvm-wrapper: other cleanup)
 - rust-lang/rust#146574 (compiletest: Enable new-output-capture by default)
 - rust-lang/rust#146599 (replace some `#[const_trait]` with `const trait`)
 - rust-lang/rust#146601 (compiletest: Make `./x test --test-args ...` work again)
 - rust-lang/rust#146608 (improve internal bootstrap docs)
 - rust-lang/rust#146609 (bootstrap: lower verbosity of cargo to one less than bootstrap's)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-09-16 04:26:18 +00:00
Stuart Cook f0e8c2fb6f Rollup merge of #146609 - lolbinarycat:bootstrap-less-verbose-cargo, r=Kobzol
bootstrap: lower verbosity of cargo to one less than bootstrap's

the main thing this does is eliminate the "Fresh ..." output when `--verbose` is only passed once.

r? `@Kobzol`
2025-09-16 10:25:44 +10:00
Stuart Cook cc315a8fba Rollup merge of #146608 - lolbinarycat:bootstrap-readme, r=Kobzol
improve internal bootstrap docs

Mainly focused on making it easier to figure out how tools get built without having to read the `bootstrap_tool!` macro, but also added some subdirs of `build/` to the readme.
2025-09-16 10:25:43 +10:00
Matthias Krüger cb9f476314 Rollup merge of #146563 - lolbinarycat:bootstrap-ci-no-incremental, r=Kobzol
bootstrap.py: disable incremental build for bootstrap in CI

locally this seems to save a quarter of a second per build of bootstrap, presumably mainly because it avoids writing 280MB to disk.  unsure if this is worth two extra lines of python, i'll let t-bootstrap decide.
2025-09-15 22:09:51 +02:00
binarycat 29ca09be09 bootstrap: lower verbosity of cargo to one less than bootstrap's
the main thing this does is eliminate the "Fresh ..." output when
`--verbose` is only passed once.
2025-09-15 14:42:44 -05:00
binarycat b8cb80cf80 improve internal bootstrap docs 2025-09-15 13:38:04 -05:00
bjorn3 1991779bd4 Make llvm_enzyme a regular cargo feature
This makes it clearer that it is set by the build system rather than by
the rustc that compiles the current rustc. It also avoids bootstrap
needing to pass --check-cfg llvm_enzyme to rustc.
2025-09-15 15:31:56 +00:00
Matthias Krüger d316cfdbf9 Rollup merge of #146471 - neuschaefer:no-target, r=Mark-Simulacrum
bootstrap: Show target in "No such target exists" message

This makes it a little easier to pinpoint the issue.
2025-09-15 06:03:46 +02:00
binarycat b92ad97f1d bootstrap.py: disable incremental build for bootstrap in CI 2025-09-14 18:26:29 -05:00
Jacob Pratt 7be418947e Rollup merge of #146450 - lolbinarycat:bootstrap-test-js, r=jieyouxu
bootstrap: rustdoc-js tests can now be filtered by js files

Before, a command like `./x test tests/rustdoc-js/path-ordering.js` would succeed, but run no tests, since the names of the tests are based on the `.rs` file.  This is a bit confusing, as the `rustdoc-js-std` test suite only has `.js` files, and thus those are the files you filter on.  Now, `./x test tests/rustdoc-js/path-ordering.js` will be treated as an alias for `./x test tests/rustdoc-js/path-ordering.rs`.  This is fairly simple as each `rustdoc-js` test has 2 files, 1 js file and one rust file, each with an identical base filename, so all we need to do is swap the extension.

r? `@Kobzol`
2025-09-13 03:26:03 -04:00
Jacob Pratt 544644476d Rollup merge of #144498 - Noratrieb:rustc-json-schema, r=jieyouxu,davidtwco
Add --print target-spec-json-schema

This schema is helpful for people writing custom target spec JSON. It can provide autocomplete in the editor, and also serves as documentation when there are documentation comments on the structs, as `schemars` will put them in the schema.

I was motivated to do this because I saw someone write their own version of this schema by hand, so demand for this clearly exists. It's not a lot of effort to implement, so I thought it would make sense.

MCP: https://github.com/rust-lang/compiler-team/issues/905

I think it would also be useful to put this in the sysroot in `etc` so people can link it directly in their editors.

I would have loved to add a test that validates the JSON schema against the spec JSON of every builtin target, but I don't want to do it as the JSON schema validation crates have incredible amounts of dependencies because JSON schema supports a ton of random features. I don't want to add that, even as a dev dependency.
2025-09-13 03:26:01 -04:00
bors 4ba1cf9ade Auto merge of #146444 - heiher:fix-loong-jemalloc-page-size, r=Mark-Simulacrum
bootstrap: Build jemalloc for LoongArch with support for 16K pages

By default, jemalloc is configured with a 4K page size. If the host’s page size is larger than this, it will crash at runtime. This patch raises the page size to 16K.
2025-09-12 20:41:17 +00:00
Noratrieb f157ce994e Add --print target-spec-json-schema
This schema is helpful for people writing custom target spec JSON. It
can provide autocomplete in the editor, and also serves as documentation
when there are documentation comments on the structs, as `schemars` will
put them in the schema.
2025-09-12 20:53:28 +02:00
J. Neuschäfer fefc979374 bootstrap: Show target in "No such target exists" message
This makes it a little easier to pinpoint the issue.
2025-09-12 13:32:07 +02:00
Stuart Cook accb4a3a8f Rollup merge of #146449 - Kobzol:gcc-fix-symlink, r=GuillaumeGomez
Fix `libgccjit` symlink when we build GCC locally

Unblocks https://github.com/rust-lang/rust/pull/146414.

r? ```@GuillaumeGomez```
2025-09-12 20:02:18 +10:00
binarycat 472721b34f bootstrap: rustdoc-js tests can now be filtered by js files 2025-09-11 12:47:22 -05:00
Jakub Beránek 256aa0d941 Fix libgccjit symlink when we build GCC locally 2025-09-11 18:46:14 +02:00
WANG Rui 35979519ae bootstrap: Build jemalloc for LoongArch with support for 16K pages
By default, jemalloc is configured with a 4K page size. If the
host’s page size is larger than this, it will crash at runtime.
This patch raises the page size to 16K.
2025-09-11 21:55:05 +08:00
Jakub Beránek 8d1403cb9b Change the default value of gcc.download-ci-gcc to true 2025-09-11 11:45:09 +02:00
bors be8de5d6a0 Auto merge of #146360 - Zalathar:rollup-qc2hhrd, r=Zalathar
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#139593 (add sitemap to rust docs)
 - rust-lang/rust#145819 (Port limit attributes to the new attribute parsing infrastructure)
 - rust-lang/rust#146025 (compiler: Include span of too huge array with `-Cdebuginfo=2`)
 - rust-lang/rust#146184 (In the rustc_llvm build script, don't consider arm64* to be 32-bit)
 - rust-lang/rust#146195 (fix partial urlencoded link support)
 - rust-lang/rust#146300 (Implement `Sum` and `Product` for `f16` and `f128`.)
 - rust-lang/rust#146314 (mark `format_args_nl!` as `#[doc(hidden)]`)
 - rust-lang/rust#146324 (const-eval: disable pointer fragment support)
 - rust-lang/rust#146326 (simplify the declaration of the legacy integer modules (`std::u32` etc.))
 - rust-lang/rust#146339 (Update books)
 - rust-lang/rust#146343 (Weakly export `platform_version` symbols)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-09-09 11:54:44 +00:00
Stuart Cook 8e5f8389b9 Rollup merge of #139593 - lolbinarycat:sitemap, r=jieyouxu
add sitemap to rust docs

attempt to mitigate https://github.com/rust-lang/rust/issues/104670
2025-09-09 14:35:00 +10:00
bors fefce3cecd Auto merge of #146018 - lambdageek:add-winres-version, r=wesleywiser
compiler: Add Windows resources to rustc-main and rustc_driver

Adds Windows resources with the rust version information to rustc-main.exe and rustc_driver.dll

Invokes `rc.exe` directly, rather than using one of the crates from the ecosystem to avoid adding dependencies.

A new internal `rustc_windows_rc` crate has the common build script machinery for locating `rc.exe` and constructing the resource script
2025-09-09 03:56:41 +00:00
Matthias Krüger cb64a77550 Rollup merge of #146170 - kumarUjjawal:master, r=Mark-Simulacrum
fix: offline rustdoc html missing favicon

As discussed in the rust-lang/rust#146149 the doc was missing the favicon icon when build locally and viewed on a browser. I changed the relative path and also now we explicitly copy both SVG and PNG.

<img width="1132" height="425" alt="Screenshot 2025-09-03 at 11 57 46 PM" src="https://github.com/user-attachments/assets/062cbb08-04ec-4d88-a43a-710fb6190f82" />
2025-09-07 20:02:27 +02:00
bors 1ed3cd7030 Auto merge of #146233 - jieyouxu:run-make-fission, r=Kobzol
Split `run-make` into two {`run-make`,`run-make-cargo`} test suites

## Summary

Split `tests/run-make` into two test suites, to make it faster and more convenient for contributors to run run-make tests that do not need in-tree `cargo`.

| New test suites        | Explanation                                                                                                                                                                                                                              |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `tests/run-make`       | The "fast path" test suite intended for run-make tests that do not need in-tree `cargo`. These tests may not use `cargo`.                                                                                                                |
| `tests/run-make-cargo` | The "slow path" test suite that requires checking out `cargo` submodule and building in-tree `cargo`, and thus will have access to in-tree `cargo`. In practice, these constitute a very small portion of the original `run-make` tests. |

This PR carries out [MCP 847: Split run-make test suite into slower-building test suite with suitably-staged cargo and faster-building test suite without cargo](https://github.com/rust-lang/compiler-team/issues/847).
Fixes rust-lang/rust#135573 (for the tests that do not need in-tree `cargo`).
Fixes rust-lang/rust#134109.

## Remarks

- I considered if we want to split by in-tree tools previously. However, as discussed rust-lang/rust#134109, in practice `rustdoc` is not very slow to build, but `cargo` takes a good few minutes. So, the partition boundary was determined to be along in-tree `cargo` availability.
- The `run-make` tests previously that wanted to use `cargo` cannot just use the bootstrap `cargo`, otherwise they would run into situations where bootstrap `cargo` can significantly diverge from in-tree `cargo` (see https://github.com/rust-lang/rust/pull/130642).

---

try-job: aarch64-msvc-1
try-job: test-various
try-job: x86_64-gnu-debug
try-job: aarch64-gnu-debug
try-job: aarch64-apple
try-job: dist-various-1
2025-09-06 18:37:35 +00:00
Matthias Krüger 6f5fad5dad Rollup merge of #146266 - RalfJung:miri-nosys, r=jieyouxu
miri std tests: skip all of sys::

Matches https://github.com/rust-lang/miri-test-libstd/pull/104
2025-09-06 13:03:17 +02:00
Matthias Krüger 8fe82a0e9e Rollup merge of #146263 - jieyouxu:check-bump-stage0, r=Kobzol
Fix `bump-stage0` build failure, and check-build `bump-stage0` in CI

This PR bumps the `toml` dependency of the `bump-stage0` tool to `0.8.23`, which AFAICT is the highest `toml` version that's present in the r-l/r workspace's `Cargo.lock` already (so we don't introduce _another_ `toml 0.x.*` series). I added some byte-buffer-to-string intermediary to workaround `toml 0.8.*` not having the `toml 0.9.*` `toml::from_slice` API.

To catch obvious build failures of the `src/tools/bump-stage0` tool early, before we find out it can't even build when we really need it to work.

Contexts:

- https://github.com/rust-lang/rust/pull/146250#issue-3388327410
- [#t-release > Bump stage0 rustfmt separately ("one-off") @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/241545-t-release/topic/Bump.20stage0.20rustfmt.20separately.20.28.22one-off.22.29/near/537916615)

Fixes rust-lang/rust#146252.
2025-09-06 13:03:17 +02:00
Ralf Jung 9fc8374c2c miri std tests: skip all of sys:: 2025-09-06 11:07:19 +02:00
Jieyou Xu d5e61216a7 bootstrap: add check step for src/tools/bump-stage0 2025-09-06 16:33:11 +08:00
bors 0d0f4eac8b Auto merge of #146253 - Kobzol:cargo-lto, r=jieyouxu
Optimize Cargo with LTO

This optimization was "lost" when Cargo was switched away from a `ToolRustcPrivate` to a `ToolTarget` tool.

r? `@jieyouxu`
2025-09-06 06:43:38 +00:00
Trevor Gross 14415c75ad Rollup merge of #146199 - Kobzol:bootstrap-cargo-doc, r=jieyouxu
Document Cargo with in-tree rustdoc

Fixes https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/nightly.20rust.20doc.20seem.20corrupted.

r? `@jieyouxu`

try-job: dist-x86_64-linux-alt
2025-09-05 20:10:00 -04:00
Aleksey Kliger 095fa86a3b compiler: Add Windows resources to rustc-main and rustc_driver
Adds Windows resources with the rust version information to rustc-main.exe and rustc_driver.dll

Sets the product description to "Rust Compiler" or "Rust Compiler (channel)" for non-stable channels
2025-09-05 14:06:31 -04:00
Jakub Beránek edb92a33d7 Optimize Cargo with LTO 2025-09-05 20:03:08 +02:00
Jakub Beránek b5c139baed Fix condition 2025-09-05 19:57:08 +02:00
Jakub Beránek 8c93cdc8e0 Add a comment about the "specialization" feature required because of im-rc 2025-09-05 17:02:12 +02:00
Jakub Beránek 4375e9d313 Add snapshot test for disting compiler docs 2025-09-05 16:24:43 +02:00
Jakub Beránek a6aa509687 Respect top stage when documenting Cargo 2025-09-05 16:22:52 +02:00
Jakub Beránek 9f9473f201 Allow specialization feature when documenting Cargo 2025-09-05 16:20:53 +02:00
Jieyou Xu 0f76784d72 bootstrap: split run-make into {run-make,run-make-cargo} test suites
So that contributors who don't need to run `run-make` tests that require
in-tree `cargo` can run the non-cargo `run-make` tests without having to
wait for `cargo` (which would require rebuilding as the build cache
would be invalidated by compiler modifications without some kind of
`--keep-stage-cargo`).
2025-09-05 21:22:50 +08:00
Matthias Krüger 7260704178 Rollup merge of #145976 - beepster4096:configure_debugbreak, r=clubby789
Add bootstrap.toml option to control debug breaking on ICEs on windows

When rustc ICEs during bootstrap on Windows, it will call `DebugBreak`. This is intended to trigger a Windows Error Reporting dialog that can launch a debugger. However on some setups (mine for one) this will just abort the process, hiding any ICEs on other threads as well. I also would not want to see this dialog even if it did work for me.

This PR adds a new option to bootstrap.toml `rust.break-on-ice` to configure this behavior. By default, it is enabled, matching the existing behavior.
2025-09-04 17:45:47 +02:00
Jakub Beránek b5f2a71f55 Document Cargo with in-tree rustdoc 2025-09-04 14:19:22 +02:00