about summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2024-03-04Auto merge of #120468 - alexcrichton:start-wasm32-wasi-rename, r=wesleywiserbors-1/+1
Add a new `wasm32-wasip1` target to rustc This commit adds a new target called `wasm32-wasip1` to rustc. This new target is explained in these two MCPs: * https://github.com/rust-lang/compiler-team/issues/607 * https://github.com/rust-lang/compiler-team/issues/695 In short, the previous `wasm32-wasi` target is going to be renamed to `wasm32-wasip1` to better live alongside the [new `wasm32-wasip2` target](https://github.com/rust-lang/rust/pull/119616). This new target is added alongside the `wasm32-wasi` target and has the exact same definition as the previous target. This PR is effectively a rename of `wasm32-wasi` to `wasm32-wasip1`. Note, however, that as explained in rust-lang/compiler-team#695 the previous `wasm32-wasi` target is not being removed at this time. This change will reach stable Rust before even a warning about the rename will be printed. At this time this change is just the start where a new target is introduced and users can start migrating if they support only Nightly for example.
2024-03-02Add a new `wasm32-wasip1` target to rustcAlex Crichton-1/+1
This commit adds a new target called `wasm32-wasip1` to rustc. This new target is explained in these two MCPs: * https://github.com/rust-lang/compiler-team/issues/607 * https://github.com/rust-lang/compiler-team/issues/695 In short, the previous `wasm32-wasi` target is going to be renamed to `wasm32-wasip1` to better live alongside the [new `wasm32-wasip2` target](https://github.com/rust-lang/rust/pull/119616). This new target is added alongside the `wasm32-wasi` target and has the exact same definition as the previous target. This PR is effectively a rename of `wasm32-wasi` to `wasm32-wasip1`. Note, however, that as explained in rust-lang/compiler-team#695 the previous `wasm32-wasi` target is not being removed at this time. This change will reach stable Rust before even a warning about the rename will be printed. At this time this change is just the start where a new target is introduced and users can start migrating if they support only Nightly for example.
2024-03-01Add initial support for DataFlowSanitizerRamon de C Valle-3/+3
Adds initial support for DataFlowSanitizer to the Rust compiler. It currently supports `-Zsanitizer-dataflow-abilist`. Additional options for it can be passed to LLVM command line argument processor via LLVM arguments using `llvm-args` codegen option (e.g., `-Cllvm-args=-dfsan-combine-pointer-labels-on-load=false`).
2024-03-01Auto merge of #121395 - nikic:update-llvm-21, r=cuviperbors-10/+30
Update to LLVM 18.1.0 rc 4 Fixes https://github.com/rust-lang/rust/issues/120819. Fixes https://github.com/rust-lang/rust/issues/121180. Fixes https://github.com/rust-lang/rust/issues/121239. Fixes https://github.com/rust-lang/rust/issues/121367.
2024-03-01Auto merge of #113026 - jieyouxu:run-make-v2, r=bjorn3bors-1/+80
Introduce `run-make` V2 infrastructure, a `run_make_support` library and port over 2 tests as example ## Preface See [issue #40713: Switch run-make tests from Makefiles to rust](https://github.com/rust-lang/rust/issues/40713) for more context. ## Basic Description of `run-make` V2 `run-make` V2 aims to eliminate the dependency on `make` and `Makefile`s for building `run-make`-style tests. Makefiles are replaced by *recipes* (`rmake.rs`). The current implementation runs `run-make` V2 tests in 3 steps: 1. We build the support library `run_make_support` which the `rmake.rs` recipes depend on as a tool lib. 2. We build the recipe `rmake.rs` and link in the support library. 3. We run the recipe to build and run the tests. `rmake.rs` is basically a replacement for `Makefile`, and allows running arbitrary Rust code. The support library is built using cargo, and so can depend on external crates if desired. The infrastructure implemented by this PR is very barebones, and is the minimally required infrastructure needed to build, run and pass the two example `run-make` tests ported over to the new infrastructure. ### Example `run-make` V2 test ```rs // ignore-tidy-linelength extern crate run_make_support; use std::path::PathBuf; use run_make_support::{aux_build, rustc}; fn main() { aux_build() .arg("--emit=metadata") .arg("stable.rs") .run(); let mut stable_path = PathBuf::from(env!("TMPDIR")); stable_path.push("libstable.rmeta"); let output = rustc() .arg("--emit=metadata") .arg("--extern") .arg(&format!("stable={}", &stable_path.to_string_lossy())) .arg("main.rs") .run(); let stderr = String::from_utf8_lossy(&output.stderr); let version = include_str!(concat!(env!("S"), "/src/version")); let expected_string = format!("stable since {}", version.trim()); assert!(stderr.contains(&expected_string)); } ``` ## Follow Up Work - [ ] Adjust rustc-dev-guide docs
2024-03-01Handle new LLVM sonameNikita Popov-10/+30
LLVM now includes the minor version in the soname, and also changed the names of shared object files. libLLVM-18.so is now a symlink to libLLVM.so.18.1. We need to make some changes to support this: First, we need to run the installed llvm-config binary, rather than the one from the build directory. This is because the symlink does not exist in the build directory, but llvm-config requires it. This looks like an LLVM bug to me, but it's probably a good idea to use the installed version anyway. Second, when installing LLVM into the libdir, we need to install the target of the symlink, ans this is what will get loaded at runtime. However, the rust-dev component in particular also needs to distribute the symlink itself, as download-ci-llvm will end up invoking llvm-config, which requires the symlink to exist. The symlink is not shipped in other components.
2024-02-29Add supporting infrastructure for `run-make` V2 tests许杰友 Jieyou Xu (Joe)-1/+80
2024-02-29Rollup merge of #121788 - klensy:clap-deprecated-fix, r=clubby789Guillaume Gomez-19/+19
bootstrap: fix clap deprecated warnings Run 'cargo check --features clap/deprecated' and fix warnings
2024-02-29fix clap warningsklensy-19/+19
Run 'cargo check --features clap/deprecated' and fix warnings
2024-02-29bootstrap/format: send larger batches to rustfmtRalf Jung-2/+2
2024-02-27Rename wasm32-wasi-preview2 to wasm32-wasip2Ryan Levick-2/+2
Signed-off-by: Ryan Levick <me@ryanlevick.com>
2024-02-27Add the wasm32-wasi-preview2 targetRyan Levick-3/+6
Signed-off-by: Ryan Levick <me@ryanlevick.com>
2024-02-25Auto merge of #121182 - majaha:mingw_ci_new, r=Mark-Simulacrumbors-10/+19
Improvements to building and CI for mingw/msys I was getting error messages when trying to follow the build instructions the mingw build for Rust, and managed to track the issue down to an incomparability of Rust's bootstrap program with MSYS2's version of git. Essentially, the problem is that MSYS2's git works in emulated unix-y paths, but bootstrap expects a Windows path. I found a workaround for this by using relative paths instead of absolute paths. Along with that fix, this PR also updates the build instructions for MinGW to be compatible with modern versions of MSYS2, and some changes to CI to make sure that MSYS2's version of git is tested. In particular, I'm suggesting using the [MSYS2 github action](https://github.com/marketplace/actions/setup-msys2) specially made for this purpose, which is much less hacky than the old approach and gives us more control of what packages are installed. I also cleaned up as many alternate versions of key tools as I could find from PATH, to avoid accidental usage, and cleaned up some abuses of the `CUSTOM_MINGW` environment variable. This fixes https://github.com/rust-lang/rust/issues/105696 and fixes https://github.com/rust-lang/rust/issues/117567
2024-02-25Rollup merge of #121570 - Nilstrieb:!copy, r=clubby789Matthias Krüger-99/+99
Make most bootstrap step types !Copy This makes all bootstrap types except for `Compiler` and `TargetSelection` `!Copy`. This makes it easier to modify them by adding !Copy types in the future, something that `@saethlin` has complained about before, and comes at no cost of code clarity, the impls were completely unused. Making `Compiler` and `TargetSelection` `!Copy` (which would allow getting rid of interning) is highly nontrivial as they are used and copied **all over the place**. This should hopefully get most of the benefits.
2024-02-25Auto merge of #118724 - onur-ozkan:refactor-x-install, r=Mark-Simulacrumbors-2/+22
speed up `x install` by skipping archiving and compression Performing archiving and compression on `x install` is nothing more than a waste of time and resources. Additionally, for systems like gentoo(which uses `x install`) this should be highly beneficial. [benchmark report](https://github.com/rust-lang/rust/pull/118724#issuecomment-1848964908) Resolves #109308 r? Mark-Simulacrum (I think you want to review this, feel free to change it if otherwise.)
2024-02-24Make most bootstrap step types !CopyNilstrieb-99/+99
This makes all bootstrap types except for `Compiler` and `TargetSelection` `!Copy`. This makes it easier to modify them by adding !Copy types in the future and comes at no cost of code clarity, the impls were completely unused.
2024-02-23Rollup merge of #121495 - cuishuang:master, r=clubby789Matthias Krüger-1/+1
remove repetitive words
2024-02-23remove repetitive wordscui fliter-1/+1
Signed-off-by: cui fliter <imcusg@gmail.com>
2024-02-23Rollup merge of #121476 - onur-ozkan:update-compiler-profile, r=compiler-errorsMatthias Krüger-3/+3
remove `llvm.assertions=true` in compiler profile Having this set to true disrupts compiler development workflows for people who use `llvm.download-ci-llvm = true` because we don't provide ci-llvm on the `rustc-alt-builds` server. Therefore, it is kept off by default. cc `@Nilstrieb` `@compiler-errors` For more context, see https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/CI.20LLVM.20for.20aarch64
2024-02-23Auto merge of #121341 - GrigorenkoPV:bootstrap-rustup-cargo, r=onur-ozkanbors-30/+33
bootstrap: don't resolve symlinks for initial_cargo I have put the following in my `config.toml`: ```toml # Includes one of the default files in src/bootstrap/defaults profile = "compiler" change-id = 121203 [build] cargo = "/usr/bin/cargo" rustc = "/usr/bin/rustc" rustfmt = "/usr/bin/rustfmt" ``` I have rustup installed from Arch's repos, which has all of the above paths be symlinks to `/usr/bin/rustup`. This works just fine with the `argv[0]` trick that rustup uses. However, `bootstrap` resolves symlinks to check whether `cargo` exists and then uses the resolved path, so it ends up calling `rustup` directly expecting it to behave like `cargo`. Which it doesn't. This PR removes the canonicalization step, in turn fixing the issue, but sacrificing a pretty error message. However, this exact thing is checked by `x.py` in advance, so I hope it is not a big deal?
2024-02-22set `llvm.assertions` to false in compiler profileonur-ozkan-3/+3
Having this set to true disrupts compiler development workflows for people who use `llvm.download-ci-llvm = true` because we don't provide ci-llvm on the `rustc-alt-builds` server. Therefore, it is kept off by default. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-02-22add changelog entryonur-ozkan-0/+5
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-02-22force dist.compression-profile = "no-op" for `x install`onur-ozkan-2/+17
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-02-21bootstrap: improvements for stage0 checksPavel Grigorenko-30/+33
+ Do not resolve symlinks (as this may break rustup) + Check version not just for rustc, but also for cargo. + Check that the program's self-reported name matches the expected name (such as "rustc" or "cargo").
2024-02-21Make `x test tests` workclubby789-6/+51
2024-02-21bootstrap: apply most of clippy's suggestionsPavel Grigorenko-326/+317
2024-02-19Remove the "codegen" profile from bootstrapNilstrieb-44/+17
This profile originally made sense when download-ci-llvm = if-unchanged didn't exist and we had the bad tradeoff of "never modify or always compile". Thankfully, these grim times are over and we have discovered clean water, so the only differentiator between the two profiles is the codegen profile having LLVM assertions. Adding them doesn't cause that much of a slowdown, <10% on UI tests from an unscientific benchmark. It also had LLVM warnings when compiling, which makes sense for every compiler contributor brave enough to compile LLVM. The way I removed is by just issueing a nice error message. Given that everyone with this profile should be a contributor and not someone like a distro who is more upset when things break, this should be fine. If it isn't, we can always fall back to just letting codegen mean compiler.
2024-02-19Auto merge of #121079 - onur-ozkan:install-conflicts, r=albertlarsan68bors-3/+8
distribute tool documentations and avoid file conflicts on `x install` I suggest reading commits one-by-one with the descriptions for more context about the changes. Fixes #115213
2024-02-19install rustc before the toolsonur-ozkan-2/+7
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-02-18Add `rust.frame-pointers` config optionNilstrieb-0/+19
This is very helpful for profiling. I've hacked this in many times, so let's add it properly.
2024-02-17Rollup merge of #121228 - onur-ozkan:fix-clippy-stamp-bug, r=albertlarsan68Matthias Krüger-0/+1
create stamp file for clippy Due to missing stamp file, we were downloading (and applying nix patches if enabled) continuously every time `Config::download_clippy` was called. This change fixes that by creating stamp file at the end of the function. Fixes #119442
2024-02-17Rollup merge of #121091 - onur-ozkan:bypass-stage0-download-in-tests, ↵Matthias Krüger-3/+9
r=albertlarsan68 use build.rustc config and skip-stage0-validation flag This change helps us to bypass downloading the beta compiler in bootstrap tests. more context: https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/tests.20causing.20downloads.20of.20native.20rustc.20for.20other.20platforms/near/421467975
2024-02-17create stamp file for clippy in `Config::download_clippy`onur-ozkan-0/+1
Due to missing stamp file, we were downloading (and applying nix patches if enabled) continuously every time `Config::download_clippy` was called. This change fixes that by creating stamp file at the end of the function. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-02-16Auto merge of #120348 - bjorn3:per_target_backend_selection, r=albertlarsan68bors-37/+74
Support configuring the set of codegen backends to build per host triple This allows building the compiler itself with one backend while using another backend at runtime. For example this allows compiling rustc to wasm using LLVM, while using Cranelift at runtime to produce actual code. Cranelift can't compile to wasm, but is perfectly capable of running on wasm. LLVM can compile to wasm, but can't run on wasm. [^1] [^1]: The prototype of this still requires a couple of other patches.
2024-02-15Fix bootstrap issue with git on MSYSMatt Harding-11/+20
src/bootstrap runs git to find the root of the repository, but this can go awry when building in MSYS for the mingw target. This is because MSYS git returns a unix-y path, but bootstrap requires a Windows-y path.
2024-02-14use build.rustc config and skip-stage0-validation flagonur-ozkan-3/+9
This change helps us to bypass downloading the beta compiler in bootstrap tests. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-02-14Rollup merge of #118738 - devnexen:netbsd10_update, r=cuviperOli Scherer-0/+1
Netbsd10 update
2024-02-14install tools documentationsonur-ozkan-1/+1
Previously, we were trying to install all doc files under "share/doc/rust" which caused `rust-installer` tool to create backup files (*.old) due to filename conflicts. With this change, doc files is now installed under "share/doc/{package}", where {package} could be rustc, cargo, clippy, etc. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-02-13Use CMAKE_MSVC_RUNTIME_LIBRARY instead of LLVM_USE_CRT_*Nikita Popov-3/+1
This cmake option has been removed in: https://github.com/llvm/llvm-project/commit/618e5d2c2d8e0c288c37b883ece553ca4f994c2e
2024-02-11Auto merge of #120803 - onur-ozkan:fix-compilation-cache, r=Mark-Simulacrumbors-171/+250
always run `configure_linker` except for mir-opt tests `configure_linker` now runs consistently unless it's for mir-opt tests. Previously `!= "check"` condition was causing dirt in the cargo cache between runs of `x anything-but-not-check` and `x check`. Fixes #120768 cc `@saethlin`
2024-02-11std: enabling new netbsd (10) calls.David Carlier-0/+1
Introducing a new config for this purpose as NetBSD 9 or 8 will be still around for a good while. For now, we re finally enabling sys::unix::rand::getrandom.
2024-02-10Adapt `llvm-has-rust-patches` validation to take `llvm-config` into account.Tim Neumann-4/+3
2024-02-10refactor use of `Cargo` and `configure_linker` in bootstraponur-ozkan-187/+252
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-02-10Auto merge of #120721 - onur-ozkan:incorrect-llvm-path-on-cross-target, ↵bors-3/+24
r=albertlarsan68 fix `llvm_out` to use the correct LLVM root When `download-ci-llvm` is enabled, `llvm_out` ends up with the error below due to an incorrect path on cross-compilations. This change fixes that. ```sh failed to execute command: "/rust/build/x86_64-unknown-linux-gnu/llvm/build/bin/llvm-config" "--version" ERROR: No such file or directory (os error 2) ```
2024-02-09Auto merge of #120852 - matthiaskrgr:rollup-01pr8gj, r=matthiaskrgrbors-2/+4
Rollup of 11 pull requests Successful merges: - #120351 (Implement SystemTime for UEFI) - #120354 (improve normalization of `Pointee::Metadata`) - #120776 (Move path implementations into `sys`) - #120790 (better error message on download CI LLVM failure) - #120806 (Clippy subtree update) - #120815 (Improve `Option::inspect` docs) - #120822 (Emit more specific diagnostics when enums fail to cast with `as`) - #120827 (Print image input file and checksum in CI only) - #120836 (hide impls if trait bound is proven from env) - #120844 (Build DebugInfo for async closures) - #120851 (Remove duplicate release note) r? `@ghost` `@rustbot` modify labels: rollup
2024-02-09Rollup merge of #120790 - onur-ozkan:better-error-message, r=wesleywiserMatthias Krüger-2/+4
better error message on download CI LLVM failure self-explanatory
2024-02-09Auto merge of #120676 - Mark-Simulacrum:bootstrap-bump, r=clubby789bors-4/+0
Bump bootstrap compiler to just-built 1.77 beta https://forge.rust-lang.org/release/process.html#master-bootstrap-update-t-2-day-tuesday
2024-02-09Startup objects disappearing from sysrootNicolas Roche-0/+2
When launching tests with --keep-stage option, startup objects such as rsbegin.o an rsend.o may disappear from the corresponding stageN compiler. Fix issue #120784
2024-02-08always run `configure_linker` except for mir-opt testsonur-ozkan-12/+26
`configure_linker` now runs consistently unless it's for mir-opt tests. Previously `!= "check"` condition was causing dirt in the cargo cache between runs of `x anything-but-not-check` and `x check` Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-02-08better error message on download CI LLVM failureonur-ozkan-2/+4
Signed-off-by: onur-ozkan <work@onurozkan.dev>