about summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
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.
2024-06-30Distribute rustc_codegen_cranelift for arm64 macOSbjorn3-1/+3
2024-06-30Try renaming the file if removing failsChris Denton-1/+9
2024-06-29Rollup merge of #127002 - Kobzol:bootstrap-perf-tool, r=onur-ozkanMatthias Krüger-22/+15
Implement `x perf` as a separate tool Continues work from https://github.com/rust-lang/rust/pull/126318, adds a CLI for running `rustc-perf` profiling commands through a new `rustc-perf-wrapper` tool. The CLI is in a separate tool to enable experimentation outside of `bootstrap`. This is probably most of what we can do so far, I'll add support for benchmarking once `rustc-perf` gets a terminal output for comparing benchmark results. r? ``@onur-ozkan``
2024-06-29Review changesJakub Beránek-1/+1
2024-06-29Make mtime of reproducible tarball dependent on git commitJakub Beránek-1/+25
2024-06-29Rollup merge of #127112 - ChrisDenton:lldb, r=KobzolGuillaume Gomez-12/+14
Bootstrap: Don't get output if `lldb --version` errors fixes #126892 `Command` can error in two ways: the OS can fail to run the binary at all or else the binary can return an error exit code. Unfortunately the distinction between the two is not clear cut. The OS may succeed in starting the binary but it may still error before `main` (e.g. if a necessary library fails to load) and this will be reported via the exit code. Fortunately this case is simpler. We can assume that `lldb --version` will only ever error if there's a startup issue of some kind. so both kinds of errors are caused by the OS. Thus it's safe for us to treat them equally for the sake of this specific check.
2024-06-29Update test.rsChris Denton-15/+13
2024-06-29Don't get output if `lldb --version` errorsChris Denton-0/+4
2024-06-29Rollup merge of #127108 - onur-ozkan:bin-helper, r=KobzolMatthias Krüger-117/+166
unify `dylib` and `bin_helpers` and create `shared_helpers::parse_value_from_args` `dylib` and `bin_helpers` were already used in similar logic. This PR unifies them under a `shared_helpers` module that is utilized by both the bootstrap library and shims. Additionally, created `parse_value_from_args` with a unit test. This helps avoid code duplication in shims and can also be used in the bootstrap library if needed (which is the case in one of `@Kobzol's` tasks). r? `@Kobzol`
2024-06-29Rollup merge of #126822 - Kobzol:bootstrap-cmd-refactor-2, r=onur-ozkanMatthias Krüger-173/+262
Bootstrap command refactoring: port more `Command` usages to `BootstrapCmd` (step 2) This PR moves more of bootstrap to use `BooststrapCmd`, and also refactors the struct to allow it to serve as a proper command wrapper. Tracking issue: https://github.com/rust-lang/rust/issues/126819 Best reviewed commit-by-commit, I have been adding some helper impls along the way to ease the migration, and then later I remove some of them since they were no longer needed. r? `@onur-ozkan`
2024-06-29create `shared_helpers::parse_value_from_args`onur-ozkan-27/+69
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-29unify `bin_helpers` and `dylib` utility modulesonur-ozkan-47/+54
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-28Auto merge of #126701 - onur-ozkan:build-lld-if-enabled, r=Kobzolbors-7/+15
ignore `llvm::Lld` if lld is not enabled People are having trouble ([ref. zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/MSVC.20Runtime.20mismatch.20when.20building.20LLD)) when they don't want to build `lld` for their custom distribution tarballs even with `lld = false` in their config.toml. This is because it is not controlled by `lld_enabled` flag. This change ensures that `llvm:Lld` is controlled by lld configuration. Additionally, `lld = true` is set by default for dist profile, because we have been building it all along and this maintains that behavior. try-job: x86_64-mingw
2024-06-28Migrate more `Command` usages to `BootstrapCmd`Jakub Beránek-20/+17
2024-06-28Get rid of `Deref/DerefMut` impl for `BootstrapCmd`Jakub Beránek-37/+44
2024-06-28Migrate a few command usages to `BootstrapCommand`Jakub Beránek-20/+19
2024-06-28Migrate a few command usages to `BootstrapCommand`Jakub Beránek-30/+31
2024-06-28Migrate `cargo_clippy_cmd` and `cargo_miri_cmd` to `BootstrapCommand`Jakub Beránek-17/+15
2024-06-28Migrate some usage of `Command` to `BootstrapCmd`Jakub Beránek-19/+73
2024-06-28Make it easier to migrate `Command` to `BootstrapCmd`Jakub Beránek-6/+23
By allowing `run` to receive all of `BootstrapCmd`, `&mut BootstrapCmd`, `Command` and `&mut Command`.
2024-06-28Store `Command` directly inside `BootstrapCommand`Jakub Beránek-6/+31
This will make it easier to migrate existing commands to bootstrap command.
2024-06-28Improve documentation of `BootstrapCommand`Jakub Beránek-0/+12
2024-06-28Remove `run` and rename `run_tracked` to `run`Jakub Beránek-32/+23