about summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2024-07-24Rollup merge of #128108 - onur-ozkan:ensure-std-for-precompiled-rustc, r=KobzolMatthias Krüger-0/+1
ensure std step before preparing sysroot When using download-rustc, any stage other than 0 or 1 (e.g., cargo +stage2 build/doc) will fail to find std while compiling on simple rust sources. Ensuring the std step fixes this issue. r? Kobzol
2024-07-23ensure std step before preparing sysrootonur-ozkan-0/+1
When using download-rustc, any stage other than 0 or 1 (e.g., cargo +stage2 build/doc) will fail to find std while compiling on simple rust sources. Ensuring the rustc step fixes this issue. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-23Rollup merge of #128098 - onur-ozkan:incompatible-option-behaviour, r=KobzolMatthias Krüger-11/+25
make it possible to disable download-rustc if it's incompatible Primarily needed by CI runners to avoid handling download-rustc incompatible options one by one on shell scripts. This will significantly help to #122709.
2024-07-23Rollup merge of #128060 - ↵Matthias Krüger-0/+5
alexcrichton:include-wasm-component-ld-for-real-this-time-maybe-let-see-after-this-merges, r=onur-ozkan Fix inclusion of `wasm-component-ld` in dist artifacts This is another accidental omission from #126967 (in addition to #127867) which fixes an issue where `wasm-component-ld` isn't distributed via rustup just yet because while it's present in the sysroot it's not present in the tarballs.
2024-07-23make it possible to disable download-rustc if it's incompatibleonur-ozkan-11/+25
Primarily needed by CI runners to avoid handling download-rustc incompatible options one by one on shell scripts. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-22Fix inclusion of `wasm-component-ld` in dist artifactsAlex Crichton-0/+5
This is another accidental omission from #126967 (in addition to #127867) which fixes an issue where `wasm-component-ld` isn't distributed via rustup just yet because while it's present in the sysroot it's not present in the tarballs.
2024-07-22Move rustbook to its own workspace.Eric Huss-3/+14
2024-07-22Rollup merge of #127510 - tgross35:test-float-parse-update, r=Mark-Simulacrum许杰友 Jieyou Xu (Joe)-0/+83
Rewrite `test-float-parse` in Rust Migrate from the currently broken Rust + Python `test-float-parse` to a Rust implementation. This newer version should be significantly faster (tests execute in parallel with threads, rather than series across multiple processes, which also eliminates the "...the worker processes are leaked and stick around forever" message), and should be significantly easier to extend to the new float types. Since this is faster and hopefully more stable, we should be able to launch it with `x` and run the faster tests in CI.
2024-07-22Rollup merge of #127177 - bjorn3:arm64_macos_cg_clif, r=Mark-Simulacrum许杰友 Jieyou Xu (Joe)-1/+3
Distribute rustc_codegen_cranelift for arm64 macOS Support for arm64 macOS has been added to rustc_codegen_cranelift recently. Fixes https://github.com/rust-lang/rustc_codegen_cranelift/issues/1502
2024-07-21Run `test-float-parse` as part of CITrevor Gross-0/+1
With the previous improvements, it is now possible to run float parsing tests as part of CI. Enable it here. This only runs a subset of tests, which takes about one minute.
2024-07-20Expose `test-float-parse` via bootstrapTrevor Gross-0/+82
With updates to `test-float-parse`, it is now possible to run as another Rust tool. Enable check, clippy, and test. Test runs the unit tests, as well as shorter parsing tests (takes approximately 1 minute).
2024-07-20Rollup merge of #127463 - onur-ozkan:precompiled-rustdoc, r=KobzolMatthias Krüger-46/+106
use precompiled rustdoc with CI rustc When CI rustc is enabled and rustdoc sources are unchanged, we can use the precompiled rustdoc from the CI rustc's sysroot. This speeds up bootstrapping quite a lot by avoiding unnecessary rustdoc compilation.
2024-07-20use precompiled rustdoc with CI rustconur-ozkan-6/+53
When CI rustc is enabled and rustdoc sources are unchanged, we can use the precompiled rustdoc from the CI rustc's sysroot. This speeds up bootstrapping quite a lot by avoiding unnecessary rustdoc compilation. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-20Rollup merge of #127984 - nyurik:src-refs, r=onur-ozkanMatthias Krüger-8/+8
Avoid ref when using format! in src Clean up a few minor refs in `format!` macro, as it has a performance cost. Apparently the compiler is unable to inline `format!("{}", &variable)`, and does a run-time double-reference instead (format macro already does one level referencing).  Inlining format args prevents accidental `&` misuse. See also https://github.com/rust-lang/rust-clippy/issues/10851
2024-07-19Avoid ref when using format! in compilerYuri Astrakhan-8/+8
Clean up a few minor refs in `format!` macro, as it has a performance cost. Apparently the compiler is unable to inline `format!("{}", &variable)`, and does a run-time double-reference instead (format macro already does one level referencing).  Inlining format args prevents accidental `&` misuse.
2024-07-19Add a change tracker entryAlex Crichton-0/+5
2024-07-19Conditionally build `wasm-component-ld`Alex Crichton-5/+20
This commit updates the support for the `wasm-component-ld` tool from #126967 to conditionally build it rather than unconditionally building it when LLD is enabled. This support is disabled by default and can be enabled by one of two means: * the `extended` field in `config.toml` which dist builders use to build a complete set of tools for each host platform. * a `"wasm-component-ld"` entry in the `tools` section of `config.toml`. Neither of these are enabled by default meaning that most local builds will likely not have this new tool built. Dist builders should still, however, build the tool.
2024-07-18Rollup merge of #127913 - onur-ozkan:broken-defaults, r=KobzolMatthias Krüger-4/+5
remove `debug-logging` default from tools profile `debug-logging` conflicts with `download-rustc` option, and doesn't really make sense to enable it for a profile that is used for tool development.
2024-07-18Allow a git command for getting the current branch in bootstrap to failJakub Beránek-0/+1
It can fail when in git is in detached HEAD mode.
2024-07-18remove `debug-logging` default from tools profileonur-ozkan-4/+5
`debug-logging` conflicts with `download-rustc` option, and doesn't really make sense to enable it for a profile that is used for tool development. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-18Add missing GHA group for building `llvm-bitcode-linker`Jakub Beránek-0/+9
2024-07-17abstract merge-base commit logiconur-ozkan-40/+53
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-17Auto merge of #127851 - tgross35:rollup-i39um74, r=tgross35bors-1/+1
Rollup of 4 pull requests Successful merges: - #127763 (Make more Windows functions `#![deny(unsafe_op_in_unsafe_fn)]`) - #127813 (Prevent double reference in generic futex) - #127847 (Reviewer on vacation) - #127850 (bootstrap: open `llvm-config` as r+w) r? `@ghost` `@rustbot` modify labels: rollup
2024-07-17Auto merge of #127602 - onur-ozkan:calling-order, r=Kobzolbors-1/+33
maintain the given order on step execution Previously step execution disregarded the CLI order and this change executes the given steps in the order specified on CLI. For example, running `x $kind a b c` will execute `$kind` step for `a`, then `b`, then `c` crates in the specified order. Fixes #126165 cc `@matthiaskrgr`
2024-07-17maintain the given order on step executiononur-ozkan-1/+33
Previously step execution disregarded the CLI order and this change executes the given steps in the order specified on CLI. For example, running `x $kind a b c` will execute `$kind` step for `a`, then `b`, then `c` crates in the specified order. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-17bootstrap: open llvm_config as r+w许杰友 Jieyou Xu (Joe)-1/+1
This previously failed on Windows because the `llvm_config` file was open as read-only.
2024-07-16Rollup merge of #126967 - alexcrichton:wasm32-wasip2-tier-2, r=Mark-SimulacrumTrevor Gross-0/+16
Promote the `wasm32-wasip2` target to Tier 2 This commit promotes the `wasm32-wasip2` Rust target to tier 2 as proposed in rust-lang/compiler-team#760. There are two major changes in this PR: 1. The `dist-various-2` container, which already produces the other WASI targets, now has an extra target added for `wasm32-wasip2`. 2. A new `wasm-component-ld` binary is added to all host toolchains when LLD is enabled. This is the linker used for the `wasm32-wasip2` target. This new linker is added for all host toolchains to ensure that all host toolchains can produce the `wasm32-wasip2` target. This is similar to how `rust-lld` was originally included for all host toolchains to be able to produce WebAssembly output when the targets were first added. The new linker is developed [here][wasm-component-ld] and is pulled in via a crates.io-based dependency to the tree here. [wasm-component-ld]: https://github.com/bytecodealliance/wasm-component-ld
2024-07-16Rollup merge of #127730 - compiler-errors:ed-2024-unsafe, r=petrochenkovMatthias Krüger-0/+1
Fix and enforce `unsafe_op_in_unsafe_fn` in compiler In preparation for edition 2024, this PR previews the fallout of enabling the `unsafe_op_in_unsafe_fn` lint in the compiler, since it's defaulting to warn in the new edition (#112038). The major annoyance comes primarily from the `rustc_codegen_llvm` module, where there's a ton of unsafe calls. I tended to wrap individual calls to unsafe fns in `unsafe {}`, but there a handful of places I chose to just wrap several calls in an `unsafe {}` block just because it would've been excessive to wrap each call individually. This doesn't enable the lint for the standard library, since I'm not totally certain what T-libs prefers w/ this lint.
2024-07-16Auto merge of #127680 - Kobzol:bootstrap-cmd-refactor-6, r=onur-ozkanbors-173/+147
Bootstrap command refactoring: port remaining commands with access to `Build` (step 6) Continuation of https://github.com/rust-lang/rust/pull/127450. This PR ports commands in bootstrap that can easily get access to `Build(er)` to `BootstrapCommand`. After this PR, everything that can access `Build(er)` should be using the new API. Statistics of `bootstrap` code (ignoring `src/bin/<shims>`) after this PR: ``` 7 usages of `Command::new` 69 usages of `command()` (new API) - out of that: 16 usages of `as_command_mut()` (new API, but accesses the inner command) ``` Tracking issue: https://github.com/rust-lang/rust/issues/126819 r? `@onur-ozkan`
2024-07-16Fix unsafe_op_in_unsafe_fn in compilerMichael Goulet-0/+1
2024-07-15Don't use stage0 compiler for wasm-component-ldAlex Crichton-2/+2
Switch it to using a just-built standard library which enables it to be cross compiled. Additionally allow it access to `min_specialization` which `ahash`, a dependency, wants.
2024-07-15Make sure to run git submodule checkout in dry run modeJakub Beránek-1/+15
2024-07-15Move `force_coloring_in_ci` from `builder_helper` to `bootstrap`Jakub Beránek-4/+15
It was only used in bootstrap. This move allows us to modify the function to work with `BootstrapCommand`, rather than `Command`.
2024-07-14Fix trivial gen ident usage in toolsMichael Goulet-1/+1
2024-07-14Stop using the gen keyword in the compilerMichael Goulet-0/+3
2024-07-14Remove several usages of the `as_command_mut` methodJakub Beránek-115/+78
Passes `&Builder<'_>` to additional places, so that they could use the `BootstrapCommand` APIs directly, rather than going through `as_command_mut`.
2024-07-14Port all remaining simple command usages in bootstrap to `BootstrapCommand`Jakub Beránek-54/+40
2024-07-14Rollup merge of #127697 - onur-ozkan:use-std-filetimes, r=KobzolMatthias Krüger-11/+17
use std for file mtime and atime modifications Since 1.75 std provides an interface to set access and modified times on files. This change replaces the external dependency previously used for these operations with the corresponding std functions.
2024-07-14Rollup merge of #127322 - onur-ozkan:ci-rustc-incompatible-options, ↵Matthias Krüger-7/+118
r=Mark-Simulacrum handle ci-rustc incompatible options during config parse This PR ensures that `config.toml` does not use CI rustc incompatible options when CI rustc is enabled (just like [ci-llvm checks](https://github.com/rust-lang/rust/blob/e2cf31a6148725bde4ea48acf1e4fe72675257a2/src/bootstrap/src/core/config/config.rs#L1809-L1836)). Some options can change compiler's behavior in certain scenarios. If we don't check these incompatible options, CI runners using CI rustc might ignore options we have explicitly set. This could be dangerous as we might think a rustc test passed with option T but in fact it wasn't tested with option T. Later in https://github.com/rust-lang/rust/pull/122709, I will disable CI rustc if any of those options were used (similar to [this approach](https://github.com/rust-lang/rust/blob/dd2c24aafddbd9cc170f32f5b447c7d3005c7412/src/ci/run.sh#L165-L169)). If CI runners fail because of these checks, it means the logic in run.sh isn't covering the incompatible options correctly (since any incompatible option should turn off CI rustc). The list may not be complete, but should be a good first step as it's better than nothing! Blocker for https://github.com/rust-lang/rust/pull/122709
2024-07-14Auto merge of #127706 - workingjubilee:rollup-d07ij30, r=workingjubileebors-30/+29
Rollup of 6 pull requests Successful merges: - #122300 (Add FileCheck annotations to mir-opt/dest-prop tests) - #127434 (use "bootstrap" instead of "rustbuild" in comments and docs) - #127477 (Clear `inner_attr_ranges` regularly.) - #127558 (More attribute cleanups) - #127659 (Use ManuallyDrop in BufWriter::into_parts) - #127671 (rustdoc: rename `issue-\d+.rs` tests to have meaningful names (part 8)) r? `@ghost` `@rustbot` modify labels: rollup
2024-07-13Rollup merge of #127434 - onur-ozkan:use-bootstrap-instead-of-rustbuild, ↵Jubilee-30/+29
r=Mark-Simulacrum use "bootstrap" instead of "rustbuild" in comments and docs Let's stick with the single name "bootstrap" to refer to the bootstrap project to avoid confusion. This should make it clearer, especially for new contributors.
2024-07-13Rollup merge of #127677 - onur-ozkan:use-correct-modes, r=KobzolJubilee-3/+4
using correct tool mode for `run-make-support` crate We don't need to ensure std (and rustc) for testing run-make-support's unit tests. Using stage 0 compiler is already enough and speeds up `x test run-make-support` invocations on a clean build.
2024-07-13Rollup merge of #127446 - zachs18:miri-stdlib-leaks-core-alloc, ↵Jubilee-4/+3
r=Mark-Simulacrum Remove memory leaks in doctests in `core`, `alloc`, and `std` cc `@RalfJung` https://github.com/rust-lang/rust/issues/126067 https://github.com/rust-lang/miri/issues/3670 Should be no actual *documentation* changes[^1], all added/modified lines in the doctests are hidden with `#`, This PR splits the existing memory leaks in doctests in `core`, `alloc`, and `std` into two general categories: 1. "Non-focused" memory leaks that are incidental to the thing being documented, and/or are easy to remove, i.e. they are only there because preventing the leak would make the doctest less clear and/or concise. - These doctests simply have a comment like `# // Prevent leaks for Miri.` above the added line that removes the memory leak. - [^2]Some of these would perhaps be better as part of the public documentation part of the doctest, to clarify that a memory leak can happen if it is not otherwise mentioned explicitly in the documentation (specifically the ones in `(A)Rc::increment_strong_count(_in)`). 2. "Focused" memory leaks that are intentional and documented, and/or are possibly fragile to remove. - These doctests have a `# // FIXME` comment above the line that removes the memory leak, with a note that once `-Zmiri-disable-leak-check` can be applied at test granularity, these tests should be "un-unleakified" and have `-Zmiri-disable-leak-check` enabled. - Some of these are possibly fragile (e.g. unleaking the result of `Vec::leak`) and thus should definitely not be made part of the documentation. This should be all of the leaks currently in `core` and `alloc`. I only found one leak in `std`, and it was in the first category (excluding the modules `@RalfJung` mentioned in https://github.com/rust-lang/rust/issues/126067 , and reducing the number of iterations of [one test](https://github.com/rust-lang/rust/blob/master/library/std/src/sync/once_lock.rs#L49-L94) from 1000 to 10) [^1]: assuming [^2] is not added [^2]: backlink
2024-07-14use std for file mtime and atime modificationsonur-ozkan-11/+17
Since 1.75 std provides an interface to set access and modified times on files. This change replaces the external dependency previously used for these operations with the corresponding std functions. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-13explain why we use in-tree std for compiletestonur-ozkan-0/+2
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-13use `ModeToolBootstrap` for run-make-support's crate testsonur-ozkan-3/+2
We don't need to ensure std (and rustc) for testing run-make-support's unit tests. Using stage 0 compiler is already enough and speeds up `x test run-make-support` invocations on a clean build. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-13Auto merge of #127450 - Kobzol:bootstrap-cmd-refactor-5, r=onur-ozkanbors-73/+175
Bootstrap command refactoring: improve debuggability (step 5) Continuation of https://github.com/rust-lang/rust/pull/127321. This PR improves the debuggability of command execution, by improving the output logged when a command fails (it now includes the exact location where the command was created and where it was executed), and also by adding a "drop bomb", which will panic if a command was created, but not executed (which is probably a bug). Here is how the output of a failed command looks like: ``` Command "git" "foo" "[bar]" (failure_mode=Exit, stdout_mode=Capture, stderr_mode=Capture) did not execute successfully. Expected success, got exit status: 1 Created at: src/core/build_steps/compile.rs:1699:9 Executed at: src/core/build_steps/compile.rs:1699:58 STDOUT ---- STDERR ---- git: 'foo' is not a git command. See 'git --help'. ``` And this is what is printed if you forget to execute a command: ``` thread 'main' panicked at /projects/personal/rust/rust/src/tools/build_helper/src/drop_bomb/mod.rs:42:13: command constructed at `src/core/build_steps/compile.rs:1699:9` was dropped without being executed: `git` ``` Best reviewed commit by commit. Tracking issue: https://github.com/rust-lang/rust/issues/126819 r? `@onur-ozkan`
2024-07-13Avoid more instances of unused command execution in dry runJakub Beránek-15/+7
2024-07-13Rollup merge of #127654 - nikic:llvm-ndebug-fix, r=cuviperJacob Pratt-2/+2
Fix incorrect NDEBUG handling in LLVM bindings We currently compile our LLVM bindings using `-DNDEBUG` if debuginfo for LLVM is disabled. However, `NDEBUG` doesn't have any relation to debuginfo, it controls whether assertions are enabled. Split the LLVM_NDEBUG environment variable into two, so that assertions and debuginfo are controlled independently. After this change, `LLVMRustDIBuilderInsertDeclareAtEnd` triggers an assertion failure on LLVM 19 due to an incorrect cast. Fix it by removing the unused return value entirely. r? `@cuviper`
2024-07-12Fix incorrect NDEBUG handling in LLVM bindingsNikita Popov-2/+2
We currently compile our LLVM bindings using `-DNDEBUG` if debuginfo for LLVM is disabled. However, `NDEBUG` doesn't have any relation to debuginfo, it controls whether assertions are enabled. Rename the environment variable to `LLVM_ASSERTIONS` and drive it using the `llvm_assertions` option. Also drop the explicit `debug(false)` call, as cc already sets this up using the cargo `DEBUG` environment variable.