Skip to content

Use raw-dylib for Windows synchronization functions - #124019

Merged
bors merged 2 commits into
rust-lang:masterfrom
ChrisDenton:futex-raw-dylib
Apr 19, 2024
Merged

Use raw-dylib for Windows synchronization functions#124019
bors merged 2 commits into
rust-lang:masterfrom
ChrisDenton:futex-raw-dylib

Conversation

@ChrisDenton

Copy link
Copy Markdown
Member

Fixes#123999 by using the raw-dylib feature to specify the DLL to load the Windows futex functions from (e.g. WaitOnAddress). This avoids reliance on the import library causing that issue.

With apologies to @bjorn3, as it's currently necessary to revert this for cranelift.

@rustbot

Copy link
Copy Markdown
Collaborator

r? @compiler-errors

rustbot has assigned @compiler-errors.
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

@rustbotrustbot added O-windows Operating system: Windows S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler 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 Apr 16, 2024
@rustbot

Copy link
Copy Markdown
Collaborator

Some changes occurred in compiler/rustc_codegen_cranelift

cc @bjorn3

@ChrisDenton

ChrisDenton commented Apr 16, 2024

Copy link
Copy Markdown
MemberAuthor

Oh silly bot, this is really a libs thing. Just with a bit of cranelift sprinkled on top,

r? libs

Comment threadlibrary/std/src/sys/pal/windows/c.rs Outdated
@rust-log-analyzer

This comment has been minimized.

This is a workaround for older mingw `synchronization` import library not working on at least some system.
@joboet

Copy link
Copy Markdown
Member

Looks fine to me, considering that windows does the same thing.

@bors r+

@bors

bors commented Apr 18, 2024

Copy link
Copy Markdown
Collaborator

📌 Commit 5b024d6 has been approved by joboet

It is now in the queue for this repository.

@borsbors 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 Apr 18, 2024
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Apr 18, 2024
Use raw-dylib for Windows synchronization functions
Fixesrust-lang#123999 by using the raw-dylib feature to specify the DLL to load the Windows futex functions from (e.g. [`WaitOnAddress`](https://learn.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-waitonaddress)). This avoids reliance on the import library causing that issue.
With apologies to `@bjorn3,` as it's currently necessary to revert this for cranelift.
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Apr 18, 2024
Use raw-dylib for Windows synchronization functions
Fixesrust-lang#123999 by using the raw-dylib feature to specify the DLL to load the Windows futex functions from (e.g. [`WaitOnAddress`](https://learn.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-waitonaddress)). This avoids reliance on the import library causing that issue.
With apologies to `@bjorn3,` as it's currently necessary to revert this for cranelift.
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 19, 2024
…kingjubilee
Rollup of 9 pull requests
Successful merges:
- rust-lang#117919 (Introduce perma-unstable `wasm-c-abi` flag)
- rust-lang#123406 (Force exhaustion in iter::ArrayChunks::into_remainder)
- rust-lang#123752 (Properly handle emojis as literal prefix in macros)
- rust-lang#123935 (Don't inline integer literals when they overflow - new attempt)
- rust-lang#123980 ( Add an opt-in to store incoming edges in `VecGraph` + misc)
- rust-lang#124019 (Use raw-dylib for Windows synchronization functions)
- rust-lang#124110 (Fix negating `f16` and `f128` constants)
- rust-lang#124112 (Fix ICE when there is a non-Unicode entry in the incremental crate directory)
- rust-lang#124116 (when suggesting RUST_BACKTRACE=1, add a special note for Miri's env var isolation)
r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 19, 2024
…kingjubilee
Rollup of 7 pull requests
Successful merges:
- rust-lang#123406 (Force exhaustion in iter::ArrayChunks::into_remainder)
- rust-lang#123752 (Properly handle emojis as literal prefix in macros)
- rust-lang#123935 (Don't inline integer literals when they overflow - new attempt)
- rust-lang#123980 ( Add an opt-in to store incoming edges in `VecGraph` + misc)
- rust-lang#124019 (Use raw-dylib for Windows synchronization functions)
- rust-lang#124110 (Fix negating `f16` and `f128` constants)
- rust-lang#124116 (when suggesting RUST_BACKTRACE=1, add a special note for Miri's env var isolation)
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit 55c35dd into rust-lang:masterApr 19, 2024
@rustbotrustbot added this to the 1.79.0 milestone Apr 19, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 19, 2024
Rollup merge of rust-lang#124019 - ChrisDenton:futex-raw-dylib, r=joboet
Use raw-dylib for Windows synchronization functions
Fixesrust-lang#123999 by using the raw-dylib feature to specify the DLL to load the Windows futex functions from (e.g. [`WaitOnAddress`](https://learn.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-waitonaddress)). This avoids reliance on the import library causing that issue.
With apologies to ``@bjorn3,`` as it's currently necessary to revert this for cranelift.
@ChrisDentonChrisDenton added beta-nominated Nominated for backporting to the compiler in the beta channel. and removed T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 19, 2024
@ChrisDenton

Copy link
Copy Markdown
MemberAuthor

I'm nominating this for a beta backport, even though this isn't technically a Rust issue. See linked issue for more but the short version is that the windows-2019 github action runner comes with a years old mingw that has a bug which will prevent windows-gnu std from working if compiled on that machine. This PR works around the bug. It's a small PR so I think it's worth it to make sure that stable works out of the box on windows-2019.

Note that the windows-latest runner isn't affected.

@AmanieuAmanieu added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Apr 24, 2024
@ChrisDenton
ChrisDenton deleted the futex-raw-dylib branch April 24, 2024 16:40
@Mark-SimulacrumMark-Simulacrum modified the milestones: 1.79.0, 1.78.0Apr 28, 2024
@Mark-SimulacrumMark-Simulacrum removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Apr 28, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 28, 2024
…Simulacrum
[stable] 1.78.0 release
https://forge.rust-lang.org/release/process.html#promote-branches-t-3-days-monday
This also includes a backport of:
* Use raw-dylib for Windows synchronization functions rust-lang#124019
r? `@Mark-Simulacrum`
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beta-acceptedAccepted for backporting to the compiler in the beta channel.O-windowsOperating system: WindowsS-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-libsRelevant 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.

STATUS_ENTRYPOINT_NOT_FOUND error with x86_64-pc-windows-gnu on Windows Server 2019 in GitHub action

9 participants

@ChrisDenton@rustbot@rust-log-analyzer@joboet@bors@bjorn3@Amanieu@compiler-errors@Mark-Simulacrum