about summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2025-02-19Rollup merge of #127793 - ChaiTRex:zed_support, r=KobzolMatthias Krüger-39/+65
Added project-specific Zed IDE settings This repository currently has project-specific VS Code IDE settings in `.vscode` and `compiler/rustc_codegen_cranelift/.vscode`. Now there are equivalent project-specific Zed IDE settings alongside those. This fixes `rust-analyzer` not being able to properly handle this project. Note that: 1. The contents of `src/tools/rust-analyzer/.vscode` could not be translated to Zed, as they aren't basic IDE settings. 2. One of the VS Code settings in `.vscode` has no corresponding setting in Zed, and so this has been noted like this: ```json "_settings_only_in_vs_code_not_yet_in_zed": { "git.detectSubmodulesLimit": 20 }, ```
2025-02-18Rollup merge of #137191 - ehuss:update-mdbook, r=jieyouxuMatthias Krüger-15/+0
Update mdbook and move error_index_generator This moves error_index_generator to the rustbook workspace so that it can share the dependency with mdbook. I had forgotten that error_index_generator is using mdbook. This includes a corresponding update to mdbook which avoids a regression in error_index_generator. Closes https://github.com/rust-lang/rust/issues/137052
2025-02-17Move error_index_generator to the rustbook workspaceEric Huss-15/+0
I had forgotten that error_index_generator is using mdbook. This moves it to be part of the rustbook workspace so that it can share the dependency with rustbook.
2025-02-17Rollup merge of #137170 - ferrocene:pa-target-jemalloc, r=KobzolMatthias Krüger-3/+18
Allow configuring jemalloc per target In Ferrocene we're trying to switch from `./configure` to a predefined `config.toml` file. One of the limitations of doing that is the `rust.jemalloc` configuration option, which we need to conditionally disable based on the target. This PR adds a `target.$tuple.jemalloc` option to override `rust.jemalloc` to make that possible.
2025-02-17Rollup merge of #137073 - niklaskorz:bootstrap-doc-fix-empty-no-std, r=clubby789Matthias Krüger-0/+4
boostrap: skip no_std targets in Std doc step This fixes a bug that currently prevents us from adding no_std library targets to rustc in nixpkgs (https://github.com/NixOS/nixpkgs/pull/382166). When running `./x.py doc`, the `Std` doc step generally fails for no_std targets, logs: https://gist.github.com/niklaskorz/fb83f9503ce19b75e8b1af02cdebd592 Skipping no_std targets in this step will allow using no_std targets such as `bpfel-unknown-none` together with other targets in the same config without blocking the doc generator for them, e.g. ``` ./configure --release-channel=stable --tools=rustc,rustdoc,rust-analyzer-proc-macro-srv --build=aarch64-apple-darwin --host=aarch64-apple-darwin --target=aarch64-apple-darwin,bpfel-unknown-none ./x.py doc ``` Logs with this fix applied: https://gist.github.com/niklaskorz/cdd50aaea33ede579f737434286d800b
2025-02-17Rollup merge of #137020 - ferrocene:pa-vendor-sources, r=KobzolMatthias Krüger-28/+65
Pass vendored sources from bootstrap to generate-copyright In addition to doing the vendoring in bootstrap, this PR also loads the list of manifests to parse from bootstrap (instead of hardcoding a smaller list in generate-copyright). This is best reviewed commit-by-commit. Fixes https://github.com/rust-lang/rust/issues/136955
2025-02-17use the shared vendor impl for plan source tarballsPietro Albini-21/+17
2025-02-17allow configuring jemalloc per targetPietro Albini-3/+18
2025-02-17generate-copyright: pass the vendored sources from bootstrapPietro Albini-8/+33
2025-02-17Rollup merge of #137080 - jieyouxu:more-tracing, r=onur-ozkanMatthias Krüger-31/+332
bootstrap: add more tracing to compiler/std/llvm flows - Add more tracing to compiler/std/llvm flows. - Two drive-by nits: 1. Take `TargetSelection` by-value for `builder.is_builder_target()`. Noticed while adding tracing; follow-up to #136767. 2. Coalesce enzyme build logic into one branch. - Document `COMPILER{,_FOR}` tracing targets for #96176. - No functional changes. ### Testing You can play with the tracing locally with: ``` $ BOOTSTRAP_TRACING=bootstrap=debug ./x build library $ BOOTSTRAP_TRACING=bootstrap=trace ./x build library $ BOOTSTRAP_TRACING=bootstrap=trace,COMPILER=trace,COMPILER_FOR=trace ./x build library ``` ### Previews ``` $ BOOTSTRAP_TRACING=bootstrap=debug ./x build library ``` ![Screenshot 2025-02-15 230824](https://github.com/user-attachments/assets/c3b02b62-d52e-4c03-a00a-da0d95618989) ``` $ BOOTSTRAP_TRACING=bootstrap=trace,COMPILER=trace,COMPILER_FOR=trace ./x build library ``` ![Screenshot 2025-02-15 233859](https://github.com/user-attachments/assets/842e4ece-4c26-4191-acbb-5f93e42de4dc) r? ``@onur-ozkan`` (or reroll)
2025-02-16Rollup merge of #137119 - onur-ozkan:fix-broken-core, r=jieyouxuMatthias Krüger-9/+10
fix broken `x {doc, build} core` Fixes #137115
2025-02-16bootstrap: take `target` by value in `is_builder_target`许杰友 Jieyou Xu (Joe)-19/+19
2025-02-16bootstrap: add more tracing to compiler/std/llvm flows许杰友 Jieyou Xu (Joe)-13/+314
2025-02-16fix broken `x {doc, build} core`onur-ozkan-9/+10
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-02-16add unit test for cc-detectbit-aloo-0/+257
2025-02-16add docs to cc-detectbit-aloo-3/+28
2025-02-15Check all IDE config hashes in `./x test bootstrap`, update Helix hashChai T. Rex-12/+26
2025-02-15Add support for the Zed IDE to `./x setup`Chai T. Rex-1/+9
2025-02-15Prepare `./x setup` to handle more IDEs; make minor improvementsChai T. Rex-31/+35
* Order IDEs alphabetically so that manually searching for an IDE is easier, both when running `./x setup` and when editing the source code behind `./x setup` * Prepare for IDEs with spaces in their names * Allow explicitly typing 'none' for the IDE * Change capitalization of `Vscode` to the more standard `VsCode` * Make minor efficiency improvements * Add `'static` annotations where they apply
2025-02-15Auto merge of #137066 - onur-ozkan:137034-blocker, r=jieyouxubors-12/+15
check if CI-LLVM is enabled before testing it Blocker for #137034
2025-02-15boostrap: skip no_std targets in Std doc stepNiklas Korz-0/+4
2025-02-15check if CI-LLVM is enabled before testing itonur-ozkan-12/+15
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-02-14generate-copyright: pass the list of manifests from bootstrapPietro Albini-0/+15
2025-02-14generate-copyright: pass the source root from bootstrapPietro Albini-0/+1
2025-02-14CI: split i686-mingw job to three free runnersMarcoIeni-6/+12
2025-02-14Auto merge of #137010 - workingjubilee:rollup-g00c07v, r=workingjubileebors-4/+76
Rollup of 9 pull requests Successful merges: - #135439 (Make `-O` mean `OptLevel::Aggressive`) - #136460 (Simplify `rustc_span` `analyze_source_file`) - #136904 (add `IntoBounds` trait) - #136908 ([AIX] expect `EINVAL` for `pthread_mutex_destroy`) - #136924 (Add profiling of bootstrap commands using Chrome events) - #136951 (Use the right binder for rebinding `PolyTraitRef`) - #136981 (ci: switch loongarch jobs to free runners) - #136992 (Update backtrace) - #136993 ([cg_llvm] Remove dead error message) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-13Rollup merge of #136924 - Kobzol:bootstrap-tracing, r=jieyouxuJubilee-4/+76
Add profiling of bootstrap commands using Chrome events Since we now have support for tracing in bootstrap, and the execution of most commands is centralized within a few functions, it's quite trivial to also trace command execution, and visualize it using the Chrome profiler. This can be helpful both to profile what takes time in bootstrap and also to get a visual idea of what happens in a given bootstrap invocation (since the execution of external commands is usually the most interesting thing). This is how it looks: ![image](https://github.com/user-attachments/assets/3351489e-3a0f-4729-9082-5bf40c586d4b) I first tried to use [tracing-flame](https://github.com/tokio-rs/tracing/tree/master/tracing-flame), but the output wasn't very useful, because the event/stackframe names were bootstrap code locations, instead of the command contents. r? ``@jieyouxu``
2025-02-13Rollup merge of #136973 - jyn514:fulldeps-stage1, r=jieyouxuJubilee-6/+8
Fix `x test --stage 1 ui-fulldeps` on macOS (until the next beta bump) "stage 1" for fulldeps means "compile with stage 0, link against stage 1". But this code wanted to switch on the compiler that's building, not the compiler that's being tested. Fix the check. Previously, it would fail with a warning about linker-messages: ``` --- stderr ------------------------------- warning[E0602]: unknown lint: `linker_messages` | = note: requested on the command line with `-A linker_messages` = note: `#[warn(unknown_lints)]` on by default ``` cc https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/unknown.20lint.3A.20.60linker_messages.60.20when.20blessing.20tests.20on.20.2E.2E.2E, https://github.com/rust-lang/rust/pull/136960
2025-02-13Rollup merge of #136962 - onur-ozkan:fix-enzyme-note, r=jieyouxuJubilee-10/+18
unify LLVM version finding logic kind a self-explanatory
2025-02-13Rollup merge of #136960 - jyn514:compiletest-args, r=jieyouxuJubilee-6/+5
Compiletest should not inherit all host RUSTFLAGS I told ``@rhelmot`` to do this in #134913. But it's not correct; compiletest shouldn't inherit RUSTFLAGS at all. Pass a single new --host-rustcflags to compiletest instead, without overwriting any existing arguments. Fixes the following failure, which only happens when building llvm from source and then running `x test --stage 1 ui-fulldeps`: ``` diff --git a/tests/ui-fulldeps/fluent-messages/test.stderr b/tests/ui-fulldeps/fluent-messages/test.stderr index 0b3bb14ce51..978ac46c5a2 100644 --- a/tests/ui-fulldeps/fluent-messages/test.stderr +++ b/tests/ui-fulldeps/fluent-messages/test.stderr ``@@`` -1,3 +1,8 ``@@`` +warning[E0602]: unknown lint: `linker_messages` + | + = note: requested on the command line with `-A linker_messages` + = note: `#[warn(unknown_lints)]` on by default ``` See https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/.E2.9C.94.20unknown.20lint.3A.20.60linker_messages.60.20when.20blessing.20tests.20on.20.2E.2E.2E for more context.
2025-02-13Rollup merge of #136941 - Kobzol:ccache-build, r=onur-ozkanJubilee-11/+29
Move `llvm.ccache` to `build.ccache` (S)ccache can be useful for more things that just LLVM. For example, we will soon want to use it also for GCC, and theoretically also for building stage0 Rust tools (https://github.com/rust-lang/rust/pull/136921, https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/Using.20sccache.20for.20Rust). r? ``@onur-ozkan``
2025-02-13Fix `x test --stage 1 ui-fulldeps` on macOS (until the next beta bump)jyn-6/+8
"stage 1" for fulldeps means "compile with stage 0, link against stage 1". But this code wanted to switch on the compiler that's building, not the compiler that's being tested. Fix the check. Previously, it would fail with a warning about linker-messages: ``` --- stderr ------------------------------- warning[E0602]: unknown lint: `linker_messages` | = note: requested on the command line with `-A linker_messages` = note: `#[warn(unknown_lints)]` on by default ```
2025-02-13unify LLVM version finding logiconur-ozkan-10/+18
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-02-13Add export of bootstrap tracing to Chrome eventsJakub Beránek-11/+35
2025-02-13Trace execution of bootstrap commandsJakub Beránek-2/+50
2025-02-13Rollup merge of #134999 - Berrysoft:dev/new-cygwin-target, ↵Jacob Pratt-1/+5
r=chenyukang,workingjubilee Add cygwin target. This PR simply adds cygwin target together with msys2 target, based on ````@ookiineko```` 's (the account has been deleted) [work](https://github.com/ookiineko-cygport/rust) on cygwin target. My full work is here: https://github.com/rust-lang/rust/compare/master...Berrysoft:rust:dev/cygwin I have succeeded in building a new rustc for cygwin target, and eventually distributed a new version of [fish-shell](https://github.com/Berrysoft/fish-shell/releases) (rewritten by Rust) for MSYS2. I will open a new PR to fix std if this PR is accepted.
2025-02-13Add warning about using llvm.ccache and add FIXME noteJakub Beránek-0/+5
2025-02-12Compiletest should not inherit all host RUSTFLAGSjyn-6/+5
I told rhelmot to do this in #134913. But it's not correct; compiletest shouldn't inherit RUSTFLAGS at all. Pass a single new --host-rustcflags to compiletest instead, without overwriting any existing arguments. Fixes the following failure, which only happens when building llvm from source and then running `x test --stage 1 ui-fulldeps`: ``` diff --git a/tests/ui-fulldeps/fluent-messages/test.stderr b/tests/ui-fulldeps/fluent-messages/test.stderr index 0b3bb14ce51..978ac46c5a2 100644 --- a/tests/ui-fulldeps/fluent-messages/test.stderr +++ b/tests/ui-fulldeps/fluent-messages/test.stderr @@ -1,3 +1,8 @@ +warning[E0602]: unknown lint: `linker_messages` + | + = note: requested on the command line with `-A linker_messages` + = note: `#[warn(unknown_lints)]` on by default ```
2025-02-12Rollup merge of #136916 - onur-ozkan:fix-cc2ar, r=jieyouxuGuillaume Gomez-16/+4
use cc archiver as default in `cc2ar` We should remove entire `cc2ar` but `cc` doesn't seem to cover all the conditions that `cc2ar` handles. For now, I replaced the `else` logic only, which is a bit hacky and unstable. Fixes #136759
2025-02-12Rollup merge of #136848 - ↵Guillaume Gomez-0/+98
Shourya742:2025-02-11-add-docs-and-ut-for-util-cache, r=clubby789 add docs and ut for bootstrap util cache This PR adds doc and unit test for bootstrap utils/cache module
2025-02-12Move `llvm.ccache` to `build.ccache`Jakub Beránek-12/+25
(S)ccache can be useful for more things that just LLVM. For example, we will soon want to use it also for GCC, and theoretically also for building stage0 Rust tools.
2025-02-12Rollup merge of #136767 - onur-ozkan:is-host-target, r=albertlarsan68,jieyouxuGuillaume Gomez-13/+35
improve host/cross target checking Using an invalid equality operator on `builder.config.build !=/==` can be hard to detect in reviews (which is quite dangerous). Replaced them with `is_host_target`, which is much clearer as it explicitly states what it does.
2025-02-12use cc archiver as default in `cc2ar`onur-ozkan-16/+4
We should remove entire `cc2ar` but `cc` doesn't seem to cover all the conditions that `cc2ar` handles. For now, I replaced the `else` logic only, which is a bit hacky and unstable. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-02-11Auto merge of #136586 - Kobzol:lto-rustdoc-fix-stage-1, r=onur-ozkanbors-11/+17
Only apply LTO to rustdoc at stage 2 It doesn't make much sense at stage 1, and it was broken anyway. This was implemented in https://github.com/rust-lang/rust/pull/135832. The issue with LTO and stage 1 rustdoc was reported [here](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/x.20test.20with.20lto.20.3D.20.22thin.22.20fails.20to.20build.20rustdoc.3F). r? `@onur-ozkan`
2025-02-11rename `is_host_target` to `is_builder_target`onur-ozkan-18/+20
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-02-11add coverage for `Builder::is_host_target`onur-ozkan-0/+15
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-02-11add `Builder::is_host_target`onur-ozkan-13/+18
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-02-11add unit test to bootstrap:util:cache:testsbit-aloo-0/+55
2025-02-11Add docs to bootstrap:src:utils:cachebit-aloo-0/+43
2025-02-10Auto merge of #133092 - madsmtm:bootstrap-deployment-target, ↵bors-23/+102
r=Mark-Simulacrum,jieyouxu Always set the deployment target when building std `cc` has [a bug/feature](https://github.com/rust-lang/cc-rs/issues/1171) (I guess depending on how you look at it) where the default deployment target is taken from the SDK instead of from `rustc`. This causes `compiler-builtins` to build `compiler-rt` with the wrong deployment target on iOS. I've been meaning to change how `cc` works in this regard, but that's a lengthy process, so let's fix it in bootstrap for now. The behaviour can be seen locally with `./x build library --set build.optimized-compiler-builtins=true` for various target triples, and then inspecting with `otool -l build/host/stage1/lib/rustlib/*/lib/libcompiler_builtins-*.rlib | rg 'minos|version'`. I have added a rmake test that ensures that we now have the same version everywhere. Fixes https://github.com/rust-lang/rust/issues/128419 Fixes https://github.com/rust-lang/compiler-builtins/issues/650 Fixes https://github.com/rust-lang/rust/issues/136523 See also https://github.com/rust-lang/cargo/issues/13115, https://github.com/rust-lang/cc-rs/issues/1171, https://github.com/rust-lang/rust/issues/136113 See https://github.com/rust-lang/rust/pull/133092#issuecomment-2626206772 for a description of how the change works. try-job: i686-gnu-1 try-job: i686-gnu-2 try-job: x86_64-apple-1 try-job: aarch64-apple try-job: dist-apple-various try-job: dist-aarch64-apple try-job: dist-various-2 try-job: x86_64-fuchsia