summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2024-10-14check `stage0`, `channel` and `version` files for CI rustconur-ozkan-6/+11
These files have important role for compiler builds, so include them in the "if-unchanged" rustc logic. Signed-off-by: onur-ozkan <work@onurozkan.dev> (cherry picked from commit 6e6cbdd2df0ae5a025c458d95a4c84df1b6af092)
2024-10-12Rollup merge of #131334 - heiher:loong-sanitizers, r=Mark-SimulacrumTrevor Gross-0/+3
Enable sanitizers for loongarch64-unknown-* Enable sanitizers for `loongarch64-unknown-linux-{gnu,musl,ohos}` targets.
2024-10-12Rollup merge of #130965 - onur-ozkan:bootstrap-step-trait-doc, r=Mark-SimulacrumMatthias Krüger-18/+22
make `Step` doc-comments more clear Aiming to improve complicated `Step` documentation. Once we merge this, I will update [this page](https://rustc-dev-guide.rust-lang.org/building/bootstrapping/how-bootstrap-does-it.html?highlight=Step#synopsis-of--step) too.
2024-10-12Auto merge of #131612 - tgross35:rollup-zy3yg4p, r=tgross35bors-12/+29
Rollup of 7 pull requests Successful merges: - #130870 (Add suggestion for removing invalid path sep `::` in fn def) - #130954 (Stabilize const `ptr::write*` and `mem::replace`) - #131233 (std: fix stdout-before-main) - #131590 (yeet some clones) - #131596 (mark InterpResult as must_use) - #131597 (Take a display name for `tool_check_step!`) - #131605 (`LLVMConstInt` only allows integer types) r? `@ghost` `@rustbot` modify labels: rollup
2024-10-12Auto merge of #131448 - DianQK:fixes-131164, r=onur-ozkanbors-0/+2
Update LLVM submodule Fixes (maybe after beta backport) #131164. r? nikic
2024-10-12Ignore the `download_ci_llvm` testDianQK-0/+2
2024-10-12Take a display name for `tool_check_step!`许杰友 Jieyou Xu (Joe)-12/+29
2024-10-11Rollup merge of #131305 - onur-ozkan:131303, r=KobzolStuart Cook-33/+38
make `llvm::is_ci_llvm_modified` logic more precise Fixes #131303.
2024-10-10Auto merge of #131444 - onur-ozkan:hotfix-ci, r=Kobzolbors-28/+11
stabilize `ci_rustc_if_unchanged_logic` test Makes `ci_rustc_if_unchanged_logic` test more stable and re-enables it. Previously, it was expecting CI-rustc to be used all the time when there were no changes, which wasn’t always the case. Purpose of this test is making sure we don't use CI-rustc while there are changes in compiler and/or library, but we don't really need to cover cases where CI-rustc is not enabled. Second commit was pushed for making a change in the compiler tree, so `ci_rustc_if_unchanged_logic` can be tested properly in merge CI.
2024-10-10Rollup merge of #131442 - jieyouxu:mir-opt-rebuild, r=onur-ozkanMatthias Krüger-1/+5
Match std `RUSTFLAGS` for host and target for `mir-opt` test suite to fix double std build/rebuilds Previously the bootstrap compiletest `Step::run` flow had: ```rs // ensure that `libproc_macro` is available on the host. builder.ensure(compile::Std::new(compiler, compiler.host)); // ... if suite == "mir-opt" { builder.ensure(compile::Std::new_for_mir_opt_tests(compiler, target)); } else { builder.ensure(compile::Std::new(compiler, target)); } ``` This can cause unnecessary std rebuilds (even on the same invocation) because if host == target then `builder.ensure(compile::Std::new_for_mir_opt_tests(compiler, target))` will have different `RUSTFLAGS` than `builder.ensure(compile::Std::new(compiler, compiler.host))`. This PR fixes that by matching up std `RUSTFLAGS` if the test suite is `mir-opt`: ```rs if suite == "mir-opt" { builder.ensure(compile::Std::new_for_mir_opt_tests(compiler, compiler.host)); } else { builder.ensure(compile::Std::new(compiler, compiler.host)); } ``` This is a short-term fix, the better fix is to enforce how `RUSTFLAGS` are handled as described in https://github.com/rust-lang/rust/issues/131437#issuecomment-2401710727. Fixes #131437.
2024-10-10Auto merge of #131453 - onur-ozkan:llvm-ci-check-for-rustc-ci, r=Kobzolbors-0/+14
disable `download-rustc` if LLVM submodule has changes in CI We can't use CI rustc while using in-tree LLVM (which happens in LLVM submodule update PRs) and this PR handles that by ignoring CI-rustc in CI and failing in non-CI environments.
2024-10-10stabilize `ci_rustc_if_unchanged_logic` testonur-ozkan-28/+11
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-10-10stabilize `download_ci_llvm` testonur-ozkan-22/+14
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-10-10make `llvm::is_ci_llvm_modified` logic more preciseonur-ozkan-11/+24
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-10-10disable `download-rustc` if LLVM submodule has changes in CIonur-ozkan-0/+14
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-10-09Auto merge of #131461 - onur-ozkan:ignore-ci-rustc-change-test, r=onur-ozkanbors-0/+2
ignore `ci_rustc_if_unchanged_logic` test Temporary hotfix for unblocking CI. r? ghost
2024-10-09ignore `ci_rustc_if_unchanged_logic` testonur-ozkan-0/+2
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-10-09Match std RUSTFLAGS for host and target for `mir-opt` test许杰友 Jieyou Xu (Joe)-1/+5
2024-10-09Rename `profiler_support` to `profiler_runtime` throughout compiletestZalathar-1/+1
2024-10-09fix `ci_rustc_if_unchanged_logic` testonur-ozkan-1/+1
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-10-08Auto merge of #131155 - jieyouxu:always-kill, r=onur-ozkanbors-6/+40
Prevent building cargo from invalidating build cache of other tools due to conditionally applied `-Zon-broken-pipe=kill` via tracked `RUSTFLAGS` This PR fixes #130980 where building cargo invalidated the tool build caches of other tools (such as rustdoc) because `-Zon-broken-pipe=kill` was conditionally passed via `RUSTFLAGS` for other tools *except* for cargo. The differing `RUSTFLAGS` triggered tool build cache invalidation as `RUSTFLAGS` is a tracked env var -- any changes in `RUSTFLAGS` requires a rebuild. `-Zon-broken-pipe=kill` is load-bearing for rustc and rustdoc to not ICE on broken pipes due to usages of raw std `println!` that panics without the flag being set, which manifests in ICEs. I can't say I like the changes here, but it is what it is... See detailed discussions and history of `-Zon-broken-pipe=kill` usage in https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Internal.20lint.20for.20raw.20.60print!.60.20and.20.60println!.60.3F/near/474593815. ## Approach This PR fixes the tool build cache invalidation by informing the `rustc` binary shim when to apply `-Zon-broken-pipe=kill` (i.e. when the rustc binary shim is not used to build cargo). This information is not communicated by `RUSTFLAGS`, which is an env var tracked by cargo, and instead uses an untracked env var `UNTRACKED_BROKEN_PIPE_FLAG` so we won't trigger tool build cache invalidation. We preserve bootstrap's behavior of not setting that flag for cargo by conditionally omitting setting `UNTRACKED_BROKEN_PIPE_FLAG` when building cargo. Notably, the `-Zon-broken-pipe=kill` instance in https://github.com/rust-lang/rust/blob/1e5719bdc40bb553089ce83525f07dfe0b2e71e9/src/bootstrap/src/core/build_steps/compile.rs#L1058 is not modified because that is used to build rustc only and not cargo itself. Thanks to `@cuviper` for the idea! ## Testing ### Integration testing This PR introduces a run-make test for rustc and rustdoc that checks that when they do not ICE/panic when they encounter a broken pipe of the stdout stream. I checked this test will catch the broken pipe ICE regression for rustc on Linux (at least) by commenting out https://github.com/rust-lang/rust/blob/1e5719bdc40bb553089ce83525f07dfe0b2e71e9/src/bootstrap/src/core/build_steps/compile.rs#L1058, and the test failed because rustc ICE'd. ### Manual testing I have manually tried: 1. `./x clean && `./x test build --stage 1` -> `rustc +stage1 --print=sysroot | false`: no ICE. 2. `./x clean` -> `./x test run-make` twice: no stage 1 cargo rebuilds. 3. `./x clean` -> `./x build rustdoc` -> `rustdoc +stage1 --version | false`: no panics. 4. `./x test src/tools/cargo`: tests pass, notably `build::close_output` and `cargo_command::closed_output_ok` do not fail which would fail if cargo was built with `-Zon-broken-pipe=kill`. ## Related discussions Thanks to everyone who helped! - https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/Applying.20.60-Zon-broken-pipe.3Dkill.60.20flags.20in.20bootstrap.3F - https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/Modifying.20run-make.20tests.20unnecessarily.20rebuild.20stage.201.20.2E.2E.2E - https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Internal.20lint.20for.20raw.20.60print!.60.20and.20.60println!.60.3F Fixes https://github.com/rust-lang/rust/issues/130980 Closes https://github.com/rust-lang/rust/issues/131059 --- try-job: aarch64-apple try-job: x86_64-msvc try-job: x86_64-mingw
2024-10-08force `download-rustc=if-unchanged` for x86_64-gnu-tools runneronur-ozkan-11/+10
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-10-08fix `ci_rustc_if_unchanged_logic` testonur-ozkan-15/+15
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-10-08fail on {dist, install} subcommand if download-rustc is enabledonur-ozkan-0/+9
2024-10-08improve ci-rustc finding logiconur-ozkan-4/+25
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-10-08use if-unchanged only when ci rustc is availableonur-ozkan-9/+57
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-10-08add test for ci rustc's if-unchanged logiconur-ozkan-1/+50
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-10-08Add regression test for rustc/rustdoc broken pipe ICEs许杰友 Jieyou Xu (Joe)-4/+2
2024-10-07Use untracked env var to pass `-Zon-broken-pipe=kill` for tools许杰友 Jieyou Xu (Joe)-6/+42
- Don't touch rustc's `-Zon-broken-pipe=kill` env var in `compile.rs`. - Use an untracked env var to pass `-Zon-broken-pipe=kill` for tools but skip cargo still, because cargo wants `-Zon-broken-pipe=kill` unset.
2024-10-07Rollup merge of #131351 - jieyouxu:yeet-the-valgrind, r=KobzolJubilee-8/+0
Remove valgrind test suite and support from compiletest, bootstrap and opt-dist The `run-pass-valgrind` test suite is not exercised in CI, and as far as I'm aware nobody runs it (asked in https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Are.20the.20valgrind.20tests.20even.20used.20by.20anyone.3F). What's remaining of valgrind support in compiletest isn't even properly hooked up with bootstrap. The existing valgrind logic in compiletest is also straight up questionable, i.e. https://github.com/rust-lang/rust/blob/1b3b8e7b0265162853c650ead09905bc3cdaeae9/src/tools/compiletest/src/runtest/valgrind.rs#L7-L12 It just runs valgrind tests as `rpass` if no valgrind path is provided to compiletest from bootstrap -- but bootstrap doesn't even pass a valgrind path to compiletest in the first place, so this always ran as `rpass` tests. So what is this even testing? So if it's not testing anything, let's delete it. Closes #44816 by deleting the test suite :3 <img src="https://github.com/user-attachments/assets/99525bf7-e85b-40ba-9281-e4e1e275c4e8" width=300 />
2024-10-07Rollup merge of #130899 - bjorn3:wasi_bootstrap_fixes, r=davidtwcoJubilee-3/+19
Couple of changes to make it easier to compile rustc for wasm This is a subset of the patches I have on my rust fork to compile rustc for wasm32-wasip1.
2024-10-07Rollup merge of #130479 - ↵Jubilee-2/+5
onur-ozkan:llvm-bitcode-linker-multiple-candidates, r=Kobzol skip in-tree compiler build for llvm-bitcode-linker if ci-rustc is on Similar to https://github.com/rust-lang/rust/issues/108767, resolves the `multiple candidates` problem for ci-rustc. See https://github.com/rust-lang/rust/pull/122709#issuecomment-2355436227 for more context. Blocker for #122709.
2024-10-07Remove valgrind test suite support from bootstrap许杰友 Jieyou Xu (Joe)-8/+0
2024-10-06Revert "Rollup merge of #129584 - lolbinarycat:old-upstream-warning, ↵onur-ozkan-12/+1
r=albertlarsan68" This reverts commit 776187d2c9a42dc07452ae36a8b765d66bd8e2ca, reversing changes made to 7d015575ada1de8a4627fcdea416194a57a175c2.
2024-10-06Revert "Auto merge of #130121 - ↵onur-ozkan-1/+9
lolbinarycat:bootstrap-warn-old-upstream-worktree, r=albertlarsan68" This reverts commit 507c05bead4026ed8841512095b4218119eb479f, reversing changes made to 0609062a91c8f445c3e9a0de57e402f9b1b8b0a7.
2024-10-06Auto merge of #131320 - matthiaskrgr:rollup-tom15b3, r=matthiaskrgrbors-14/+49
Rollup of 5 pull requests Successful merges: - #129392 (Do not consider match/let/ref of place that evaluates to `!` to diverge, disallow coercions from them too) - #131279 (update "build/host" symlink comment) - #131312 (On function and method calls in patterns, link to the book) - #131315 (bootstrap: add `std_features` config) - #131316 (Fix typo in primitive_docs.rs) r? `@ghost` `@rustbot` modify labels: rollup
2024-10-06Rollup merge of #131315 - shrirambalaji:issue-129599-fix-shrirambalaji, ↵Matthias Krüger-13/+48
r=onur-ozkan bootstrap: add `std_features` config Adding support for a std-features config under the rust section in config.toml during bootstrap. This allows rustc devs to build with specific feature flags for local development.
2024-10-06Rollup merge of #131279 - onur-ozkan:remove-host-symlink, r=NoratriebMatthias Krüger-1/+1
update "build/host" symlink comment It's needed and can't be removed, so make it clear where it's needed.
2024-10-06Auto merge of #131075 - mrkajetanp:bootstrap-editors, r=Kobzolbors-54/+167
bootstrap: Consolidate editor setup into ./x setup editor & add support for vim, emacs & helix Add support for automatically setting up the recommended LSP config for Vim (coc-nvim), Emacs (eglot) and Helix. Additionally, refactor setup.rs to make it easier to add support for more editors in the future. As suggested, r? `@jieyouxu`
2024-10-06bootstrap: add `std_features` configShriram Balaji-13/+48
bootstrap: add std_features to config.example fix: use BTreeSet for std-features; add unit tests * fix formatting of string in front of std_features * rename `std_features` to `std-features` in config.toml fix: remove space before std-features in config.toml fix: remove explicit .into_iter conversion bootstrap: add details for rust.std-features in config.example.toml Co-authored-by: Onur Özkan <onurozkan.dev@outlook.com> fix: remove `Option<T>` from `rust_std_features` fix: move default rust_std_features to config fix: make std_features CI rustc incompatible
2024-10-06Enable sanitizers for loongarch64-unknown-*WANG Rui-0/+3
2024-10-05update "build/host" symlink commentonur-ozkan-1/+1
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-10-05Rollup merge of #130555 - hegza:rv32e, r=workingjubileeMatthias Krüger-0/+3
Initial support for riscv32{e|em|emc}_unknown_none_elf We have a research prototype of an RV32EMC target and have been successfully running the e, em, emc programs on it. I'm hoping upstreaming this configuration would make the target maintenance slightly easier. Configuration is based on the respective {i, im, imc} variants. As defined in RISC-V Unprivileged Spec. 20191213, the only change in RVE wrt. RVI is to reduce the number of integer registers to 16 (x0-x15), which also implies - 2 callee saved registers instead of 12 - 32-bit / 4-byte stack alignment instead of 128 bits / 16 bytes My initial presumption is that this will not impact how the target is defined for the compiler but only becomes relevant at the runtime level. I am willing to investigate, though. EDIT: LLVM is now told about the presumed 32-bit stack alignment. `@Disasm` `@romancardenas`
2024-10-05Auto merge of #131188 - Kobzol:remove-libstd-so-from-sysroot, r=onur-ozkanbors-2/+17
Do not copy libstd dynamic library to sysroot Since https://github.com/rust-lang/rust/pull/122362, rustc links statically to libstd.[so|dll]. Which means that the libstd.[so|dll] file no longer has to be in the rustc sysroot. However, we are currently still shipping this file, in every new release of Rust, for no reason, it's just wasted bytes. This PR removes the dynamic library file from the built sysroot. However, it is not yet performed on Windows, because stage0 incremental tests start failing there (see description of the issue [here](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Failing.20incr.20tests.20on.20Windows.20when.20std.2Edll.20is.20missing/near/474507064)). This is an extended version of https://github.com/rust-lang/rust/pull/128986. CC `@Zoxc`
2024-10-05Work around the stage0 sanity checkHenri Lunnikivi-0/+3
Add rv32e-targets to 'stage0 missing targets'. This prevents the error "no such target exists in the target list".
2024-10-05remove outdated contribution directiononur-ozkan-4/+2
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-10-04Avoid dynamic linking to libstd in `command-current-dir` testJakub Beránek-2/+2
2024-10-04Disable -Zdual-proc-macros if the target doesn't support proc-macrosbjorn3-3/+17
2024-10-03bootstrap: Consolidate editor LSP setupKajetan Puchalski-61/+76
Consolidate LSP setup for different editors into one `./x setup editor`.
2024-10-03Do not include `libstd.so` in sysroot when we statically link to libstdJakub Beránek-2/+17