about summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2024-07-12Test `build_helper` with the stage 0 compilerJakub Beránek-3/+2
There is no need to build a stage N toolchain for testing it.
2024-07-12Modify FIXME commentJakub Beránek-1/+1
2024-07-12Simplify command executions for plain source tarballsJakub Beránek-5/+1
If we're in dry run mode, the command will return an empty string, so we can just execute it.
2024-07-12Disarm drop bombs for unexecuted test Cargo commandsJakub Beránek-1/+2
The code for running tests uses a custom command machinery because it streams the output of the command. We thus need to mark the command as executed in a dry run, to avoid a drop bomb panic.
2024-07-12Remove unused rustdoc commandJakub Beránek-4/+0
2024-07-12Fix a case where a RustBook command is potentially not executedJakub Beránek-2/+7
We can move the command creation to a block where it is clear that the command will be executed.
2024-07-12Improve the `Debug` representation of `BootstrapCommand`Jakub Beránek-1/+13
Avoid printing useless information in the `Debug` output.
2024-07-12Print command creation and execution location when it failsJakub Beránek-4/+19
This should make it quicker to debug command failures.
2024-07-12Add `DropBomb` to `BootstrapCommand`Jakub Beránek-0/+20
This makes it harder to accidentally forget to execute a created command in bootstrap.
2024-07-12Make `command` field of `BootstrapCommand` private to force access to it ↵Jakub Beránek-42/+60
through the `as_command_mut` method This will be useful for disarming drop bombs when the inner command is accessed.
2024-07-12Configure test execution for the `build_helper` crate in bootstrapJakub Beránek-0/+48
To enable the previously moved `DropBomb` tests.
2024-07-12Rollup merge of #127552 - onur-ozkan:unnecessary-git-usage, r=KobzolMatthias Krüger-16/+7
remove unnecessary `git` usages `Config::src` already contains the top-level path, so we don't need to add git overhead just to reach this path.
2024-07-10Rollup merge of #126476 - ferrocene:pa-bootstrap-test-local-rustc, r=onur-ozkanMatthias Krüger-2/+44
Fix running bootstrap tests with a local Rust toolchain as the stage0 When configuring a local Rust toolchain as the stage0 (with `build.rustc` and `build.cargo` in `config.toml`) we noticed there were test failures (both on the Python and the Rust side) due to bootstrap not being able to find rustc and Cargo. This was due to those two `config.toml` settings not being propagated in the tests. This PR fixes the issue by ensuring rustc and cargo are always configured in tests, using the parent bootstrap's `initial_rustc` and `initial_cargo`. try-job: x86_64-msvc Fixes https://github.com/rust-lang/rust/issues/105766
2024-07-10use utils::helpers::exePietro Albini-7/+2
2024-07-10remove unnecessary `git` usagesonur-ozkan-16/+7
`Config::src` already contains the top-level path, so we don't need to add git overhead just to reach this path. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-09Unconditionally use stage0 build compilerAlex Crichton-1/+1
2024-07-09Update how wasm-component-ld is builtAlex Crichton-28/+1
Reuse preexisting macro and switch it to a "bootstrap tool" to try to resolve build issues.
2024-07-09Promote the `wasm32-wasip2` target to Tier 2Alex Crichton-0/+43
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-09set the correct rustc and cargo even for tests invoking parse_innerPietro Albini-13/+12
2024-07-08Rollup merge of #127467 - GrigorenkoPV:bootstrap-once_cell, r=clubby789Matthias Krüger-11/+5
bootstrap: once_cell::sync::Lazy -> std::sync::LazyLock Since #121377 has landed on beta
2024-07-08Rollup merge of #127355 - aceArt-GmbH:126475, r=oli-obkMatthias Krüger-4/+4
Mark format! with must_use hint Uses unstable feature https://github.com/rust-lang/rust/issues/94745 Part of #126475 First contribution to rust, please let me know if the blessing of tests is correct Thanks `@bjorn3` for the help
2024-07-08set the correct executable for initial_{rustc,cargo}Pietro Albini-2/+17
Due to the way the paths initial_rustc and initial_cargo were constructed before this commit, they mixed \ and / for path separators and they omitted the .exe suffix. This worked fine up until now, as Windows is capable of handling the mixed path separators and the Command::new API adds the ".exe" suffix if missing from the executable. This resulted in paths that didn't actually exist on disk though, due to the missing .exe suffix. This commit fixes that by adding the .exe suffix to initial_rustc and initial_cargo when --build is Windows.
2024-07-07bootstrap: once_cell::sync::Lazy -> std::sync::LazyLockPavel Grigorenko-11/+5
2024-07-07Update src/bootstrap/mk/Makefile.inzachs18-1/+1
Co-authored-by: Ralf Jung <post@ralfj.de>
2024-07-07Re-enable Miri leak checking in CI.zachs18-3/+2
2024-07-07use "bootstrap" instead of "rustbuild" in comments and docsonur-ozkan-30/+29
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-06Add `#[must_use]` attribute to several command-related methodsJakub Beránek-1/+13
This should make it harder to accidentally forget to use results of methods on `BootstrapCommand` and `CommandStatus`.
2024-07-06handle ci-rustc incompatible options during config parseonur-ozkan-7/+118
This change ensures that `config.toml` does not use CI rustc incompatible options when CI rustc is enabled. This is necessary because some options can change compiler's behavior in certain scenarios. The list may not be complete, but should be a good first step as it's better than nothing! Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-06Mark format! with must_use hintlukas-4/+4
2024-07-04Add a shortcut helper function `command` for creating commandsJakub Beránek-111/+94
This is simply a quality-of-life improvement to make command creation in bootstrap a bit shorter and more discoverable.
2024-07-04Add `run` method to `BootstrapCommand`Jakub Beránek-288/+288
This makes it easier to use commands in a "Fluent-API" style, and also removes the need for the `AsMut` trait hack that was used before to allow passing both `BootstrapCommand` and `&mut BootstrapCommand` to `Builder::run`. The `Builder::run` method was still kept and can be used explicitly, if needed for some reason.
2024-07-04Do not consider LLDB version to be valid if it is emptyJakub Beránek-8/+3
When dry run is enabled, the command for finding LLDB version would succeed, but return an empty string. This was inadvertently enabling a code path that should only be executed when the LLDB is actually present and its version is valid. This commit makes sure that if the version is empty, LLDB will be considered not found.
2024-07-03Rebase on masterJakub Beránek-1/+5
2024-07-03Simplify and generalize implementation of output modeJakub Beránek-38/+42
2024-07-03Review changesJakub Beránek-18/+18
2024-07-03Handle execution of dry run commandsJakub Beránek-8/+23
2024-07-03Refactor command outcome handlingJakub Beránek-51/+93
To handle the case of failing to start a `BootstrapCommand`.
2024-07-03Allow unused `Tool` variantsJakub Beránek-0/+1
2024-07-03Remove various usages of the `output` functionJakub Beránek-132/+120
2024-07-03Remove temporary `BootstrapCommand` trait implsJakub Beránek-143/+114
2024-07-03Make `git` helper return `BootstrapCmd`Jakub Beránek-80/+112
2024-07-03Improve documentationJakub Beránek-3/+4
2024-07-03Rollup merge of #127270 - klensy:PROCESS_MEMORY_COUNTERS, r=KobzolMatthias Krüger-12/+5
bootstrap: pass correct struct size to winapi Into K32GetProcessMemoryInfo (https://learn.microsoft.com/en-us/windows/win32/api/psapi/nf-psapi-getprocessmemoryinfo) passed in pointer to PROCESS_MEMORY_COUNTERS, but size of PROCESS_MEMORY_COUNTERS_EX, whoops.
2024-07-03Rollup merge of #127050 - Kobzol:reproducibility-git, r=onur-ozkanMatthias Krüger-1/+25
Make mtime of reproducible tarballs dependent on git commit Since https://github.com/rust-lang/rust/pull/123246, our tarballs should be fully reproducible. That means that the mtime of all files and directories in the tarballs is set to the date of the first Rust commit (from 2006). However, this is causing some mtime invalidation issues (https://github.com/rust-lang/rust/issues/125578#issuecomment-2141068906). Ideally, we would like to keep the mtime reproducible, but still update it with new versions of Rust. That's what this PR does. It modifies the tarball installer bootstrap invocation so that if the current rustc directory is managed by git, we will set the UTC timestamp of the latest commit as the mtime for all files in the archive. This means that the archive should be still fully reproducible from a given commit SHA, but it will also be changed with new beta bumps and `download-rustc` versions. Note that only files are set to this mtime, directories are still set to the year 2006, because the `tar` library used by `rust-installer` doesn't allow us to selectively override mtime for directories (or at least I haven't found it). We could work around that by doing all the mtime modifications in bootstrap, but that would require more changes. I think/hope that just modifying the file mtimes should be enough. It should at least fix cargo `rustc` mtime invalidation. Fixes: https://github.com/rust-lang/rust/issues/125578 r? ``@onur-ozkan`` try-job: x86_64-gnu-distcheck
2024-07-03bootstrap: pass correct struct size to winapiklensy-12/+5
2024-07-02Auto merge of #127152 - ChrisDenton:rename, r=onur-ozkanbors-1/+9
Bootstrap: Try renaming the file if removing fails Second attempt at working around https://github.com/rust-lang/rust/issues/127126 If we can't remove the file, then try renaming it. This will leave the destination path free to use. try-job: x86_64-msvc-ext
2024-07-02Use `cfg!(windows)`Chris Denton-1/+1
2024-07-01fail on component linking errorsonur-ozkan-3/+6
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-01improve the way bootstrap handles rustlib componentsonur-ozkan-26/+26
When CI rustc is enabled, bootstrap tries to symlink the rust source (project root) into target sysroot right before copying it from the CI rustc's sysroot. This becomes a problem in CI builders (which we currently don't see because they don't use CI rustc) because the copying part will fail as they run on read-only mode. This change fixes the problem by copying `rustc-src` from the CI rustc sysroot and only symlinking `rustc-src` from the rust source when download-rustc is not enabled. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-30Auto merge of #127026 - Urgau:cleanup-bootstrap-check-cfg, r=Kobzolbors-33/+4
Cleanup bootstrap check-cfg This PR cleanup many custom `check-cfg` in bootstrap that have been accumulated over the years. As well as updating some outdated comments.