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 6 pull requests #136049

Closed
wants to merge 22 commits into from

Conversation

matthiaskrgr
Copy link
Member

@matthiaskrgr matthiaskrgr commented Jan 25, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

try-job: aarch64-apple
try-job: i686-mingw
try-job: x86_64-gnu-llvm-19-3

checkraisefold and others added 22 commits December 31, 2024 00:31
- Don't show environment variables. Seeing PATH is almost never useful, and it can be extremely long.
- For .rlibs in the sysroot, replace crate hashes with a `"-*"` string. This will expand to the full crate name when pasted into the shell.
- Move `.rlib` to outside the glob.
- Abbreviate the sysroot path to `<sysroot>` wherever it appears in the arguments.

This also adds an example of the linker output as a run-make test. Currently it only runs on x86_64-unknown-linux-gnu, because each platform has its own linker arguments. So that it's stable across machines, pass BUILD_ROOT as an argument through compiletest through to run-make tests.
…output

It doesn't exist on MacOS.

It's strange to me why the flavor is platform specific; I would expect you to be able to use any userspace on any OS? But trying to do this outside of Linux is already kinda weird, so.
Split this into two tests, one for LLVM 19 and one for LLVM 20.
LLVM 20 choses a different unroll factor for the loop.
```
error[E0432]: unresolved import `some_novel_crate`
 --> file.rs:1:5
  |
1 | use some_novel_crate::Type;
  |     ^^^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `some_novel_crate`
```

On resolve errors where there might be a missing crate, mention `cargo add foo`:

```
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `nope`
  --> $DIR/conflicting-impl-with-err.rs:4:11
   |
LL | impl From<nope::Thing> for Error {
   |           ^^^^ use of unresolved module or unlinked crate `nope`
   |
   = help: if you wanted to use a crate named `nope`, use `cargo add nope` to add it to your `Cargo.toml`
```
PATH is never printed on Windows.
Convenience helper for `rustc --print=sysroot`.
…nking, r=davidtwco

Fix linking for symbols starting with ? on i686-pc-windows-msvc

