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

Windows: Enable issue 70093 link tests #134918

Merged
merged 2 commits into from
Dec 31, 2024
Merged

Conversation

ChrisDenton
Copy link
Member

@ChrisDenton ChrisDenton commented Dec 30, 2024

Tracking issue for -Z link-native-libraries: #134948
Tracking issue for -Z link-directives: #134947

-Zlink-native-libraries=no and -Zlink-directives=no should work on Windows, at least for msvc. The fly in ointment is that default-linker-libraries doesn't. On unixy platforms rustc calls another compiler which in turn calls the linker along with the default libraries. On MSVC rustc calls the linker directly therefore it would need to be the one to implement default-linker-libraries. Except it doesn't so we workaround that in the test by using -C link-arg to talk to the linker.

@rustbot
Copy link
Collaborator

rustbot commented Dec 30, 2024

r? @davidtwco

rustbot has assigned @davidtwco.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc 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. labels Dec 30, 2024
@ChrisDenton
Copy link
Member Author

@bors try

bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 30, 2024
Windows: Enable issue 70093 link tests

`-Zlink-native-libraries=no` and `-Zlink-directives=no` *should* work on Windows, at least for msvc. The fly in ointment is that `default-linker-libraries` doesn't. On unixy platforms rustc calls another compiler which in turn calls the linker along with the default libraries. On MSVC rustc calls the linker directly therefore it would need to be the one to implement `default-linker-libraries`. Except it doesn't so we workaround that in the test by using `-C link-arg` to talk to the linker.

Marking as draft while I test if it actually *does* work,

try-job: x86_64-msvc
try-job: i686-msvc
@bors
Copy link
Contributor

bors commented Dec 30, 2024

⌛ Trying commit 8ff5758 with merge 5f557cb...

@bors
Copy link
Contributor

bors commented Dec 30, 2024

☀️ Try build successful - checks-actions
Build commit: 5f557cb (5f557cb797137f713457d6741627366b80721d9f)

@ChrisDenton
Copy link
Member Author

@bors try

bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 30, 2024
Windows: Enable issue 70093 link tests

`-Zlink-native-libraries=no` and `-Zlink-directives=no` *should* work on Windows, at least for msvc. The fly in ointment is that `default-linker-libraries` doesn't. On unixy platforms rustc calls another compiler which in turn calls the linker along with the default libraries. On MSVC rustc calls the linker directly therefore it would need to be the one to implement `default-linker-libraries`. Except it doesn't so we workaround that in the test by using `-C link-arg` to talk to the linker.

Marking as draft while I test if it actually *does* work,

try-job: i686-mingw
try-job: x86_64-mingw-1
@bors
Copy link
Contributor

bors commented Dec 30, 2024

⌛ Trying commit 8ff5758 with merge a8a75ad...

@bors
Copy link
Contributor

bors commented Dec 30, 2024

☀️ Try build successful - checks-actions
Build commit: a8a75ad (a8a75ad84b677cf88c25b72f73696d180d3fc99b)

@ChrisDenton
Copy link
Member Author

All tests pass on windows-msvc and windows-gnu hosts, marking as ready for review.

@ChrisDenton ChrisDenton marked this pull request as ready for review December 30, 2024 16:27
@saethlin
Copy link
Member

@ChrisDenton
Copy link
Member Author

I can try but I'm uncertain if that will work due to cross-compiling.

@ChrisDenton
Copy link
Member Author

@bors try

@bors
Copy link
Contributor

bors commented Dec 30, 2024

⌛ Trying commit 6e562ec with merge 8f46b84...

bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 30, 2024
Windows: Enable issue 70093 link tests

`-Zlink-native-libraries=no` and `-Zlink-directives=no` *should* work on Windows, at least for msvc. The fly in ointment is that `default-linker-libraries` doesn't. On unixy platforms rustc calls another compiler which in turn calls the linker along with the default libraries. On MSVC rustc calls the linker directly therefore it would need to be the one to implement `default-linker-libraries`. Except it doesn't so we workaround that in the test by using `-C link-arg` to talk to the linker.

try-job: x86_64-msvc
try-job: i686-msvc
try-job: i686-mingw
try-job: x86_64-mingw-1
@jieyouxu jieyouxu assigned jieyouxu and unassigned davidtwco Dec 31, 2024
@bors
Copy link
Contributor

bors commented Dec 31, 2024

☀️ Try build successful - checks-actions
Build commit: 8f46b84 (8f46b84abd9d01b702df6fc95d98bbeda2b76e24)

@ChrisDenton
Copy link
Member Author

That worked, thanks!

Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, one request for a test doc comment, but otherwise LGTM.

Copy link
Member

@jieyouxu jieyouxu Dec 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: could we slightly document what this test is actually checking?

I opened two tracking issues:

But the original issue #70093 is not very obvious in what this test is actually trying to check for. If it's not obvious to you either, then I guess throw in a FIXME(#134947, #134948) lol.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests were the first time I'd heard of link-directives and link-native-libraries but I think I get the intent. Let me see what I can write.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for me, which is how I found out they had no MCPs nor tracking issues, and -Zlink-directives I believe has zero documentation either.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tbh, I think they have a lot of overlap with each other. And also with using the -l compiler flag when used to override native libs (but that currently has a much more limited effect).

@jieyouxu
Copy link
Member

@rustbot author (doc comment)

@rustbot rustbot 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 Dec 31, 2024
@jieyouxu jieyouxu added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 31, 2024
Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, you can r=me after PR CI is green.

@jieyouxu
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Dec 31, 2024

📌 Commit dc1f2be 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 Dec 31, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 31, 2024
…iaskrgr

Rollup of 4 pull requests

Successful merges:

 - rust-lang#134610 (Format `build.toml` consistently in platform support docs)
 - rust-lang#134918 (Windows: Enable issue 70093 link tests)
 - rust-lang#134953 (Fix doc for read&write unaligned in zst operation)
 - rust-lang#134956 (Account for C string literals and `format_args` in `HiddenUnicodeCodepoints` lint)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit d08d132 into rust-lang:master Dec 31, 2024
6 checks passed
@rustbot rustbot added this to the 1.85.0 milestone Dec 31, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Dec 31, 2024
Rollup merge of rust-lang#134918 - ChrisDenton:issue-70093, r=jieyouxu

Windows: Enable issue 70093 link tests

Tracking issue for `-Z link-native-libraries`: rust-lang#134948
Tracking issue for `-Z link-directives`: rust-lang#134947

`-Zlink-native-libraries=no` and `-Zlink-directives=no` *should* work on Windows, at least for msvc. The fly in ointment is that `default-linker-libraries` doesn't. On unixy platforms rustc calls another compiler which in turn calls the linker along with the default libraries. On MSVC rustc calls the linker directly therefore it would need to be the one to implement `default-linker-libraries`. Except it doesn't so we workaround that in the test by using `-C link-arg` to talk to the linker.
@ChrisDenton ChrisDenton deleted the issue-70093 branch December 31, 2024 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants