-
Notifications
You must be signed in to change notification settings - Fork 105
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
Replace winapi with windows-sys #120
Conversation
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.
Thanks for doing this, some comments inline. Some of them apply more broadly than just to the line indicated, for example the one about using the type alias in load_with_flags
applies just as well to the flag (re-)definitions as well.
2581015
to
debf372
Compare
@nagisa can you take another look? |
Sorry for the delay, it looks like the rustdoc tests are failing. See CI results. As for MSRV issues, we can bump that version at this time to something more reasonable. This would need modifications to the CI matrix in |
I have fixed the rustdoc issues. There is however a clippy one, that stems from a windows metadata bug: microsoft/win32metadata#1505 This is quite unfortunate, we'll have to wait for a new windows_sys release before we can merge this MR. |
debf372
to
d2020b3
Compare
Looks like there is still a failure (and thus the release of windows-sys hasn't happened yet). Please ping me when the release occurs, thanks! |
d2020b3
to
824276f
Compare
@nagisa windows-sys released the fix on 0.48, should be working fine now! |
Looks like there are some tests that are failing, but we will still need to raise the minimum supported Rust version checked by the CI. |
windows-sys has a MSRV of 1.48, which forces us to bump the MSRV of this crate.
Indeed, sorry about that. I have fixed the issues, I did not handle the Deref impl on the Symbol object properly. I also added a MSRV bump to 1.48, this should fix the MSRV pipeline as well. I think everything should be fine now |
824276f
to
a6a394a
Compare
Thanks! |
Fwiw the status-quo is to use |
Yes, discussion about this was ongoing while this PR was already in progress. Migrating to |
Curious where that's at, it's not in #118 nor the comments here.
Clocking in at 2.63MB it is by far the largest crate in most of my dependency graphs, while only a microscopic portion of its API surface is used. |
I meant this discussion: microsoft/windows-rs#1720 which started again about two weeks ago. |
Thanks for drawing my attention to this. I'm personally quite partial to making lovloading dependency-free given it's half-purpose of being kinda an extremely narrowly-focused crate. This is what I've done with Unix targets, and I'd love to see something like this for windows too.
|
It's a two week old feature with ~1 user and only designed for the most demanding of scenarios. I don't think you should be referring to this as the status quo (or at all). |
It looked as if some high-value crates were getting this conversion to |
Another interesting thing to note is that I don't know what tolerances are here for code size of dependencies in this project vs. manual bindings work. Just examining this PR, it seems that there's a significantly higher number of APIs being used than To be clear: I'm not proposing any action items for the project. Just wanted to raise something that might be relevant. |
windows-sys is a crate with bindings to the windows API that is maintained by Microsoft. A lot of crates are migrating from
winapi
to it, and it would be nice forlibloading
to migrate as well.The changes are quite straightforward:
isize
instead of a pointer.Option<unsafe extern "system" fn() -> isize>
, which is a bit more annoying to use in debug prints: I used the{:#x}
formatter instead of the{:p}
one: before: ``, after:Symbol@0x7ffb29135bf0
.Closes #118