When using the `export_name` attribute to specifically export a symbol beginning with a question mark on the `i686-pc-windows-msvc` target, that symbol will fail to link and throw a linker error 100% of the time.
[Issue writeup.](rust-lang#44282 (comment))

Closes rust-lang#44282

I'm not sure if this is a proper solution, but [LLVM does the same check](https://github.com/llvm/llvm-project/blob/main/llvm/lib/IR/Mangler.cpp#L48-L49) which causes this issue, and is applied to [all 32- and 64-bit Windows COFF objects](https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/IR/DataLayout.h#L255-L257) (maybe the same patch should be applied for 64 bit windows as well then?). I am *more* unsure of whether this is the proper place for such a solution (and if the exact conditions of is_like_windows are proper for this usecase), or if the underscore should be stripped elsewhere, but it seems like the most correct place.

I'm also unsure if there are any backwards compatibility ramifications here. There shouldn't be, because binaries with exported symbols starting with `?` for this target failed to link because of this issue anyway, but still.
Reword resolve errors caused by likely missing crate in dep tree

Reword label and add `help`:

```
error[E0432]: unresolved import `some_novel_crate`
 --> f704.rs:1:5
  |
1 | use some_novel_crate::Type;
  |     ^^^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `some_novel_crate`
  |
  = help: if you wanted to use a crate named `some_novel_crate`, use `cargo add some_novel_crate` to add it to your `Cargo.toml`
```

Fix rust-lang#133137.
Shorten linker output even more when `--verbose` is not present

- Don't show environment variables. Seeing PATH is almost never useful, and it can be extremely long.
- For .rlibs in the sysroot, replace crate hashes with a `"-*"` string. This will expand to the full crate name when pasted into the shell.
- Move `.rlib` to outside the glob.
- Abbreviate the sysroot path to `<sysroot>` wherever it appears in the arguments.

This also adds an example of the linker output as a run-make test. Currently it only runs on x86_64-unknown-linux-gnu, because each platform has its own linker arguments. So that it's stable across machines, pass BUILD_ROOT as an argument through compiletest through to run-make tests.

r? ``@bjorn3``

try-job: aarch64-apple
…wiser

Fix tests on LLVM 20

For sparcv8plus.rs, duplicate the test for LLVM 19 and LLVM 20. LLVM 20 resolves one of the FIXME in the test.

For x86_64-bigint-add.rs split the check lines for LLVM 19 and LLVM 20. The difference in codegen here is due to a difference in unroll factor, which I believe is not what the test is interested in.

Fixes rust-lang#132957.
Fixes rust-lang#133754.
…irect, r=bjorn3

use `PassMode::Direct` for vector types on `s390x`

closes rust-lang#135744
tracking issue: rust-lang#130869

Previously, all vector types were type erased to `Ni8`, now we pass non-wrapped vector types directly. That skips emitting a bunch of casting logic in rustc, that LLVM then has to clean up. The initial LLVM IR is also a bit more readable.

This calling convention is tested extensively in `tests/assembly/s390x-vector-abi.rs`, showing that this change has no impact on the ABI in practice.

r? ``@taiki-e``
…mpiler-errors

tests: Port `translation` to rmake.rs

Part of rust-lang#121876.

This PR partially supersedes rust-lang#129011 and is co-authored with ``@Oneirical.``

## Summary

This PR ports `tests/run-make/translation` to rmake.rs. Notable changes from the Makefile version include:

- We now actually fail if the rustc invocations fail... The Makefile did not have `SHELL=/bin/bash -o pipefail`, so all the piped rustc invocations to grep vacuously succeeded, even if the broken ftl test case actually regressed over time and ICEs on current master.
    - That test case is converted to assert it ICEs with a FIXME backlinking to rust-lang#135817.
- The test coverage is expanded to not ignore windows. Instead, the test now uses symlink capability detection to gate test execution.
- Added some backlinks to relevant tracking issues and the initial translation infra implementation PR.

## Review advice

Best reviewed commit-by-commit.

r? compiler
@rustbot rustbot added A-compiletest Area: The compiletest test runner A-run-make Area: port run-make Makefiles to rmake.rs 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-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jan 25, 2025
@rustbot rustbot added the rollup A PR which is a rollup label Jan 25, 2025
@matthiaskrgr
Copy link
Member Author

@bors try

@bors
Copy link
Contributor

bors commented Jan 25, 2025

⌛ Trying commit 172dcf2 with merge a37c61f...

bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 25, 2025
Rollup of 6 pull requests

Successful merges:

 - rust-lang#130808 (Fix linking for symbols starting with ? on i686-pc-windows-msvc)
 - rust-lang#133154 (Reword resolve errors caused by likely missing crate in dep tree)
 - rust-lang#135707 (Shorten linker output even more when `--verbose` is not present)
 - rust-lang#135764 (Fix tests on LLVM 20)
 - rust-lang#135785 (use `PassMode::Direct` for vector types on `s390x`)
 - rust-lang#135818 (tests: Port `translation` to rmake.rs)

r? `@ghost`
`@rustbot` modify labels: rollup

try-job: aarch64-apple
try-job: i686-mingw
try-job: x86_64-gnu-llvm-19-3
@rust-log-analyzer
Copy link
Collaborator

The job i686-mingw failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
Updating files:  98% (50613/51645)
Updating files:  99% (51129/51645)
Updating files: 100% (51645/51645)
Updating files: 100% (51645/51645), done.
branch 'try' set up to track 'origin/try'.
Switched to a new branch 'try'
[command]"C:\Program Files\Git\bin\git.exe" log -1 --format=%H
a37c61faed8bb3e971aabe251bc242e53229a167
##[group]Run src/ci/scripts/setup-environment.sh
src/ci/scripts/setup-environment.sh
---
file:.git/config remote.origin.url=https://github.com/rust-lang-ci/rust
file:.git/config remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
file:.git/config gc.auto=0
file:.git/config http.https://github.com/.extraheader=AUTHORIZATION: basic ***
file:.git/config branch.try.remote=origin
file:.git/config branch.try.merge=refs/heads/try
file:.git/config remote.upstream.fetch=+refs/heads/*:refs/remotes/upstream/*
file:.git/config submodule.library/backtrace.active=true
file:.git/config submodule.library/backtrace.url=https://github.com/rust-lang/backtrace-rs.git
file:.git/config submodule.library/stdarch.active=true
---
---- [ui] tests\ui\symbol-names\symbol-with-question-mark-links.rs stdout ----

error: test compilation failed although it shouldn't!
status: exit code: 1
command: PATH="C:\a\rust\rust\build\i686-pc-windows-gnu\stage2\bin;C:\a\rust\rust\build\i686-pc-windows-gnu\stage0-bootstrap-tools\i686-pc-windows-gnu\release\deps;C:\a\rust\rust\build\i686-pc-windows-gnu\stage0\bin;C:\a\_temp\msys64\mingw32\bin;C:\a\_temp\msys64\usr\local\bin;C:\a\_temp\msys64\usr\bin;C:\a\_temp\msys64\usr\bin;C:\a\rust\rust\ninja;C:\a\rust\rust\mingw32\bin;C:\a\rust\rust\sccache;C:\a\_temp\setup-msys2;C:\Program Files\MongoDB\Server\5.0\bin;C:\aliyun-cli;C:\vcpkg;C:\Program Files (x86)\NSIS;C:\tools\zstd;C:\Program Files\Mercurial;C:\hostedtoolcache\windows\stack\3.3.1\x64;C:\cabal\bin;C:\ghcup\bin;C:\mingw64\bin;C:\Program Files\dotnet;C:\Program Files\MySQL\MySQL Server 8.0\bin;C:\Program Files\R\R-4.4.2\bin\x64;C:\SeleniumWebDrivers\GeckoDriver;C:\SeleniumWebDrivers\EdgeDriver;C:\SeleniumWebDrivers\ChromeDriver;C:\Program Files (x86)\sbt\bin;C:\Program Files (x86)\GitHub CLI;C:\Program Files\Git\bin;C:\Program Files (x86)\pipx_bin;C:\npm\prefix;C:\hostedtoolcache\windows\go\1.21.13\x64\bin;C:\hostedtoolcache\windows\Python\3.9.13\x64\Scripts;C:\hostedtoolcache\windows\Python\3.9.13\x64;C:\hostedtoolcache\windows\Ruby\3.0.7\x64\bin;C:\Program Files\OpenSSL\bin;C:\tools\kotlinc\bin;C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\8.0.432-6\x64\bin;C:\Program Files\ImageMagick-7.1.1-Q16-HDRI;C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin;C:\ProgramData\kind;C:\ProgramData\Chocolatey\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\dotnet;C:\Program Files\PowerShell\7;C:\Program Files\Microsoft\Web Platform Installer;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;C:\Program Files\Microsoft SQL Server\150\Tools\Binn;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit;C:\Program Files (x86)\WiX Toolset v3.14\bin;C:\Program Files\Microsoft SQL Server\130\DTS\Binn;C:\Program Files\Microsoft SQL Server\140\DTS\Binn;C:\Program Files\Microsoft SQL Server\150\DTS\Binn;C:\Program Files\Microsoft SQL Server\160\DTS\Binn;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\ProgramData\chocolatey\lib\pulumi\tools\Pulumi\bin;C:\Program Files\CMake\bin;C:\ProgramData\chocolatey\lib\maven\apache-maven-3.9.9\bin;C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code;C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager;C:\Program Files\nodejs;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Program Files\GitHub CLI;C:\tools\php;C:\Program Files (x86)\sbt\bin;C:\Program Files\Amazon\AWSCLIV2;C:\Program Files\Amazon\SessionManagerPlugin\bin;C:\Program Files\Amazon\AWSSAMCLI\bin;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\LLVM\bin;C:\Users\runneradmin.runner\.dotnet\tools;C:\Users\runneradmin.runner\.cargo\bin;C:\Users\runneradmin.runner\AppData\Local\Microsoft\WindowsApps;C:\a\_temp\msys64\usr\bin\site_perl;C:\a\_temp\msys64\usr\bin\vendor_perl;C:\a\_temp\msys64\usr\bin\core_perl" "C:\\a\\rust\\rust\\build\\i686-pc-windows-gnu\\stage2\\bin\\rustc.exe" "C:\\a\\rust\\rust\\tests\\ui\\symbol-names\\symbol-with-question-mark-links.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=C:\\Users\\runneradmin.runner\\.cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=C:\\a\\rust\\rust\\vendor" "--sysroot" "C:\\a\\rust\\rust\\build\\i686-pc-windows-gnu\\stage2" "--target=i686-pc-windows-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "--out-dir" "C:\\a\\rust\\rust\\build\\i686-pc-windows-gnu\\test\\ui\\symbol-names\\symbol-with-question-mark-links" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=C:\\a\\rust\\rust\\build\\i686-pc-windows-gnu\\native\\rust-test-helpers"
--- stderr -------------------------------
error: linking with `i686-w64-mingw32-gcc` failed: exit code: 1
   |
   |
   = note: "i686-w64-mingw32-gcc" "-Wl,C:\\a\\_temp\\msys64\\tmp\\rustcGSOGhG\\list.def" "-fno-use-linker-plugin" "-Wl,--dynamicbase" "-Wl,--disable-auto-image-base" "-Wl,--large-address-aware" "<sysroot>\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\rsbegin.o" "C:\\a\\_temp\\msys64\\tmp\\rustcGSOGhG\\symbols.o" "<1 object files omitted>" "-Wl,-Bdynamic" "<sysroot>\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\std-84136784f10dc0af.dll" "-Wl,-Bstatic" "<sysroot>\\lib\\rustlib\\i686-pc-windows-gnu\\lib/{libcompiler_builtins-*}.rlib" "-Wl,-Bdynamic" "-lkernel32" "-lkernel32" "-ladvapi32" "-lntdll" "-luserenv" "-lws2_32" "-ldbghelp" "C:\\a\\_temp\\msys64\\tmp\\rustcGSOGhG\\api-ms-win-core-synch-l1-2-0.dll_imports_indirect.lib" "C:\\a\\_temp\\msys64\\tmp\\rustcGSOGhG\\bcryptprimitives.dll_imports_indirect.lib" "-lgcc_s" "-lmsvcrt" "-lmingwex" "-lmingw32" "-lgcc" "-lmsvcrt" "-lmingwex" "-luser32" "-lkernel32" "-Wl,--nxcompat" "-L" "C:\\a\\rust\\rust\\build\\i686-pc-windows-gnu\\native\\rust-test-helpers" "-o" "C:\\a\\rust\\rust\\build\\i686-pc-windows-gnu\\test\\ui\\symbol-names\\symbol-with-question-mark-links\\symbol_with_question_mark_links.dll" "-Wl,--gc-sections" "-shared" "-Wl,--out-implib=C:\\a\\rust\\rust\\build\\i686-pc-windows-gnu\\test\\ui\\symbol-names\\symbol-with-question-mark-links\\libsymbol_with_question_mark_links.dll.a" "-Wl,--strip-debug" "-nodefaultlibs" "<sysroot>\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\rsend.o"
   = note: some arguments are omitted. use `--verbose` to show all linker arguments
   = note: C:/a/rust/rust/mingw32/bin/../lib/gcc/i686-w64-mingw32/14.1.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot export ?undecorated@@YAXXZ: symbol not defined␍
           collect2.exe: error: ld returned 1 exit status

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

---
test result: FAILED. 17965 passed; 1 failed; 363 ignored; 0 measured; 23 filtered out; finished in 893.70s

Some tests failed in compiletest suite=ui mode=ui host=i686-pc-windows-gnu target=i686-pc-windows-gnu
Build completed unsuccessfully in 1:00:05
make: *** [Makefile:120: ci-mingw-x] Error 1
  network time: Sat, 25 Jan 2025 11:57:09 GMT
##[error]Process completed with exit code 2.
Post job cleanup.
[command]"C:\Program Files\Git\bin\git.exe" version

@bors
Copy link
Contributor

bors commented Jan 25, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 25, 2025
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-run-make Area: port run-make Makefiles to rmake.rs 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-author Status: This is awaiting some action (such as code changes or more information) from the author. 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-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants