Commit Graph

8280 Commits

Author SHA1 Message Date
Jieyou Xu dd948f96f3 Thread --jobs from bootstrap -> compiletest -> run-make-support 2026-01-06 14:51:51 +08:00
bors 0d162b25ed Auto merge of #150535 - Kobzol:rename-ci-gcc, r=jieyouxu
Rename the gcc component to gcc-dev

In preparation for https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/Safe.20rustup.20distribution.20of.20rustc_codegen_gcc/with/565801325.

try-job: dist-x86_64-linux
2026-01-05 05:02:20 +00:00
Jakub Beránek 7b8d4c602e Rename the gcc component to gcc-dev
To free up the `gcc` name for the actual libgccjit component that we will ship to rustup, and also make it more explicit that this component is internal and for bootstrap usages only.
2026-01-02 10:18:06 +01:00
bors 48622726c4 Auto merge of #150289 - rami3l:dist/rustc-docs-dist-path, r=jieyouxu
fix(bootstrap/dist)!: change dist path for `rustc-docs` to avoid clashing

Closes rust-lang/rust#75833, part of https://github.com/rust-lang/rustup/issues/3717:

> I'd like to know if we can assign another folder name to `rustc-docs`?
> [...]
> [`@ThePuzzlemaker](https://github.com/ThePuzzlemaker)'s` `share/doc/rust/html/nightly-rustc` does look a bit weird to me (`nightly-rustc` has nothing to do with the current `rustc`, i.e. the Rustc Book, but they somehow appear similar just looking at the names).
>
> I personally would like to see something like `share/doc/rust/html/rustc-docs` or `share/doc/rust/html/rustc-api` for this component.
_https://github.com/rust-lang/rust/issues/75833#issuecomment-2002503223_

The TLDR is that currently the "rustc book"'s path clashes with "rustc APIs" (i.e. `rustc-docs`), so we change the path of the latter to make it distributable via rustup.

I'm new to `bootstrap` so please feel free to point out any inconsistencies or any extra work I'll need to do to fully land this somewhat breaking change.
2025-12-31 22:00:15 +00:00
Jonathan Brouwer 18b3b66c01 Rollup merge of #150490 - Kobzol:gcc-bug-url, r=antoyo
Specify bug URL when building GCC

r? `@antoyo`
2025-12-30 02:07:08 +01:00
Jonathan Brouwer 1953001256 Rollup merge of #150489 - Kobzol:gcc-no-debuginfo, r=antoyo
Disable debuginfo when building GCC

To reduce size of libgccjit.so from ~400 MiB to ~50 MiB.

r? `@antoyo`
2025-12-30 02:07:08 +01:00
Jakub Beránek 0cc8608493 Specify bug URL when building GCC 2025-12-29 18:06:48 +01:00
Jakub Beránek 1313e958c8 Disable debuginfo when building GCC 2025-12-29 17:49:45 +01:00
bors 8cd58dd99d Auto merge of #148332 - jyn514:cargo-deny-warnings, r=Kobzol
bootstrap: Use cargo's `build.warnings=deny` rather than -Dwarnings

This has two major advantages. First, it makes us less dependent on the rustc shim, which is nice but not super important. More importantly, it gives us much nicer caching properties.

Previously, `x build --warnings warn && x build --warnings deny` would rebuild all of bootstrap, and if there were any warnings emitted on the last build of the compiler, they would *not* fail the build, because cargo would cache the output rather than rerunning the shim.

After this change, bootstrap rebuilds instantly, and cargo knows that it should fail the build but *without* invalidating the cache.

<details><summary>An example of rebuilding bootstrap after a switch from warn->deny:</summary>

```
INFO: Downloading and building bootstrap before processing --help command.
      See src/bootstrap/README.md for help with common commands.
Building bootstrap
   Compiling bootstrap v0.0.0 (/Users/jyn/src/ferrocene3/src/bootstrap)
warning: unused variable: `x`
    --> src/bootstrap/src/core/builder/mod.rs:1792:13
     |
1792 |         let x: ();
     |             ^
     |
     = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default
help: if this is intentional, prefix it with an underscore
     |
1792 |         let _x: ();
     |             +
help: you might have meant to pattern match on the similarly named constant `_`
     |
1792 -         let x: ();
1792 +         let utils::render_tests::_: ();
     |

warning: `bootstrap` (lib) generated 1 warning (run `cargo fix --lib -p bootstrap` to apply 1 suggestion)
    Finished `dev` profile [unoptimized] target(s) in 5.14s
error: warnings are denied by `build.warnings` configuration
failed to run: /Users/jyn/src/ferrocene3/build/aarch64-apple-darwin/stage0/bin/cargo build --jobs=default --manifest-path /Users/jyn/src/ferrocene3/src/bootstrap/Cargo.toml -Zroot-dir=/Users/jyn/src/ferrocene3 -Zwarnings
```

</details>

building the compiler from scratch with `deny`: https://gist.github.com/jyn514/493ed26c2aa6f61bf47c21e75efa2175

<details><summary>and rebuilding the compiler after switching from deny->warn (note that it reuses the whole cache, there are no invalidations):</summary>

```
$ x c compiler
Building bootstrap
    Finished `dev` profile [unoptimized] target(s) in 0.15s
Checking stage1 compiler artifacts{rustc-main, rustc_abi, rustc_arena, rustc_ast, rustc_ast_ir, rustc_ast_lowering, rustc_ast_passes, rustc_ast_pretty, rustc_attr_parsing, rustc_baked_icu_data, rustc_borrowck, rustc_builtin_macros, rustc_codegen_llvm, rustc_codegen_ssa, rustc_const_eval, rustc_data_structures, rustc_driver, rustc_driver_impl, rustc_error_codes, rustc_error_messages, rustc_errors, rustc_expand, rustc_feature, rustc_fluent_macro, rustc_fs_util, rustc_graphviz, rustc_hashes, rustc_hir, rustc_hir_analysis, rustc_hir_id, rustc_hir_pretty, rustc_hir_typeck, rustc_incremental, rustc_index, rustc_index_macros, rustc_infer, rustc_interface, rustc_lexer, rustc_lint, rustc_lint_defs, rustc_llvm, rustc_log, rustc_macros, rustc_metadata, rustc_middle, rustc_mir_build, rustc_mir_dataflow, rustc_mir_transform, rustc_monomorphize, rustc_next_trait_solver, rustc_parse, rustc_parse_format, rustc_passes, rustc_pattern_analysis, rustc_privacy, rustc_proc_macro, rustc_public, rustc_public_bridge, rustc_query_impl, rustc_query_system, rustc_resolve, rustc_sanitizers, rustc_serialize, rustc_session, rustc_span, rustc_symbol_mangling, rustc_target, rustc_thread_pool, rustc_trait_selection, rustc_traits, rustc_transmute, rustc_ty_utils, rustc_type_ir, rustc_type_ir_macros, rustc_windows_rc} (stage0 -> stage1, aarch64-apple-darwin)
warning: function `foo` is never used
  --> compiler/rustc_hashes/src/lib.rs:16:4
   |
16 | fn foo() {}
   |    ^^^
   |
   = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default

warning: `rustc_hashes` (lib) generated 1 warning
    Finished `release` profile [optimized + debuginfo] target(s) in 0.53s
Build completed successfully in 0:00:08
```

</details>

thanks to `@epage` for the help finding this!

r? bootstrap
2025-12-29 15:29:00 +00:00
Matthias Krüger fc8230ffd9 Rollup merge of #150458 - RalfJung:miri-doctests, r=bjorn3
fix running stdlib doctests in Miri in CI

r? `@bjorn3`
2025-12-29 12:59:11 +01:00
Matthias Krüger 19907e67d7 Rollup merge of #150427 - ZuseZ4:offload-testinfra, r=jieyouxu
add has_offload/needs-offload to the test infra

unblocks: https://github.com/rust-lang/rust/pull/150426

Mostly copied from https://github.com/rust-lang/rust/pull/131044
lmk if some of these changes should land separately?

r? jieyouxu
2025-12-29 12:59:10 +01:00
Matthias Krüger f67b02087d Rollup merge of #150108 - ZuseZ4:offload-build-rework, r=Kobzol
Offload: Build offload as a single Step

r? `@Kobzol`

Since it looks like we'll postpone enabling offload in CI for a bit, I factored out these improvements which we want independently. I locally tested both build options successfully, the in-tree-clang build, as well as the build where we provide a path to an external clang.
2025-12-29 12:59:09 +01:00
Manuel Drehwald 7ee7d446bf add has_offload/needs-offload to the test infra 2025-12-29 02:47:53 -08:00
bors 112a274275 Auto merge of #150348 - GuillaumeGomez:update-askama, r=kobzol,jieyouxu
Update askama version to `0.15`

New release comes with lots of improvements like improved compile-time. More information here: https://github.com/askama-rs/askama/releases/tag/v0.15.0

r? `@yotamofek`
2025-12-29 05:34:33 +00:00
Guillaume Gomez ac5a9d8815 Update askama version to 0.15 in librustdoc 2025-12-28 20:45:28 +01:00
Jonathan Brouwer 3bbad7f337 Rollup merge of #149921 - Kobzol:src-gpl, r=Mark-Simulacrum
Add new source component that includes GPL-licensed source

To unblock rustup distribution of `cg_gcc` (https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/Safe.20rustup.20distribution.20of.20rustc_codegen_gcc/with/560644441).

CC ``@joshtriplett``

r? ``@Mark-Simulacrum``
2025-12-28 18:16:10 +01:00
Ralf Jung 391c81900e fix running doctests in Miri 2025-12-28 13:26:01 +01:00
Jonathan Brouwer 2a9bc187a6 Rollup merge of #149964 - Mark-Simulacrum:ci-channel, r=Kobzol
Write file with channel to S3

This will let rustup-toolchain-install-master gain support for installing stable artifacts, which is currently only possible when explicitly overriding the channel. That in turn will unblock letting Crater kick off a beta run as soon as both a new beta and a new stable artifact are ready, rather than waiting until the actual release.
2025-12-25 21:11:53 +01:00
jyn 328adc4d8b rustdoc shim respects RUSTC_HOST_FLAGS 2025-12-25 13:10:17 -05:00
bors efa32de15b Auto merge of #150283 - Urgau:remap-debuginfo-absolute, r=jieyouxu
Remap both absolute and relative paths when building `rustc` and `std`

Turns out [#150110](https://github.com/rust-lang/rust/issues/150110) didn't work as expected, because when the standard library sources are present, we [helpfully un-remap the paths](https://github.com/rust-lang/rust/blob/e951f470d76febcc6f0a5b409c509eb77450a336/compiler/rustc_metadata/src/rmeta/decoder.rs#L1656-L1702) to the local directory of the user, including when we are building the compiler and standard library it-self (duh!), and since those paths are absolute (not relative), our purely relative remapping didn't pick them up.

This behavior wasn't a issue before because the un-remap logic immediately tries to remap them again, and since we had the absolute remapping we would just remap them to the the same thing.

To fix that issue I've adjusted our remapping to remap both the absolute and relative paths when building `rustc` and `std`, as well as added a run-make to make sure we don't regress it again (with a new `needs-std-remap-debuginfo` directive).

r? `@jieyouxu`
2025-12-24 06:23:00 +00:00
Manuel Drehwald f3b16d833f Change how we build offload as a single Step 2025-12-22 23:50:11 +01:00
rami3l a182874cc1 fix(bootstrap/dist)!: change dist path for rustc-docs to avoid clashing 2025-12-22 21:23:20 +01:00
Manuel Drehwald e8a6312474 add new configure_cmake option to let projects set cc/cxx flags 2025-12-22 11:18:35 -08:00
Urgau 4d839da22b Remap both absolute and relative paths when building rustc and std 2025-12-22 19:44:13 +01:00
Urgau 1b8ee46683 Add needs-std-remap-debuginfo directive to compiletest & run-make 2025-12-22 17:55:25 +01:00
Jonathan Brouwer e1f41dc84b Rollup merge of #149840 - jieyouxu:bootstrap-missing-stage0, r=Zalathar
Update comment for `STAGE0_MISSING_TARGETS`
2025-12-22 07:58:48 +01:00
Jieyou Xu de0945b2a7 bootstrap: update comment for STAGE0_MISSING_TARGETS 2025-12-22 10:54:07 +08:00
Mark Rousskov bdc8894004 Write file with channel to S3
This will let rustup-toolchain-install-master gain support for
installing stable artifacts, which is currently only possible when
explicitly overriding the channel. That in turn will unblock letting
Crater kick off a beta run as soon as both a new beta and a new stable
artifact are ready, rather than waiting until the actual release.
2025-12-21 20:14:49 -05:00
Matthias Krüger 99cc3799b5 Rollup merge of #150009 - androm3da:bcain/hex_unwind, r=Mark-Simulacrum
Enable llvm-libunwind by default for Hexagon targets

Fixes library linking issues where libgcc_s was incorrectly being linked instead of the appropriate LLVM runtime libraries for Hexagon targets.

* Set llvm-libunwind as default for all hexagon targets in bootstrap
* Exclude hexagon from automatic libgcc_s linking in unwind
* Enable libunwind.a copying for hexagon targets
* Remove manual library linking from hexagon target specification
2025-12-21 18:50:42 +01:00
Jynn Nelson e6f5186dc3 bootstrap: Use cargo's build.warnings=deny rather than -Dwarnings
This has two major advantages. First, it makes us less dependent on the
rustc shim, which is nice but not super important. More importantly, it
gives us much nicer caching properties.

Previously, `x build --warnings warn && x build --warnings deny` would
rebuild all of bootstrap, and if there were any warnings emitted on the
last build of the compiler, they would *not* fail the build, because
cargo would cache the output rather than rerunning the shim.

After this change, bootstrap rebuilds instantly, and cargo knows that it
should fail the build but *without* invalidating the cache.
2025-12-20 20:27:54 -05:00
Matthias Krüger ce3f9039d9 Rollup merge of #148991 - RalfJung:genmc-exit, r=oli-obk
miri genmc: fix exit() handling

In genmc mode, Miri does not want to stop execution when `exit` is called. Instead we want to continue running other threads to ensure we covered all possible concurrent behaviors (including the ones where the exiting thread was delayed so the other threads took their turns first). However, the core interpreter has a sanity check that prevents us from just doing nothing in `exit`. This leaves us in a pickle: there's nowhere we can jump to (exit has return type `!` so there's no next block), but if we don't jump anywhere we ICE.

The first commit fixes that by disabling the sanity check when there is no block to jump to. That still catches the mistake of forgetting to jump for the vast majority of shims.

We currently don't build Miri's genmc integration in rustc CI so I had to hack the feature into the bootstrap miri integration. That turned out to use the wrong Miri binary, which is fixed by the second commit: we can just rely on CARGO_BIN_EXE_miri, there's no need for a MIRI environment variable.

r? ``@oli-obk``
2025-12-20 13:46:00 +01:00
Josh Stone b22b343faf Revert "Generate macro expansion for rust compiler crates docs"
This reverts commit c820f46122 due to an
ICE encountered while bumping the bootstrap compiler to 1.93-beta.
2025-12-19 15:06:11 -08:00
Boxy Uwu 8321ad2369 update missing targets list 2025-12-19 15:04:30 -08:00
bors 1d8f9c548d Auto merge of #150110 - Urgau:remap-relative-library, r=jieyouxu
Prefer remapping the relative `library/` and `compiler/` directories

This is done to avoid leaking the relative paths to the standard library after the overall of filenames in rust-lang/rust#149709.

Noted that the paths were already leaking before, but to a lesser extent since most (but not all) the paths embedded in the distributed `rlib` were absolute.

In general Cargo compiles workspace members with relative paths, so it's better anyway to remap the relative path.

In addition to our tests I have manually confirmed that it also works as expected for the printed diagnostics paths.

cf. https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/remapping.20of.20the.20standard.20library/near/564093571
2025-12-19 11:45:11 +00:00
Guillaume Gomez c820f46122 Generate macro expansion for rust compiler crates docs 2025-12-18 08:28:31 +01:00
Urgau 67bd5f5cfd Prefer remapping the relative library/ and compiler/ directories
This is done to avoid leaking the relative paths to the standard
library after the overall of filenames.

Noted that the paths were already leaking before, but to a lesser extent
since the paths embedded in the distributed `rlib` were absolute.

In general Cargo compiles workspace members with relative paths, so it's
better anyway to remap the relative path.

cf https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/remapping.20of.20the.20standard.20library/near/564093571
2025-12-17 20:19:28 +01:00
Jakub Beránek 7463b15044 Print warning if LLVM CMake directory does not exist 2025-12-16 22:01:16 +01:00
Jakub Beránek 6847bd0fac Revert 147888 2025-12-16 21:59:39 +01:00
Stuart Cook 4f2188fb85 Rollup merge of #149771 - tshepang:patch-2, r=Zalathar
bootstrap readme: make easy to read when editor wrapping is not enabled

This also makes it more consistent with other text in the file
2025-12-16 14:40:43 +11:00
Stuart Cook 3be45cbe15 Rollup merge of #149271 - sgasho:enzyme-dlopen, r=bjorn3
feat: dlopen Enzyme

related issue: rust-lang/rust#145899
related pr: rust-lang/rust#146623

This PR is a continuation of rust-lang/rust#146623

I refactored some code for rust-lang/rust#146623 and added the functions shown in rust-lang/rust#144197

r? ````@bjorn3````
cc: ````@ZuseZ4````

Zulip link: https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/libload.20.2F.20dlopen.20Enzyme.2Fautodiff/near/553647912
2025-12-16 14:40:42 +11:00
Stuart Cook 0ea7d0b956 Rollup merge of #148790 - kevaundray:kw/rv64im-unknown-elf, r=davidtwco,JonathanBrouwer
Add new Tier-3 target: riscv64im-unknown-none-elf

This PR proposes to add riscv64im-unknown-none-elf, a subset of the already supported riscv64imac-unknown-none-elf.

The motivation behind this PR is that we want to standardize (most) zkVMs on riscv64im-none and riscv64ima-none. Having different variants of riscv extensions, also seems to be within expectation, atleast with respects to riscv32.

Note: This does not mean that we will be able to remove [riscv32im-risc0-zkvm-elf](https://doc.rust-lang.org/rustc/platform-support/riscv32im-risc0-zkvm-elf.html) -- I am not aware of all of the dependents for this

**Tier-3 Policy**

> A tier 3 target must have a designated developer or developers (the "target maintainers") on record to be CCed when issues arise regarding the target. (The mechanism to track and CC such developers may evolve over time.)

I assigned  Rust Embedded Working Group, since they are already maintaining riscv64IMAC, though I am happy to assign myself.

> Targets must use naming consistent with any existing targets; for instance, a target for the same CPU or OS as an existing Rust target should use the same name for that CPU or OS. Targets should normally use the same names and naming conventions as used elsewhere in the broader ecosystem beyond Rust (such as in other toolchains), unless they have a very good reason to diverge. Changing the name of a target can be highly disruptive, especially once the target reaches a higher tier, so getting the name right is important even for a tier 3 target.

It follows the naming convention of the other bare metal riscv targets

> Tier 3 targets may have unusual requirements to build or use, but must not create legal issues or impose onerous legal terms for the Rust project or for Rust developers or users.

This has the same requirements as riscv{32, 64}imac

> Neither this policy nor any decisions made regarding targets shall create any binding agreement or estoppel by any party. If any member of an approving Rust team serves as one of the maintainers of a target, or has any legal or employment requirement (explicit or implicit) that might affect their decisions regarding a target, they must recuse themselves from any approval decisions regarding the target's tier status, though they may otherwise participate in discussions.

> Tier 3 targets should attempt to implement as much of the standard libraries as possible and appropriate (core for most targets, alloc for targets that can support dynamic memory allocation, std for targets with an operating system or equivalent layer of system-provided functionality), but may leave some code unimplemented (either unavailable or stubbed out as appropriate), whether because the target makes it impossible to implement or challenging to implement. The authors of pull requests are not obligated to avoid calling any portions of the standard library on the basis of a tier 3 target not implementing those portions.

> The target must provide documentation for the Rust community explaining how to build for the target, using cross-compilation if possible. If the target supports running binaries, or running tests (even if they do not pass), the documentation must explain how to run such binaries or tests for the target, using emulation if possible or dedicated hardware if necessary.

> Tier 3 targets must not impose burden on the authors of pull requests, or other developers in the community, to maintain the target. In particular, do not post comments (automated or manual) on a PR that derail or suggest a block on the PR based on a tier 3 target. Do not send automated messages or notifications (via any medium, including via ````@)```` to a PR author or others involved with a PR regarding a tier 3 target, unless they have opted into such messages.

> Patches adding or updating tier 3 targets must not break any existing tier 2 or tier 1 target, and must not knowingly break another tier 3 target without approval of either the compiler team or the maintainers of the other tier 3 target.

> Tier 3 targets must be able to produce assembly using at least one of rustc's supported backends from any host target. (Having support in a fork of the backend is not sufficient, it must be upstream.)

Acknowledging the above.
2025-12-16 14:40:41 +11:00
bors cec70080fd Auto merge of #149354 - antoyo:bootstrap-config/libgccjit-libs-dir, r=Kobzol
Bootstrap config: libgccjit libs dir

r? `@Kobzol`
2025-12-15 23:11:45 +00:00
Antoni Boucher b3c1dff330 Open bootstrap.example.toml with the utf-8 encoding 2025-12-15 14:46:15 -05:00
sgasho ddd5aad8a3 feat: dlopen Enzyme 2025-12-16 00:31:32 +09:00
Antoni Boucher b98a91e6ca Error out if a GCC cross-compiler cannot be found 2025-12-15 08:35:17 -05:00
Antoni Boucher 8f035402e0 Add new ChangeInfo for the new option gcc.libgccjit-libs-dir 2025-12-15 08:35:17 -05:00
Antoni Boucher 95c38b2bba Add libgccjit-libs-dir config 2025-12-15 08:35:17 -05:00
Kevaundray Wedderburn 2846968f78 add riscv64im to ignore list for stage0 2025-12-15 12:18:16 +00:00
Matthias Krüger b9757a1602 Rollup merge of #149987 - Zalathar:ambient-cdb, r=jieyouxu
Move ambient cdb discovery from compiletest to bootstrap

- Follow-up to https://github.com/rust-lang/rust/pull/149710

---

As with the previous PR, this PR takes the compiletest code for discovering an “ambient” `cdb` in the user's path, and moves it to bootstrap.

The discovery code is indeed questionable, but improving it is out of scope for this PR.

r? jieyouxu
2025-12-15 08:08:02 +01:00
Brian Cain cc68f2227d Enable llvm-libunwind by default for Hexagon targets
Fixes library linking issues where libgcc_s was incorrectly being linked
instead of the appropriate LLVM runtime libraries for Hexagon targets.

* Set llvm-libunwind as default for all hexagon targets in bootstrap
* Exclude hexagon from automatic libgcc_s linking in unwind
* Enable libunwind.a copying for hexagon targets
* Remove manual library linking from hexagon target specification
2025-12-14 19:53:11 -06:00