-
Notifications
You must be signed in to change notification settings - Fork 225
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
Remove dependency on the synchapi
winapi feature
#70
Conversation
core/src/spinwait.rs
Outdated
@@ -17,11 +17,14 @@ use std::sync::atomic::spin_loop_hint; | |||
#[cfg(windows)] | |||
#[inline] | |||
fn thread_yield() { | |||
extern "system" { | |||
fn Sleep(a: winapi::shared::minwindef::DWORD); | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a comment explaining why this is being pulled in directly?
Pulling in `parking_lot` to the Rust compiler unfortunately had adverse side effects on the binary dependencies of rustc -- rust-lang/rust#49438. It turns out this is due to a number of bugs happening all at once, and currently we're looking for ways to fix the beta/master branches of rustc to fix this for now (not necessarily in the best way). This commit removes the activation of the `synchapi` feature of `winapi` which prevents `libsynchronization.a` from being linked in (and prevents rustc from accidentally picking up a dependency on a missing DLL). The `synchapi` feature was only activated for access to the `Sleep` function, but that function actually resides in `kernel32.dll`. As a result this commit inlines the definition of `Sleep` into this crate to avoid needing to depend on an upstream definition.
Updated! |
Might be worth mentioning in the comment that this change was only done for the sake of building Rust itself as in any other situation |
Thanks @Amanieu! Could you also publish a new version so we can update rustc? |
Done! |
Awesome, thanks @Amanieu! |
This commit updates `parking_lot` to pull in Amanieu/parking_lot#70 and... Closes rust-lang#49438
…Mark-Simulacrum Update `parking_lot` dependencies This commit updates `parking_lot` to pull in Amanieu/parking_lot#70 and... Closes rust-lang#49438
Pulling in
parking_lot
to the Rust compiler unfortunately had adverse sideeffects on the binary dependencies of rustc -- rust-lang/rust#49438. It turns
out this is due to a number of bugs happening all at once, and currently we're
looking for ways to fix the beta/master branches of rustc to fix this for now
(not necessarily in the best way).
This commit removes the activation of the
synchapi
feature ofwinapi
whichprevents
libsynchronization.a
from being linked in (and prevents rustc fromaccidentally picking up a dependency on a missing DLL). The
synchapi
featurewas only activated for access to the
Sleep
function, but that functionactually resides in
kernel32.dll
. As a result this commit inlines thedefinition of
Sleep
into this crate to avoid needing to depend on an upstreamdefinition.