about summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
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.
2025-02-26Auto merge of #137036 - jieyouxu:drivers-license, r=Kobzolbors-0/+6
Include version number of libs being built in cargo lib metadata (esp. `librustc_driver*.so`) Previously, on a non-stable channel, it's possible for two builds from different versioned sources (e.g. 1.84.0 vs 1.84.1) to produce a `librustc_driver*.so` with the same filename hashes. This causes problems with side-by-side installs wrt. linker search paths because 1.84.1 rustc bin and 1.84.0 rustc bin may try to link to the "same" `librustc_driver*.so` (same filename hash) but fail because the contents of the so is actually different. We try to mitigate this by including the version number of artifacts being built via `__CARGO_DEFAULT_LIB_METADATA` (kind of an ugly hack, but I don't think cargo has a way for us to tell cargo to use a package version override). Fixes #136701 (mitigates, really). ### Testing Tested manually[^host] by: ```bash $ cat src/version 1.86.0 $ ./x build library # w/ compiler profile, (non-stable) dev channel $ lddtree build/host/stage1/bin/rustc rustc => build/host/stage1/bin/rustc (interpreter => /lib64/ld-linux-x86-64.so.2) librustc_driver-ea1b1b2291881cc4.so => build/host/stage1/bin/../lib/librustc_driver-ea1b1b2291881cc4.so [...] ``` and observing that changing `src/version` to bump a point release causes `librustc_driver*.so` to have a different hash while sources are unmodified otherwise. ```bash $ cat src/version 1.86.1 $ ./x build library # w/ compiler profile, (non-stable) dev channel $ lddtree build/host/stage1/bin/rustc rustc => build/host/stage1/bin/rustc (interpreter => /lib64/ld-linux-x86-64.so.2) librustc_driver-746badadbcb74721.so => build/host/stage1/bin/../lib/librustc_driver-746badadbcb74721.so [...] ``` cc `@clan` `@demize` could you check that if you backport this change against 1.84.{0,1} as reported in #136701, that the produced `rustc` binary works, under the context of the Gentoo build system setup? [^host]: on a `x86_64-unknown-linux-gnu` host, no cross
2025-02-26Auto merge of #136921 - Kobzol:gcc-build, r=onur-ozkanbors-15/+52
Build GCC on CI Previously, we have downloaded a specific commit of GCC and prebuilt it inside Docker using the `build-gccjit.sh` script. This PR removes that scripts and uses the bootstrap GCC step. This allows us to use the `src/gcc` submodule for determining which GCC should be built, and it also moves the logic closer to LLVM, which is also built by bootstrap. A few things to note: - The `sccache` option is currently in the `llvm` block, so the GCC build uses `llvm.ccache`, which is a bit weird :) We could either add `gcc.ccache`, or (what I think would be better) to just move `ccache` to the `build` section, as I don't think that it will be necessary to use ccache for LLVM, but not for GCC. - When the GCC codegen backend is built, it needs to depend on a step that first builds GCC. This is currently done in a hacky way. The proper solution is to create a separate step for the GCC codegen backend, but that is a larger change. Let me know what you think. r? `@onur-ozkan` try-job: i686-msvc-1 try-job: x86_64-mingw-1
2025-02-25Rollup merge of #137522 - onur-ozkan:137215-follow-ups, r=KobzolLeón Orell Valerian Liehr-6/+99
use stage 2 on cargo and clippy tests when possible Follow-up for #137215. For more context, read the discussion starting from https://github.com/rust-lang/rust/pull/137215#issuecomment-2674395959. r? Kobzol (Feel free to re-r if you are not available).
2025-02-25Rollup merge of #137460 - onur-ozkan:downgrade-cc, r=jieyouxuLeón Orell Valerian Liehr-3/+5
downgrade bootstrap `cc` Current `cc` version causing bootstrap to fail on custom targets. See https://github.com/rust-lang/cc-rs/issues/1317 for more context. Fixes (after beta and stable backports): https://github.com/rust-lang/rust/issues/137064 and https://github.com/rust-lang/rust/issues/135271
2025-02-24Rollup merge of #137493 - nabijaczleweli:python3, r=KobzolTrevor Gross-1/+1
configure.py: don't instruct user to run nonexistent program ```shell-session $ ./configure configure: processing command line configure: configure: build.configure-args := [] configure: profile := dist configure: configure: writing `config.toml` in current directory configure: configure: run `python /mnt/filling/store/nabijaczleweli/code/rust/x.py --help` ``` This is naturally not valid since I don't have a "python" executable (and this will hopefully become more and more true as Python 2 dies out). ./configure knows this since it does `try python3 "$``@"`,`` then `python2.7` &c. After, this now says ``` configure: run `python3 /mnt/filling/store/nabijaczleweli/code/rust/x.py --help` ``` which is possible, and corresponds to the interpreter actually running.