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

migrate from winapi to windows_sys #76

Merged
merged 2 commits into from
Oct 30, 2022
Merged

migrate from winapi to windows_sys #76

merged 2 commits into from
Oct 30, 2022

Conversation

sn99
Copy link
Contributor

@sn99 sn99 commented Sep 26, 2022

Migrate from winapi to windows-rs for the following:

  1. Winapi is no longer actively maintained (last commit was 9 months ago as of now and 2nd last around 2 years ago) compared to last commit to windows-rs as of few days ago.
  2. windows-rs is the official Rust crate for Windows by Microsoft and is supposed to be providing a natural and idiomatic way for Rust developers to call Windows APIs. Some crates like socket2 have already migrated to it.

We can also use the latest version of windows_sys (which is rust-version = "1.46") if the minimum required version is changed in ci/cd.

@nagisa
Copy link
Member

nagisa commented Oct 29, 2022

Sorry for taking a long time to respond to this PR.

I think it is fine if we bump the MSRV version – upgrading a dependency seems like a reason good enough to warrant it.

It seems like rustc already depends on windows-sys as well, so there are no unresolved license incompatibility or similar such concerns either.

Perhaps the only thing I think we should do is relax the version bounds to something like >=$lowest_version_this_library_builds_with, <$highest_released_version. One of the reasons to do that is that rustc currently pulls in windows-sys 0.36 and so specifying precisely 0.34 will result in dependency duplication (unfortunate!) This was less of a problem with winapi given that there were just 3 versions overall :)

Alternatively, I feel like it wouldn’t be too terrible if we just copied the extern definitions into the crate itself. The API scope stacker depends on is really limited and I definitely wouldn’t lose sleep over having to maintain the 8 functions. But that’s out of scope for this PR.

migrate from winapi to windows_sys
@nagisa
Copy link
Member

nagisa commented Oct 30, 2022

Thanks. The test failures are probably rust-lang/rust#103673.

@nagisa nagisa merged commit 91cf50a into rust-lang:master Oct 30, 2022
@djc djc mentioned this pull request Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants