about summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2025-03-08handle precompiled compiler more properlyonur-ozkan-15/+19
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-03-07Rollup merge of #137537 - jieyouxu:daily-rmake, r=KobzolJacob Pratt-1/+1
Prevent `rmake.rs` from using unstable features, and fix 3 run-make tests that currently do Addresses (mostly) #137532. Follow-up to #137373. ### Summary - Fix 3 run-make tests that currently use unstable features: 1. `tests/run-make/issue-107495-archive-permissions/rmake.rs` uses `#![feature(rustc_private)]` for `libc` on `unix`, but `run_make_support` already exports `libc`, so just use that. 2. `tests/run-make/cross-lang-lto/rmake.rs` uses `#![feature(path_file_prefix)]` for convenience, replaced with similar filename prefix logic. 3. `tests/run-make/broken-pipe-no-ice/rmake.rs` uses `#![feature(anonymous_pipe)]` for anonymous pipes. This is more complicated[^race-condition], and I decided to temporarily introduce a dependency on [`os_pipe`] before std's `anonymous_pipe` library feature is stabilized[^pipe-stab]. I left a FIXME tracked by #137532 to make the switch once `anonymous_pipe` stabilizes and reaches beta. - Use `RUSTC_BOOTSTRAP=-1` when building `rmake.rs` to have the stage 0 rustc reject any unstable features used in `rmake.rs`. - The requirement that `rmake.rs` may not use any unstable features is now documented in rustc-dev-guide. - This PR does not impose `RUSTC_BOOTSTRAP=-1` when building `run-make-support`, but I suppose we could. r? `@Kobzol` try-job: x86_64-msvc-1 try-job: x86_64-mingw-1 [`os_pipe`]: https://github.com/oconnor663/os_pipe.rs [^race-condition]: We can't just try to spawn `rustc` and immediate close the stderr handle because of race condition, as there's no guarantee `rustc` will not try to print to stderr before the handle gets closed. [^pipe-stab]: In-progress stabilization PR over at https://github.com/rust-lang/rust/pull/135822.
2025-03-08Specify rust lints for `compiler/` crates via Cargo.Nicholas Nethercote-4/+9
By naming them in `[workspace.lints.rust]` in the top-level `Cargo.toml`, and then making all `compiler/` crates inherit them with `[lints] workspace = true`. (I omitted `rustc_codegen_{cranelift,gcc}`, because they're a bit different.) The advantages of this over the current approach: - It uses a standard Cargo feature, rather than special handling in bootstrap. So, easier to understand, and less likely to get accidentally broken in the future. - It works for proc macro crates. It's a shame it doesn't work for rustc-specific lints, as the comments explain.
2025-03-07Move all alloc integration tests to a new alloctests cratebjorn3-5/+14
2025-03-07Auto merge of #138148 - onur-ozkan:fix-llvm-bitcode-build, r=jieyouxubors-4/+4
use target compiler on llvm-bitcode-linker The build compiler is already resolved inside the `ToolBuild` step, so we should pass only the target compilers for `Mode::ToolRustc` tools. Fixes https://github.com/rust-lang/rust/issues/138123 r? ghost try-job: dist-powerpc64le-linux
2025-03-07Apply `--cfg windows_raw_dylib` for bootstrap tools tooJieyou Xu-1/+1
This is already applied for rustc/std tools. This is needed to make `windows` crates avoid trying to depend on a generated `windows.0.xx.0.lib`.
2025-03-07use target compiler on llvm-bitcode-linkeronur-ozkan-4/+4
The build compiler is already resolved inside the `ToolBuild` step, so we should pass only the target compilers for `Mode::ToolRustc` tools. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-03-06Rollup merge of #138078 - moxian:rember-warns, r=KobzolMichael Goulet-6/+7
Reduce the noise of bootstrap changelog warnings in --dry-run mode Presently x.py displays "There have been changes to x.py since you last updated:" note only once when run normally, but on every invocation when run with `--dry-run`. The disparity is not exactly intentonal, but just a historical accident. It was made to be printed once in https://github.com/rust-lang/rust/pull/117815 via storing `.last-warned-change-id` on disk in `{config.out}/bootstrap` (i.e. `build/bootstrap`) directory. But that didn't quite work for `--dry-run`, since `{config.out}/bootsrap` points to `build/tmp-dry-run/bootstrap` which *isn't* created in dry-run mode, so file creation fails. This got fixed in https://github.com/rust-lang/rust/pull/118789 and now `--dry-run` does not save `.last-warned-change-id` at all. (Nor does it read it, since it cannot know to read from non-dry-run location) This PR simply stops displaying the changelog altogether in --dry-run mode. <details> <summary>previous attempt (outdated)</summary> This PR takes a different approach, and instead of not-writing the stamp in `--dry-run` mode it instead tries harder to yes-write it, and, specifically, creates `build/tmp-dry-run/bootstrap` directory to do so. If neccessary (i.e. if there are changes newer than the `change-id` stamp of config.toml to warn about). Note that `build/tmp-dry-run/` was *already* being created, so making an extra `boostrap` sub-folder should not meaningfully pollute the build dir. </details> (Apologies for the, perhaps, excessively wordy PR, I'm new to this)
2025-03-06Rollup merge of #138041 - ↵Michael Goulet-3/+3
thaliaarchi:use-prelude-size-of.boostrap-compiletest, r=jieyouxu bootstrap and compiletest: Use `size_of_val` from the prelude instead of imported Use `std::mem::size_of_val` from the prelude instead of importing or qualifying it. This function was added to all preludes in Rust 1.80. r? ``@jieyouxu``
2025-03-06Auto merge of #138039 - onur-ozkan:handle-forced-compiler-on-tools, r=jieyouxubors-86/+145
handle forced compiler and revert #137476 Fixes https://github.com/rust-lang/rust/issues/138004 I would appreciate it if we could measure CI pipelines with the current changes to see if this reduces recent CI overhead. cc `@rust-lang/infra` try-job: dist-powerpc64le-linux
2025-03-06Don't even bother checking changelog in --dry-run modemoxian-6/+6
2025-03-05Leave a breadcrumb towards bootstrap config documentationmoxian-2/+3
2025-03-05Remember silenced bootstrap changelog warnings even in --dry-runmoxian-1/+2
2025-03-05bootstrap and compiletest: Use size_of_val from the prelude instead of importedThalia Archibald-3/+3
Use `std::mem::size_of_val` from the prelude instead of importing or qualifying it. This function was added to all preludes in Rust 1.80.
2025-03-05Rollup merge of #137723 - onur-ozkan:cfg-ver-description, ↵许杰友 Jieyou Xu (Joe)-3/+26
r=pietroalbini,weihanglo Make `rust.description` more general-purpose and pass `CFG_VER_DESCRIPTION` Moves the `description` field from the `rust` section to the `build` section as it can be useful for tools and is not specific to rustc. Also passes this value to tool builds through the `CFG_VER_DESCRIPTION` env. Motivated from https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Propagate.20rust.2Edescription.20to.20tools.20in.20dist.20build
2025-03-05Rollup merge of #137679 - bjorn3:coretests_improvements, r=jieyouxu,onur-ozkan许杰友 Jieyou Xu (Joe)-67/+24
Various coretests improvements The first commit is not yet strictly necessary as directly testing libcore works though useless work, but will be necessary once https://github.com/rust-lang/rust/pull/136642 migrates the liballoc tests into a separate package. The second commit fixes https://github.com/rust-lang/rust/issues/137478 and ensures that coretests actually gets tested on all CI job. The third commit fixes an error that didn't get caught because coretests doesn't run on the wasm32 CI job.
2025-03-05bless bootstrap testsonur-ozkan-1/+0
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-03-05Revert "avoid `compiler_for` for dist tools and force the current compiler"onur-ozkan-11/+47
This reverts commit 50f84129e66de867a735ee836339e8ed9dd7425e.
2025-03-05handle forced compiler in `get_tool_rustc_compiler`onur-ozkan-0/+2
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-03-05add new field `forced_compiler` to `Compiler`onur-ozkan-75/+97
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-03-05replace `rust.description` with `build.description`onur-ozkan-1/+1
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-03-05pass `CFG_VER_DESCRIPTION` to tool buildsonur-ozkan-0/+9
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-03-05add change-entryonur-ozkan-0/+5
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-03-05move `rust.description` to `build.description`onur-ozkan-2/+11
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-03-04Rollup merge of #137667 - Kobzol:gcc-dist-build, r=onur-ozkanJubilee-0/+28
Add `dist::Gcc` build step This PR adds a `dist:Gcc` bootstrap step to distribute a prebuilt `libgccjit.so` from CI on x64 Linux. With primed sccache, the build takes ~4 minutes on CI, and produces a 50 MiB archive. I want to land this before adding something akin to `[gcc] download-ci-gcc = true`, to already have the artifacts available on CI, to make it easier to setup the download merge-base logic. r? ``@ghost``
2025-03-04Rollup merge of #137373 - Kobzol:tool-stage0-improve, r=jieyouxuJubilee-130/+47
Compile run-make-support and run-make tests with the bootstrap compiler It does not seem necessary to have to recompile run-make-support on changes to the local compiler/stdlib. This PR simplifies the implementation of a few tools, then switches rms to stage0 and also makes the handling of environment variables in run-make tests simpler. Best reviewed commit-by-commit. I can split it into multiple PRs if you want. Also tested that `COMPILETEST_FORCE_STAGE0=1 ./x test tests/run-make --stage 0` still works. Incredibly, it looks like it even passes more tests than on `master` :laughing: r? ``@jieyouxu``
2025-03-04Store bootstrap command-line into metricsJakub Beránek-0/+8
2025-03-04add support for extend rust tools and sanitizerLuuuXXX-1/+10
2025-03-04Revert "add fix for full tools and sanitizer"LuuuXXX-13/+0
This reverts commit 6efacfb7a59ebde2620398861713fae136060a04.
2025-03-04add fix for full tools and sanitizerLuuuXXX-0/+13
2025-03-04promote ohos targets to tier to with host toolsLuuuXXX-0/+4
2025-03-03Rollup merge of #137882 - onur-ozkan:remove-extra-compiler-stage, r=KobzolMatthias Krüger-9/+44
do not build additional stage on compiler paths When calling `x build compiler (or rustc) --stage N` bootstrap builds stage N+1 compiler, which is clearly not what we requested. This doesn't happen when running `x build --stage N` without explicitly targeting the compiler. The changes applied fix this issue. r? ghost
2025-03-02extend scope of build_all testonur-ozkan-5/+40
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-03-02do not build additional stage on compiler pathsonur-ozkan-5/+5
When calling `x build compiler (or rustc) --stage N` bootstrap builds stage N+1 compiler, which is clearly not what we requested. This doesn't happen when running `x build --stage N` without explicitly targeting the compiler. The changes applied fix this issue. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-03-01Compile run-make recipes using the stage0 compilerJakub Beránek-0/+5
2025-03-01Auto merge of #137796 - jieyouxu:rollup-qt9yr1g, r=jieyouxubors-14/+32
Rollup of 10 pull requests Successful merges: - #134943 (Add FileCheck annotations to mir-opt/issues) - #137017 (Don't error when adding a staticlib with bitcode files compiled by newer LLVM) - #137197 (Update some comparison codegen tests now that they pass in LLVM20) - #137540 (Fix (more) test directives that were accidentally ignored) - #137551 (import `simd_` intrinsics) - #137599 (tests: use minicore more) - #137673 (Fix Windows `Command` search path bug) - #137676 (linker: Fix escaping style for response files on Windows) - #137693 (Re-enable `--generate-link-to-defintion` for tools internal rustdoc) - #137770 (Fix sized constraint for unsafe binder) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-28Implement `RunMake` test suite using the `test!` macroJakub Beránek-34/+4
2025-02-28Implement `RunMakeSupport` tool using the `bootstrap_tool!` macroJakub Beránek-53/+1
2025-02-28Allow specifying that tools build a library, not a binaryJakub Beránek-4/+36
2025-02-28Create the `OptimizedDist` tool with a macroJakub Beránek-39/+1
2025-02-28Rollup merge of #137693 - aDotInTheVoid:gaming, r=onur-ozkan,GuillaumeGomez许杰友 Jieyou Xu (Joe)-3/+1
Re-enable `--generate-link-to-defintion` for tools internal rustdoc ~~These were removed because they used to break the build: https://github.com/rust-lang/rust/pull/122066#issuecomment-1983049222, but testing locally it seems to work now.~~ This was re enabled in #136589, but only for rustc, not tools. The FIXME that prompted removing this is still present. Do we have an issue with an MCVE for this? CC ```@GuillaumeGomez``` https://github.com/rust-lang/rust/blob/ac91805f3179fc2225c60e8ccf5a1daa09d43f3d/src/librustdoc/html/render/span_map.rs#L178-L182 try-job: aarch64-apple
2025-02-28Rollup merge of #137676 - petrochenkov:winresp, r=Kobzol许杰友 Jieyou Xu (Joe)-11/+31
linker: Fix escaping style for response files on Windows If we use a С/С++ compiler as linker, then Posix-style escaping should be used. Also temporarily fixup rustbuild to not fail at least in common scenarios, until the bootstrap compiler is updated. Fixes https://github.com/rust-lang/rust/issues/137498
2025-02-28support rust.channel = "auto-detect"Pietro Albini-1/+10
2025-02-28Add `dist:Gcc` build stepJakub Beránek-0/+28
To distribute the prebuilt libgccjit.so from CI.
2025-02-27Rollup merge of #136542 - jieyouxu:build-base, r=onur-ozkanMatthias Krüger-2/+6
[`compiletest`-related cleanups 4/7] Make the distinction between root build directory vs test suite specific build directory in compiletest less confusing Reference for overall changes: https://github.com/rust-lang/rust/pull/136437 Part **4** of **7** of the *`compiletest`-related cleanups* PR series. ### Summary - Remove `--build-base` compiletest flag, and introduce `--build-{root,test-suite-root}` flags instead. `--build-base` previously actually is test suite specific build directory, not the root `build/` directory. - Feed the root build directory directly from bootstrap to compiletest via `--build-root` instead of doing multiple layers of parent unwrapping[^parent] based on the test suite specific build directory. - Remove a redundant `to_path_buf()`. [^parent]: Please do not unwrap the parents. r? bootstrap
2025-02-27Auto merge of #132295 - the8472:remove-randomize-exclusion1, r=onur-ozkanbors-3/+2
fixed wast version was released, remove randomization exemption
2025-02-26Re-enable `--generate-link-to-defintion` for tools internal rustdocAlona Enraght-Moony-3/+1
2025-02-26Also test coretests when running ./x.py test corebjorn3-8/+9
It is reasonable to expect that ./x.py test core is enough to run tests when you are working on core. In addition it seems like CI for wasm32 at least doesn't run coretests currently, which this commit fixes.
2025-02-26Stop passing --lib to cargo testbjorn3-59/+15
This overrides the test=false flag in Cargo.toml and it shouldn't be necessary as --tests is already passed.
2025-02-26linker: Fix escaping style for response files on WindowsVadim Petrochenkov-11/+31
If we use a С/С++ compiler as linker, then Posix-style escaping should be used.