about summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2024-07-28Auto merge of #127799 - Kobzol:bootstrap-cmd-refactor-7, r=onur-ozkanbors-171/+167
Bootstrap command refactoring: make command output API more bulletproof (step 7) Continuation of https://github.com/rust-lang/rust/pull/127680. This PR modifies the API of running commands to make it more explicit when a command is expected to produce programmatically handled output. Now if you call just `run`, you cannot access the stdout/stderr by accident, because it will not be returned to the caller. This API change might be seen as overkill, let me know what do you think. In any case, I'd like to land the second commit, to make it harder to accidentally read stdout/stderr of commands that did not capture output (now you'd get an empty string as a result, but you should probably get a panic instead, if you try to read uncaptured stdout/stderr). Tracking issue: https://github.com/rust-lang/rust/issues/126819 r? `@onur-ozkan` try-job: x86_64-msvc
2024-07-27improve `check::{Std, Rustc}` to handle clippy properlyonur-ozkan-11/+37
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-27Rename require_and_update_submodule to require_submoduleEric Huss-25/+25
Just trying to be a little less verbose here.
2024-07-27Add clarifying documentation to require_and_update_submodule.Eric Huss-1/+4
2024-07-27Change prebuilt_llvm_config to not be required.Eric Huss-1/+2
I misread this one. It is only checking if LLVM needs to be rebuilt. There is code below that handles the case where it is unable to compute the stamp if the source is missing.
2024-07-27Change the blanket submodule update for library submodules to be requiredEric Huss-1/+7
These are required 100% of the time, but they are almost always required for any command that runs Cargo in the main workspace. Ideally, initializing these two standard library submodules would be lazy and only initialized when required (see https://github.com/rust-lang/rust/pull/82653). However, it would require updating these in almost every Step (anything that runs `cargo` in the main workspace).
2024-07-27Consistently use a string to represent a submodule.Eric Huss-11/+11
This makes it easier to call these functions without needing to form a Path.
2024-07-27Add more descriptions to why submodules are required.Eric Huss-5/+13
2024-07-27Fix mistake setting ONLY_HOSTS for Reference.Eric Huss-1/+0
This was a copy/paste mistake.
2024-07-27refactor cargo invocations with strongly-typed subcommandonur-ozkan-109/+117
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-27add change entry for `rust.channel` defaultsonur-ozkan-0/+5
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-26Fix storing of stdout/stderr in bootstrap commands that failed to startJakub Beránek-3/+13
Before, their stdout/stderr was forcefully set to `None`, even if the corresponding command tried to capture output.
2024-07-26Fix broken doc linkJakub Beránek-1/+1
2024-07-26Fix usages of old command APIJakub Beránek-3/+2
2024-07-26Make it easier to detect when bootstrap tries to read uncaptured stdout/stderrJakub Beránek-20/+32
If e.g. only stdout is captured, but the caller tries to read stderr, previously they would get back an empty string. Now the code will explicitly panic when accessing an uncaptured output stream.
2024-07-26Make command output capturing more explicitJakub Beránek-145/+120
Now there are separate functions for running a command without capturing, running while capturing stdout and running while capturing everything. This should help avoid situations where stdout/stderr is accessed when it was not captured.
2024-07-26Update Android testing to API 21, matching NDK 26Matthew Maurer-5/+8
We were running testing on API 18, which was already out of support for NDK 25, and some of the ancient behavior in that image was causing trouble when developing `rustc` features (#120326). Update to the current LTS NDK 26, and to its minimum supported API 21. Fixes: #120567
2024-07-25Integrate mdbook-spec for the reference.Eric Huss-11/+66
This updates the reference which is now using a new mdbook plugin. This requires a little extra work than a normal book because the plugin uses `rustdoc` to generate links to the standard library. It also ensures that the submodule is available for *any* command that uses rustbook, since it is now part of the rustbook workspace.
2024-07-25Make sure submodules are checked out with `x test`Eric Huss-7/+17
If the submodule is not checked out, then these tests would fail.
2024-07-25Clarify comment about why bootstrap tests need src/doc/bookEric Huss-3/+6
2024-07-25Add require_and_update_submodule to ensure submodules existEric Huss-50/+87
This adds a new method `require_and_update_submodule` to replace `update_submodule`. This new method will generate an error if the submodule doesn't actually exist. This replaces some ad-hoc checks that were performing this function. This helps ensure that a good error message is always displayed. This also adds require_and_update_all_submodules which does this for all submodules. Ideally this should not have any change other than better error messages when submodules are missing.
2024-07-25Fix rustbook submodule update locationEric Huss-7/+11
I put this submodule update in the entirely wrong location. I put it in the `RustcBook` step (for generating src/doc/rustc), when it really should exist for all steps that use the `Rustbook` tool.
2024-07-25Remove outdated comment about update_submoduleEric Huss-1/+0
Although its origins were in bootstrap.py, that code in bootstrap.py no longer exists since it was removed.
2024-07-25Remove argument from the submodules methodEric Huss-5/+8
The argument was not necessary, since it was only ever passed one value that exists in the config itself.
2024-07-25Clarify comment on update_existing_submodulesEric Huss-1/+2
This felt like an important point to me.
2024-07-25Remove `pub` from update_existing_submodulesEric Huss-1/+1
This is not used anywhere outside this module.
2024-07-25Remove comment about bootstrap.py handling submodulesEric Huss-2/+0
bootstrap.py handling of submodules was removed in https://github.com/rust-lang/rust/pull/97513.
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