about summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
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-10Fix bootstrap `build_all` testGuillaume Gomez-1/+1
2025-02-10Ignore duplicated dep for `literal-escaper`Guillaume Gomez-0/+5
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>
2025-02-07fix autodiff perf by running the enzyme opt pass before autodiffManuel Drehwald-0/+1
2025-02-07Rollup merge of #136589 - GuillaumeGomez:enable-jump-to-def-compiler, r=oli-obkMatthias Krüger-1/+2
Enable "jump to def" feature on rustc docs This PR enables the rustdoc "jump to def" feature which is visible on the source code pages. r? ``@oli-obk``
2025-02-07add module level doc for bootstrap:util:execbit-aloo-0/+5
2025-02-07get tests to work without -Z/-C flagsManuel Drehwald-3/+3
2025-02-06bootstrap: reset some test suite metadata when starting a new test suite许杰友 Jieyou Xu (Joe)-0/+3
2025-02-06create `initial_rustdoc` field in `Build`onur-ozkan-1/+3
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-02-05Only apply LTO to rustdoc at stage 2Jakub Beránek-11/+17
It doesn't make much sense at stage 1, and it was broken anyway.
2025-02-05Re-enable "jump to def" feature on rustc docsGuillaume Gomez-1/+2
2025-02-05Remove the `rustc-perf-wrapper` toolJakub Beránek-1/+0
2025-02-05Build Rustdoc when a Doc benchmark is requestedJakub Beránek-2/+21
2025-02-05Move `x perf` directly into bootstrapJakub Beránek-19/+194
2025-02-05Rename [default|extra]_cflags -> cc_[|un]handled_clagsMads Marquart-18/+24
Makes it explicit that these are in relation to the cc-rs crate.
2025-02-05Rollup merge of #136392 - jieyouxu:wrap-tracing, r=onur-ozkanLeón Orell Valerian Liehr-51/+99
bootstrap: add wrapper macros for `feature = "tracing"`-gated `tracing` macros Follow-up to https://github.com/rust-lang/rust/pull/136091#discussion_r1930219425. - Add wrapper macros for `error!`, `warn!`, `info!`, `debug!` and `trace!`, which `cfg(feature = "tracing")`-gates the underlying `tracing` macros. They expand to nothing if `"tracing"` feature is not enabled. - This is not done for `span!` or `event!` because they can return span guards, and you can't really wrap that. - This is also not possible for `tracing::instrument` attribute proc-macro unless you use another attribute proc-macro to wrap that. It's not *great*, because `tracing::instrument` and `tracing::{span,event}` can't be wrapped this way. Can test locally with: ```bash $ BOOTSTRAP_TRACING=bootstrap=TRACE ./x check src/bootstrap/ ``` r? ``@onur-ozkan`` (or reroll)
2025-02-04Rollup merge of #135844 - yaahc:tidy-feature-status-dump, r=jieyouxuJacob Pratt-0/+35
Add new tool for dumping feature status based on tidy sequel to https://github.com/rust-lang/rust/pull/133514 meaning ... supercedes https://github.com/rust-lang/rust/pull/133351 part of https://github.com/rust-lang/rust/issues/129485 r? `@jieyouxu` cc `@estebank`
2025-02-04bootstrap: add wrapper macros for `tracing`-gated tracing macros许杰友 Jieyou Xu (Joe)-51/+99
- Add wrapper macros for `error!`, `warn!`, `info!`, `debug!` and `trace!`, which `cfg(feature = "tracing")`-gates the underlying `tracing` macros. - This is not done for `span!` or `event!` because they can return span guards, and you can't really wrap that. - This is also not possible for `tracing::instrument` attribute proc-macro unless you use another attribute proc-macro to wrap that.
2025-02-04Rollup merge of #136309 - onur-ozkan:133629, r=jieyouxuMatthias Krüger-1/+5
set rustc dylib on manually constructed rustc command Fixes #133629
2025-02-04Rollup merge of #135836 - ferrocene:ja-gh135782-build-crt-only-for-musl, ↵Matthias Krüger-2/+8
r=onur-ozkan bootstrap: only build `crt{begin,end}.o` when compiling to MUSL only MUSL needs those objects and trying to compile them to other targets, e.g. Windows or macOS, will produce C compilation errors check the target before shelling out to the C compiler and tweak `make_run` to skip the actual C compilation when the target is not MUSL fixes #135782 see the linked issue for additional context
2025-02-03Rollup merge of #136467 - onur-ozkan:override-default-profile-on-tarballs, ↵许杰友 Jieyou Xu (Joe)-1/+8
r=jieyouxu override default config profile on tarballs This is the same logic used in the Python script https://github.com/rust-lang/rust/blob/613bdd49978298648ed05ace086bd1ecad54b44a/src/bootstrap/bootstrap.py#L1273-L1274
2025-02-03bootstrap: feed stage number via `--stage` to compiletest许杰友 Jieyou Xu (Joe)-8/+13
2025-02-03override default config profile on tarballsonur-ozkan-1/+8
This is the same logic used in the Python script https://github.com/rust-lang/rust/blob/613bdd49978298648ed05ace086bd1ecad54b44a/src/bootstrap/bootstrap.py#L1273-L1274 Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-31bootstrap: only build `crt{begin,end}.o` when compiling to MUSLJorge Aparicio-2/+8
only MUSL needs those objects and trying to compile them to other targets, e.g. Windows or macOS, will produce C compilation errors check the target before shelling out to the C compiler and tweak `make_run` to skip the actual C compilation when the target is not MUSL fixes #135782
2025-01-31Add amdgpu targetFlakebi-2/+2
Add target and compile the amdgpu llvm backend.
2025-01-31Rollup merge of #133429 - EnzymeAD:autodiff-middle, r=oli-obkJacob Pratt-3/+6
Autodiff Upstreaming - rustc_codegen_ssa, rustc_middle This PR should not be merged until the rustc_codegen_llvm part is merged. I will also alter it a little based on what get's shaved off from the cg_llvm PR, and address some of the feedback I received in the other PR (including cleanups). I am putting it already up to 1) Discuss with `@jieyouxu` if there is more work needed to add tests to this and 2) Pray that there is someone reviewing who can tell me why some of my autodiff invocations get lost. Re 1: My test require fat-lto. I also modify the compilation pipeline. So if there are any other llvm-ir tests in the same compilation unit then I will likely break them. Luckily there are two groups who currently have the same fat-lto requirement for their GPU code which I have for my autodiff code and both groups have some plans to enable support for thin-lto. Once either that work pans out, I'll copy it over for this feature. I will also work on not changing the optimization pipeline for functions not differentiated, but that will require some thoughts and engineering, so I think it would be good to be able to run the autodiff tests isolated from the rest for now. Can you guide me here please? For context, here are some of my tests in the samples folder: https://github.com/EnzymeAD/rustbook Re 2: This is a pretty serious issue, since it effectively prevents publishing libraries making use of autodiff: https://github.com/EnzymeAD/rust/issues/173. For some reason my dummy code persists till the end, so the code which calls autodiff, deletes the dummy, and inserts the code to compute the derivative never gets executed. To me it looks like the rustc_autodiff attribute just get's dropped, but I don't know WHY? Any help would be super appreciated, as rustc queries look a bit voodoo to me. Tracking: - https://github.com/rust-lang/rust/issues/124509 r? `@jieyouxu`
2025-01-31Explain why MACOSX_STD_DEPLOYMENT_TARGET existMads Marquart-1/+9
2025-01-31Always set the deployment target when building stdMads Marquart-2/+35
2025-01-31Bootstrap: Don't duplicate cc-rs flagsMads Marquart-17/+36
Commands that end up invoking cc-rs, i.e. Cargo (through build scripts) and cmake-rs don't need the CFLAGS from cc-rs itself, as they will just end up as duplicates. We do still choose to pass them in certain places, but now it's at least clear which flags are default, and which flags are extra flags added on.