Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 10 pull requests #138007

Closed
wants to merge 32 commits into from
Closed

Conversation

jieyouxu
Copy link
Member

@jieyouxu jieyouxu commented Mar 4, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

jyn514 and others added 30 commits February 13, 2025 10:24
`py` is not installed by default *and* trying to run it results in a
popup asking if you want to install it. `python3` is installed by
default.

This hopefully should not be too disruptive to people on Windows, since
they should be going through `x.ps1` instead anyway. Just in case, I've
added a check for Cygwin and Msys (i'm not sure how else you'd get a
bash shell on windows).
To make the error cases easier to spot on a quick glance.
This overrides the test=false flag in Cargo.toml and it shouldn't be
necessary as --tests is already passed.
It is reasonable to expect that ./x.py test core is enough to run tests
when you are working on core. In addition it seems like CI for wasm32 at
least doesn't run coretests currently, which this commit fixes.
This will help stabilization of lld.
Includes a change to make a subset of math symbols available on all
platforms [1], and disables `f16` on aarch64 without neon [2].

[1]: rust-lang/compiler-builtins#763
[2]: rust-lang/compiler-builtins#775
It has served us well, but it's time to retire the `Makefile` support
file since this is no longer needed.
And remove outdated requirements to run `run-make` tests on Windows.
This is to make test stderr insensitive to compare-mode / debugger that
changes the test build dir output name.

Previously, this normalized paths up to test-suite-specific build root,
e.g. `/path/to/build/test/ui/`. Now, this normalizes up to test-specific
build root, e.g.
`/path/to/build/test/ui/subdir/$name.$revision.$mode.$debugger/`.
Retire the legacy `Makefile`-based `run-make` test infra

