summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2025-03-21Install licenses into `share/doc/rust/licenses`Josh Stone-1/+1
This changes the path from "licences" to "licenses" for consistency across the repo, including the usage directly around this line. This is a US/UK spelling difference, but I believe the US spelling is also more common in open source in general. (cherry picked from commit d183da6331addfc69dfb157ef8ffc051ff0508bd)
2025-02-27downgrade bootstrap `cc`onur-ozkan-3/+5
Signed-off-by: onur-ozkan <work@onurozkan.dev> (cherry picked from commit e4ca11f87ffca8c63aa56d45b46e62b6acc58bd7)
2025-02-27skip submodule updating logics on tarballsonur-ozkan-1/+5
Signed-off-by: onur-ozkan <work@onurozkan.dev> (cherry picked from commit d2203ad59c67a6acb2968ea77e1e9dea5530e518)
2025-02-27use the shared vendor impl for plan source tarballsPietro Albini-21/+17
(cherry picked from commit 92f31b95c92cb0a34413a52793a50c7d4334dbb2)
2025-02-27generate-copyright: pass the vendored sources from bootstrapPietro Albini-8/+33
(cherry picked from commit 33e7f9bc6681e32cc3b3b26ea85e21da225b89ee)
2025-02-27generate-copyright: pass the list of manifests from bootstrapPietro Albini-0/+15
(cherry picked from commit 08b4f6d2c650d3e6e9010e8a27631962bf31dec7)
2025-02-27generate-copyright: pass the source root from bootstrapPietro Albini-0/+1
(cherry picked from commit 36c314cfb7999a66a49932822a336aea47f62292)
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-15check if CI-LLVM is enabled before testing itonur-ozkan-12/+15
Signed-off-by: onur-ozkan <work@onurozkan.dev>
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
2025-02-10Rollup merge of #136681 - onur-ozkan:132926, r=jieyouxuMatthias Krüger-3/+132
resolve `llvm-config` path properly on cross builds Fixes #132926 try-job: x86_64-mingw-2
2025-02-10Rollup merge of #136419 - EnzymeAD:autodiff-tests, r=onur-ozkan,jieyouxuMatthias Krüger-6/+10
adding autodiff tests I'd like to get started with upstreaming some tests, even though I'm still waiting for an answer on how to best integrate the enzyme pass. Can we therefore temporarily support the -Z llvm-plugins here without too much effort? And in that case, how would that work? I saw you can do remapping, e.g. `rust-src-base`, but I don't think that will give me the path to libEnzyme.so. Do you have another suggestion? Other than that this test simply checks that the derivative of `x*x` is `2.0 * x`, which in this case is computed as `%0 = fadd fast double %x.0.val, %x.0.val` (I'll add a few more tests and move it to an autodiff folder if we can use the -Z flag) r? ``@jieyouxu`` Locally at least `-Zllvm-plugins=${PWD}/build/x86_64-unknown-linux-gnu/enzyme/build/Enzyme/libEnzyme-19.so` seems to work if I copy the command I get from x.py test and run it manually. However, running x.py test itself fails. Tracking: - https://github.com/rust-lang/rust/issues/124509 Zulip discussion: https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Enzyme.20build.20changes
2025-02-10add coverage for llvm-config path resolutiononur-ozkan-3/+127
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-02-10bootstrap: Don't overwrite CFLAGS_* set in the environmentMads Marquart-6/+19
2025-02-10Add cygwin target.王宇逸-1/+5
Co-authored-by: Ookiineko <chiisaineko@protonmail.com> Co-authored-by: nora <48135649+Noratrieb@users.noreply.github.com> Co-authored-by: Jubilee <workingjubilee@gmail.com>
2025-02-10Rollup merge of #136472 - jieyouxu:pass-stage, r=Mark-SimulacrumJubilee-8/+13
[`compiletest`-related cleanups 2/7] Feed stage number to compiletest directly Reference for overall changes: https://github.com/rust-lang/rust/pull/136437 Part **2** of **7** of the *`compiletest`-related cleanups* PR series. ### Summary - Pass stage number via new `--stage` compiletest flag directly from bootstrap, instead of deriving that info in compiletest by doing gymnastics on `--stage-id`. - Just a cleanup, should have no functional changes. r? bootstrap
2025-02-10move second opt run to lto phase and cleanup codeManuel Drehwald-3/+6
2025-02-10Auto merge of #134740 - Flakebi:amdgpu-target, r=workingjubileebors-2/+2
Add amdgpu target Add amdgpu target to rustc and enable the LLVM target. Fix compiling `core` with the amdgpu: The amdgpu backend makes heavy use of different address spaces. This leads to situations, where a pointer in one addrspace needs to be casted to a pointer in a different addrspace. `bitcast` is invalid for this case, `addrspacecast` needs to be used. Fix compilation failures that created bitcasts for such cases by creating pointer casts (which creates an `addrspacecast` under the hood) instead. MCP: https://github.com/rust-lang/compiler-team/issues/823 Tracking issue: #135024 Kinda related to the original amdgpu tracking issue #51575 (though that one has been closed for a while).
2025-02-09Auto merge of #136751 - bjorn3:update_rustfmt, r=Mark-Simulacrumbors-257/+364
Update bootstrap compiler and rustfmt The rustfmt version we previously used formats things differently from what the latest nightly rustfmt does. This causes issues for subtrees that get formatted both in-tree and in their own repo. Updating the rustfmt used in-tree solves those issues. Also bumped the bootstrap compiler as the stage0 update command always updates both at the same time.
2025-02-09Auto merge of #136754 - Urgau:rollup-qlkhjqr, r=Urgaubors-20/+213
Rollup of 5 pull requests Successful merges: - #134679 (Windows: remove readonly files) - #136213 (Allow Rust to use a number of libc filesystem calls) - #136530 (Implement `x perf` directly in bootstrap) - #136601 (Detect (non-raw) borrows of null ZST pointers in CheckNull) - #136659 (Pick the max DWARF version when LTO'ing modules with different versions ) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-09Rollup merge of #136530 - Kobzol:x-perf, r=onur-ozkanUrgau-20/+213
Implement `x perf` directly in bootstrap Discussed [here](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Turning.20.60x.20perf.60.20into.20a.20first.20class.20command). Implementing the command directly in bootstrap let's us correctly build the compiler toolchain based on input arguments (such as include rustdoc in the toolchain [only] when needed), and it also makes the CLI interface nicer. r? ``@onur-ozkan``
2025-02-08Rustfmtbjorn3-257/+364
2025-02-08Rollup merge of #136626 - onur-ozkan:initial-rustdoc, r=jieyouxuMatthias Krüger-1/+3
create `initial_rustdoc` field in `Build` just a minor improvement
2025-02-08Auto merge of #136728 - matthiaskrgr:rollup-x2qh9yt, r=matthiaskrgrbors-0/+5
Rollup of 6 pull requests Successful merges: - #136640 (Debuginfo for function ZSTs should have alignment of 8 bits, not 1 bit) - #136648 (Add a missing `//@ needs-symlink` to `tests/run-make/libs-through-symlinks`) - #136651 (Label mismatched parameters at the def site for foreign functions) - #136691 (Remove Linkage::Private and Linkage::Appending) - #136692 (add module level doc for bootstrap:utils:exec) - #136700 (i686-unknown-hurd-gnu: bump baseline CPU to Pentium 4) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-08resolve `llvm-config` path properly on cross buildsonur-ozkan-3/+8
Signed-off-by: onur-ozkan <work@onurozkan.dev>