Rollup of 6 pull requests#157228
Conversation
`compile::Rustc`'s sysroot copying logic intentionally does not implicitly copy `rustc-dev` artifacts unless explicitly requested through `builder.ensure(compile::Rustc)`, due to a previous issue RUST-108767: ```text // NOTE(rust-lang#108767): We intentionally don't copy `rustc-dev` artifacts until they're // requested with `builder.ensure(Rustc)`. This fixes an issue where we'd have multiple // copies of libc in the sysroot with no way to tell which to load. There are a few // quirks of bootstrap that interact to make this reliable: // 1. The order `Step`s are run is hard-coded in `builder.rs` and not configurable. This // avoids e.g. reordering `test::UiFulldeps` before `test::Ui` and causing the latter // to fail because of duplicate metadata. // 2. The sysroot is deleted and recreated between each invocation, so running `x test // ui-fulldeps && x test ui` can't cause failures. ``` So, for rustfmt/clippy, we insert intentionally explicit `builder.ensure(compile::Rustc)` as a short-term band-aid, leaving FIXMEs pointing to RUST-156525 to investigate if the multiple libc copies is still a problem and if that can be fixed properly. This is by no means a proper fix, but it should unblock local tool profile workflows trying to use `download-rustc` with {rustfmt,clippy}.
Centrally in `tool::prepare_tool_cargo`. So that `./x run rustfmt` + `download-rustc` can find the correct rustc libs.
The `fuzzy_provenance_casts` lint is enabled in most of the standard library, but its identical twin `lossy_provenance_casts` was not. As discussed in the tracking issue for those lints, there doesn't seem to be any good reason to enable one without the other. This PR applies this principle and as a result removes some unnecessary ptr->int `as` casts. It's also preparation for merging the two lints, which removes the option of only enabling `fuzzy_provenance_casts`.
Occasionally we've been having jobs running on systems with limited free disk space, triggering this script to run. However, it has recently been failing with the error: E: Failed to fetch mirror+file:/etc/apt/apt-mirrors.txt/pool/main/o/openjdk-21/openjdk-21-jre-headless_21.0.10%2b7-1%7e24.04_amd64.deb 404 Not Found [IP: 52.252.163.49 80] E: Unable to correct problems, you have held broken packages. E: Aborting install. This adds an `apt-get update` to try to repair the index before trying to remove any packages. This seems to work in my testing, but I am far from an expert on apt.
…domness `getrandom` is both a crate for this and the name of the underlying syscall on various OSes. `getentropy` and `arc4random` are common library calls on various OSes.
A delegation item (`reuse path::method`) has an unresolved HIR signature: its inputs and return type are `InferDelegation` nodes that clean to `_`. When the delegated function is async, the `async` header over that inferred return type made `clean_fn_decl_with_params` call `sugared_async_return_type` on a non-`impl Future` type, panicking with "unexpected async fn return type". Clean the resolved ty-side signature for delegation items instead, the same way inlined items are cleaned. This avoids the ICE and renders the real return type and `self` parameter rather than `-> _` / `self: _`.
…venance-lints, r=jhpratt library: use strict provenance lints consistently The `fuzzy_provenance_casts` lint is enabled in most of the standard library, but its identical twin `lossy_provenance_casts` was not. As discussed in the tracking issue for those lints, there doesn't seem to be any good reason to enable one without the other. This PR applies this principle and as a result removes some unnecessary ptr->int `as` casts. It's also preparation for merging the two lints, which removes the option of only enabling `fuzzy_provenance_casts`. Tracking issue: rust-lang#130351
…on-157040-b, r=GuillaumeGomez rustdoc: Fix ICE on delegated async functions Fixes rust-lang#157040 rustdoc ICEs with "unexpected async fn return type" on an async delegation like `reuse Trait::foo`. The delegation's HIR signature isn't resolved yet, so its return type cleans to `_`, but the header is still `async`, and sugaring an inferred return type panics. For delegation items we now clean the resolved signature from the ty side, the same way inlined items already do, instead of the HIR one. That sidesteps the panic and also renders the real return type and `self` parameter instead of `-> _` and `self: _`. The `<Self>` generic that shows up on the free-function form is pre-existing (plain sync delegation prints it too) and left alone.
…load-rustc, r=Mark-Simulacrum Explicitly request copying `rustc-dev` artifacts for rustfmt/clippy and add rustc libs path for rustc-private tools under `download-rustc` ## Summary [#t-infra/bootstrap > x run rustfmt works but x test rustfmt fails to compile](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/x.20run.20rustfmt.20works.20but.20x.20test.20rustfmt.20fails.20to.20compile/with/594752284) reported that `./x test rustfmt --stage={1,2}` no longer works with `download-rustc`. * This seems to be due to us removing some manual `builder.ensure(Rustc)`s around the times of stage 0 rejiggling. * Because `compile::Sysroot::run` has a quirky non-trivial behavior regarding `rustc-dev` artifact copying under `download-rustc`, tracing back to sysroot dep resolution troubles (cf. rust-lang#108767), we need to explicitly `ensure(Rustc)` to opt-in to `rustc-dev` artifact copying under `download-rustc`. * For the short-term, let's insert manual `ensure`s to force `rustc-dev` artifact copying under `download-rustc` to unblock rustfmt/clippy contributors who want to use `download-rustc` (to avoid having to build the compiler). Additionally, I needed to explicitly add rustc libs path for `RustcPrivate` tools, or else it seems like the ci-rustc sysroot is not always correctly set. ## Testing Use a dummy config: `bootstrap.rustfmt.toml` ```toml profile = "tools" change-id = "ignore" [rust] # Force download-rustc, needed because we modify bootstrap which makes # `if-unchanged` ineligible. download-rustc = true ``` Run: * `./x test rustfmt --config=bootstrap.rustfmt.toml --stage=1` * `./x test rustfmt --config=bootstrap.rustfmt.toml --stage=2` * `./x test clippy --config=bootstrap.rustfmt.toml --stage=1` * `./x test clippy --config=bootstrap.rustfmt.toml --stage=2` When reviewing, also check that if you revert the commit / this PR, that invocations above fail (which is the case against `main` for me). Tested also without `download-rustc` to make sure `./x test {rustfmt,clippy} --stage={1,2}` still works. ## Notes This is by no means a proper fix, but it should unblock local tool profile workflows trying to use `download-rustc` with {rustfmt,clippy}. I don't think it's worth blocking over that. Efforts for a more proper fix should be tracked by rust-lang#156525, I left FIXMEs pointing to that.
…, r=workingjubilee update TargetFeature::Forbidden docs That comment was a bit outdated, I think I wrote it before `abi_required_features` existed. r? @workingjubilee Cc @wesleywiser
…Simulacrum Fix CI free-disk-space-linux script Occasionally we've been having jobs running on systems with limited free disk space, triggering this script to run. However, it has recently been failing with the error: E: Failed to fetch mirror+file:/etc/apt/apt-mirrors.txt/pool/main/o/openjdk-21/openjdk-21-jre-headless_21.0.10%2b7-1%7e24.04_amd64.deb 404 Not Found [IP: 52.252.163.49 80] E: Unable to correct problems, you have held broken packages. E: Aborting install. This adds an `apt-get update` to try to repair the index before trying to remove any packages. This seems to work in my testing, but I am far from an expert on apt.
…as, r=jhpratt Help people looking for random bytes find `DefaultRandomSource.fill_bytes` Mention, in the `DefaultRandomSource` docs, how to fill a buffer with random bytes. Add doc aliases for `DefaultRandomSource`, for people looking for various sources of randomness. `getrandom` is both a crate for this and the name of the underlying syscall on various OSes. `getentropy` and `arc4random` are common library calls on various OSes.
|
@bors r+ rollup=never p=5 |
This comment has been minimized.
This comment has been minimized.
|
📌 Perf builds for each rolled up PR:
previous master: bef8e620f1 In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing bef8e62 (parent) -> 4530eac (this PR) Test differencesShow 239 test diffsStage 1
Stage 2
Additionally, 236 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 4530eac197dfc6975c23d5d01e85e44bf7f18d69 --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
Finished benchmarking commit (4530eac): comparison URL. Overall result: ❌ regressions - no action needed@rustbot label: -perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 6.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 3.3%, secondary 4.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 518.865s -> 510.437s (-1.62%) |
Successful merges:
rustc-devartifacts for rustfmt/clippy and add rustc libs path for rustc-private tools underdownload-rustc#156528 (Explicitly request copyingrustc-devartifacts for rustfmt/clippy and add rustc libs path for rustc-private tools underdownload-rustc)DefaultRandomSource.fill_bytes#157221 (Help people looking for random bytes findDefaultRandomSource.fill_bytes)r? @ghost
Create a similar rollup