The final piece of [porting run-make tests to use Rust rust-lang#121876](rust-lang#121876).
Closes rust-lang#121876.
Closes rust-lang#40713.
Closes rust-lang#81791 (no longer using `wc`).
Closes rust-lang#56475 (no longer a problem in current form of that test; we don't ignore the test on `aarch64-unknown-linux-gnu`).

### Summary

This PR removes the legacy `Makefile`-based `run-make` test infra which has served us well over the years. The legacy infra is no longer needed since we ported all of `Makefile`-based `run-make` tests to the new `rmake.rs` infra.

Additionally, this PR:

- Removes `tests/run-make/tools.mk` since no more `Makefile`-based tests remain.
- Updates `tests/run-make/README.md` and rustc-dev-guide docs to remove mention about `Makefile`-based `run-make` tests
- Update test suite requirements in rustc-dev-guide on Windows to no longer need MSYS2 (they should also now run successfully on native Windows MSVC).
- Update `triagebot.toml` to stop backlinking to rust-lang#121876.

**Thanks to everyone who helped in this effort to modernize the `run-make` test infra and test suite!**

r? bootstrap
…de, r=lqd

Perform deeper compiletest path normalization for `$TEST_BUILD_DIR` to account for compare-mode/debugger cases, and normalize long type file filename hashes

Fixes rust-lang#136510.

### Summary

- Whereas previously `$TEST_BUILD_DIR` is a normalization of `/path/to/build/test/<test_suite_name>/`, we now more deeply normalize. `$TEST_BUILD_DIR` now becomes a normalization of `/path/to/build/test/<test_suite_name>/<subdirs>/$name.$revision.$compare_mode.$debugger/` to normalize away path name differences when `--compare-mode` and/or `--debugger` are specified.
- We also centralize the normalization of long type name hashes

cf. rust-lang#136328 (comment).

### Review advice

- Best reviewed commit-by-commit.
- Split into 3 commits:
    - **Commit 1**: compiletest changes to have `$TEST_BUILD_DIR` more deeply normalize.
    - **Commit 2**: remove per-test hacks for long type path hash normalizations, and rebless tests *specifically* affected by that.
    - **Commit 3**: rebless other tests that were changed as a side-effect of deeper `$TEST_BUILD_DIR` normalizations.

**Commit 2** is created via first finding tests that try to perform long type file hash normalizations on an ad hoc, per-test basis:

```
rg --no-ignore -l --no-ignore -F -e "long-type" tests/ui/**/*.rs
```

<details>
<summary>Tests with ad hoc long-type hash normalizations</summary>

```
tests/ui/type_length_limit.rs
tests/ui/traits/on_unimplemented_long_types.rs
tests/ui/regions/issue-102374.rs
tests/ui/recursion/recursion.rs
tests/ui/recursion/issue-83150.rs
tests/ui/recursion/issue-23122-2.rs
tests/ui/methods/inherent-bound-in-probe.rs
tests/ui/issues/issue-67552.rs
tests/ui/issues/issue-37311-type-length-limit/issue-37311.rs
tests/ui/issues/issue-20413.rs
tests/ui/issues/issue-8727.rs
tests/ui/infinite/infinite-instantiation.rs
tests/ui/infinite/infinite-instantiation-struct-tail-ice-114484.rs
tests/ui/higher-ranked/trait-bounds/hrtb-doesnt-borrow-self-1.rs
tests/ui/higher-ranked/trait-bounds/hrtb-doesnt-borrow-self-2.rs
tests/ui/higher-ranked/trait-bounds/hang-on-deeply-nested-dyn.rs
tests/ui/error-codes/E0275.rs
tests/ui/diagnostic-width/secondary-label-with-long-type.rs
tests/ui/diagnostic-width/long-e0277.rs
tests/ui/diagnostic-width/non-copy-type-moved.rs
tests/ui/diagnostic-width/long-E0308.rs
tests/ui/diagnostic-width/E0271.rs
tests/ui/diagnostic-width/binop.rs
```
</details>

These ad hoc normalizations were removed, and they are reblessed.

r? ``@lqd``
Look for `python3` first on MacOS, not `py`

`py` is not installed by default *and* trying to run it results in a popup asking if you want to install it. `python3` is installed by default.

This hopefully should not be too disruptive to people on Windows, since they should be going through `x.ps1` instead anyway. Just in case, I've added a check for Cygwin and Msys (i'm not sure how else you'd get a bash shell on windows).

I've tested this on macOS, WSL, "git bash" (which appears to be MSYS), and MSVC with `bash -c ./x` (which runs in WSL, but differently than interactive bash 🙃). I haven't tested Cygwin, which is unsupported anyway, but the code tries to make it work.
…mulacrum

Slightly reformat `std::fs::remove_dir_all` error docs

To make the error cases easier to spot on a quick glance, as I've been bitten by this a couple of times already 💀

cc rust-lang#137230.
…gillot

Remove `MaybeForgetReturn` suggestion

rust-lang#115196 implemented a suggestion to add a missing `return` when there is an ambiguity error, when that ambiguity error could be constrained by the return type of the function.

I initially reviewed it and thought it could be useful; however, looking back at that code now, I feel like it's a bit too much of a hack to be worth keeping around in typeck, especially given how rare it's expected to fire in practice. This is especially true because it depends on `StashKey::MaybeForgetReturn`, which is only stashed when we have *Sized* obligation ambiguity errors. Let's remove it for now.

I'd like to note that it's basically impossible to get this suggestion to apply in its current state except for what I'd consider somewhat artificial examples, involving no generic trait bounds. For example, it's not triggered for:

```rust
struct W<T>(T);

fn bar<T: Default>() -> W<T> { todo!() }

fn foo() -> W<i32> {
    if true {
        bar();
    }
    W(0)
}
```

Nor is it triggered for:

```
fn foo() -> i32 {
    if true {
        Default::default();
    }
    0
}
```

It's basically only triggered iff there's only one ambiguity error on the type, which is `Sized`.

Generally, suggesting something that affects control flow is a pretty dramatic suggestion; therefore, both the accuracy and precision of this diagnostic should be pretty high.

One other, somewhat unrelated observation is that this might be using stashed diagnostics incorrectly (or at least unnecessarily). Stashed diagnostics are used when error detection is fragmented over several major stages of the compiler, like a parse or resolver error which later can be recovered in typeck. However, this one is a bit different since it is fully handled within typeck -- perhaps that suggests that if this were to be reimplemented, it wouldn't need to be so complicated of an implementation.
Update `compiler-builtins` to 0.1.149

Includes a change to make a subset of math symbols available on all platforms [1], and disables `f16` on aarch64 without neon [2].

[1]: rust-lang/compiler-builtins#763
[2]: rust-lang/compiler-builtins#775

try-job: aarch64-gnu
try-job: aarch64-gnu-debug
try-job: armhf-gnu
try-job: dist-various-1
try-job: dist-various-2
try-job: dist-aarch64-linux
try-job: dist-arm-linux
try-job: dist-armv7-linux
try-job: dist-x86_64-linux
try-job: test-various
…ieyouxu,onur-ozkan

Various coretests improvements

The first commit is not yet strictly necessary as directly testing libcore works though useless work, but will be necessary once rust-lang#136642 migrates the liballoc tests into a separate package. The second commit fixes rust-lang#137478 and ensures that coretests actually gets tested on all CI job. The third commit fixes an error that didn't get caught because coretests doesn't run on the wasm32 CI job.
self-contained linker: conservatively default to `-znostart-stop-gc`

To help stabilization, this PR disables an LLD optimization with respect to `--gc-sections` and encapsulation symbols: it will reduce the number of crates needing to opt-out of lld due to this bfd / lld difference. For example, all the people using [linkme](https://github.com/dtolnay/linkme), which [doesn't work with lld](dtolnay/linkme#63) or on nightly, need to disable lld.

More information about all this, and the historical differences, can be found in:
- https://maskray.me/blog/2021-01-31-metadata-sections-comdat-and-shf-link-order
- https://lld.llvm.org/ELF/start-stop-gc

This optimization has [no visible impact](rust-lang#137685 (comment)) on our benchmarks, so we can use it by default and have a safer/more conservative starting point to remove friction during migration. We can them emit an FCW for the cases where lld detects reliance on encapsulation symbols without `-znostart-stop-gc`, and then revert back to lld's default after a while. No one compiling on nightly relies on this difference, obviously, so doing an FCW is not necessary until after lld is used on stable.

I've tested that this correctly links on `linkme` examples. I've also quickly tried to crate an rmake test but the setup with encapsulation symbols is annoying to reproduce: a few link section/name attributes is not enough, we also need to collect symbols between the encapsulation symbols, without referencing them in code, for `-znostart-stop-gc` to only impact this... It should of course be doable though, maybe `@Kobzol` will look into it if they have time.

r? `@petrochenkov`

try-job: dist-apple-various
jieyouxu added 2 commits March 4, 2025 23:56
Do not install rustup on Rust for Linux job

Trying to fix the RfL job after the recent rustup update.

r? `@ghost`

try-job: x86_64-rust-for-linux
@rustbot rustbot added A-compiletest Area: The compiletest test runner A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-run-make Area: port run-make Makefiles to rmake.rs A-rustc-dev-guide Area: rustc-dev-guide A-testsuite Area: The testsuite used to check the correctness of rustc A-tidy Area: The tidy tool S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Mar 4, 2025
@jieyouxu
Copy link
Member Author

jieyouxu commented Mar 4, 2025

@bors r+ rollup=never p=5

@rustbot rustbot added the rollup A PR which is a rollup label Mar 4, 2025
@bors
Copy link
Contributor

bors commented Mar 4, 2025

📌 Commit 89c12e0 has been approved by jieyouxu

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 4, 2025
@bors
Copy link
Contributor

bors commented Mar 4, 2025

⌛ Testing commit 89c12e0 with merge 08b4256...

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 4, 2025
Rollup of 10 pull requests

Successful merges:

 - rust-lang#136581 (Retire the legacy `Makefile`-based `run-make` test infra)
 - rust-lang#136865 (Perform deeper compiletest path normalization for `$TEST_BUILD_DIR` to account for compare-mode/debugger cases, and normalize long type file filename hashes)
 - rust-lang#136975 (Look for `python3` first on MacOS, not `py`)
 - rust-lang#137240 (Slightly reformat `std::fs::remove_dir_all` error docs)
 - rust-lang#137303 (Remove `MaybeForgetReturn` suggestion)
 - rust-lang#137634 (Update `compiler-builtins` to 0.1.149)
 - rust-lang#137679 (Various coretests improvements)
 - rust-lang#137685 (self-contained linker: conservatively default to `-znostart-stop-gc`)
 - rust-lang#137850 (Stabilize `box_uninit_write`)
 - rust-lang#137947 (Do not install rustup on Rust for Linux job)

r? `@ghost`
`@rustbot` modify labels: rollup
@rust-log-analyzer
Copy link
Collaborator

The job aarch64-apple failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
---- [run-make] tests/run-make/rust-lld stdout ----

error: rmake recipe failed to complete
status: exit status: 1
command: cd "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/run-make/rust-lld/rmake_out" && env -u RUSTFLAGS AR="ar" BUILD_ROOT="/Users/runner/work/rust/rust/build/aarch64-apple-darwin" CARGO="/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage1-tools-bin/cargo" CC="/Applications/Xcode_15.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" CC_DEFAULT_FLAGS="-ffunction-sections -fdata-sections -fPIC --target=arm64-apple-darwin -mmacosx-version-min=11 -isysroot /Applications/Xcode_15.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk" CXX="/Applications/Xcode_15.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++" CXX_DEFAULT_FLAGS="-ffunction-sections -fdata-sections -fPIC --target=arm64-apple-darwin -mmacosx-version-min=11 -isysroot /Applications/Xcode_15.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -stdlib=libc++" DYLD_LIBRARY_PATH="/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage0-bootstrap-tools/aarch64-apple-darwin/release/deps:/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage0/lib:/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2-tools-bin:/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2/lib/rustlib/aarch64-apple-darwin/lib" HOST_RPATH_DIR="/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2/lib" LD_LIB_PATH_ENVVAR="DYLD_LIBRARY_PATH" LLVM_BIN_DIR="/Users/runner/work/rust/rust/build/aarch64-apple-darwin/ci-llvm/bin" LLVM_COMPONENTS="aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets amdgpu amdgpuasmparser amdgpucodegen amdgpudesc amdgpudisassembler amdgpuinfo amdgputargetmca amdgpuutils analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter bpf bpfasmparser bpfcodegen bpfdesc bpfdisassembler bpfinfo cfguard cgdata codegen codegentypes core coroutines coverage csky cskyasmparser cskycodegen cskydesc cskydisassembler cskyinfo debuginfobtf debuginfocodeview debuginfodwarf debuginfogsym debuginfologicalview debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker dwarflinkerclassic dwarflinkerparallel dwp engine executionengine extensions filecheck frontendatomic frontenddriver frontendhlsl frontendoffloading frontendopenacc frontendopenmp fuzzercli fuzzmutate globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo hipstdpar instcombine instrumentation interfacestub interpreter ipo irprinter irreader jitlink libdriver lineeditor linker loongarch loongarchasmparser loongarchcodegen loongarchdesc loongarchdisassembler loongarchinfo lto m68k m68kasmparser m68kcodegen m68kdesc m68kdisassembler m68kinfo mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts objcopy object objectyaml option orcdebugging orcjit orcshared orctargetprocess passes powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvtargetmca runtimedyld sandboxir scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target targetparser telemetry textapi textapibinaryreader transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo webassemblyutils windowsdriver windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86targetmca xray xtensa xtensaasmparser xtensacodegen xtensadesc xtensadisassembler xtensainfo" LLVM_FILECHECK="/Users/runner/work/rust/rust/build/aarch64-apple-darwin/ci-llvm/bin/FileCheck" NODE="/opt/homebrew/bin/node" PYTHON="/usr/bin/python3" RUSTC="/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2/bin/rustc" RUSTDOC="/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2/bin/rustdoc" SOURCE_ROOT="/Users/runner/work/rust/rust" TARGET="aarch64-apple-darwin" TARGET_RPATH_DIR="/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2/lib/rustlib/aarch64-apple-darwin/lib" TARGET_RPATH_ENV="/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/run-make/rust-lld/rmake_out:/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage0-bootstrap-tools/aarch64-apple-darwin/release/deps:/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage0/lib" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/run-make/rust-lld/rmake"
--- stderr -------------------------------
command failed at line 23
command failed at line 23
Command { cmd: DYLD_LIBRARY_PATH="/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/run-make/rust-lld/rmake_out:/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2/lib:/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage0-bootstrap-tools/aarch64-apple-darwin/release/deps:/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage0/lib:/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2-tools-bin:/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2/lib/rustlib/aarch64-apple-darwin/lib" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2/bin/rustc" "-L" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/run-make/rust-lld/rmake_out" "-Zlinker-features=+lld" "-Clink-self-contained=+linker" "-Zunstable-options" "-Wlinker-messages" "-Clink-arg=-Wl,-v" "main.rs", stdin_buf: None, stdin: None, stdout: None, stderr: None, drop_bomb: DropBomb { command: "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2/bin/rustc", defused: true, armed_location: Location { file: "/Users/runner/work/rust/rust/tests/run-make/rust-lld/rmake.rs", line: 16, col: 18 } }, already_executed: true }
output status: `exit status: 1`
=== STDOUT ===


=== STDERR ===
error: linking with `cc` failed: exit status: 1
error: linking with `cc` failed: exit status: 1
  |
  = note:  "cc" "/var/folders/2s/h6hvv9ps03xgz_krkkstvq_r0000gn/T/rustcPOLnp3/symbols.o" "<2 object files omitted>" "<sysroot>/lib/rustlib/aarch64-apple-darwin/lib/{libstd-*,libpanic_unwind-*,libobject-*,libmemchr-*,libaddr2line-*,libgimli-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libminiz_oxide-*,libadler2-*,libunwind-*,libcfg_if-*,liblibc-*,liballoc-*,librustc_std_workspace_core-*,libcore-*,libcompiler_builtins-*}.rlib" "-lSystem" "-lc" "-lm" "-B<sysroot>/lib/rustlib/aarch64-apple-darwin/bin/gcc-ld" "-fuse-ld=lld" "-Wl,-znostart-stop-gc" "-arch" "arm64" "-mmacosx-version-min=11.0.0" "-L" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/run-make/rust-lld/rmake_out" "-o" "main" "-Wl,-dead_strip" "-nodefaultlibs" "-Wl,-v"
  = note: some arguments are omitted. use `--verbose` to show all linker arguments
  = note: rust-lld: error: unknown argument '-znostart-stop-gc'
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

error: aborting due to 1 previous error
------------------------------------------

@bors
Copy link
Contributor

bors commented Mar 4, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 4, 2025
@tgross35
Copy link
Contributor

tgross35 commented Mar 4, 2025

It looks like #137685 failed this rollup, Jubilee already left a note.

@tgross35 tgross35 closed this Mar 4, 2025
@jieyouxu jieyouxu deleted the rollup-z897tqe branch March 4, 2025 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiletest Area: The compiletest test runner A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-run-make Area: port run-make Makefiles to rmake.rs A-rustc-dev-guide Area: rustc-dev-guide A-testsuite Area: The testsuite used to check the correctness of rustc A-tidy Area: The tidy tool rollup A PR which is a rollup S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.