-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Port winapi_util from winapi to windows-sys. #13
Conversation
@retep998 What do you make of the move to @sunfishcode Assuming I do agree with this move, it's going to be logistically challenging given my constrained time. Namely:
Otherwise though, I personally have no particular affinity towards winapi or windows-sys. But that is most likely a result of ignorance rather than any sort of informed opinion. |
walkdir just uses the Windows bindings for one thing, and the change is straightforward. This accompanies BurntSushi/winapi-util#13.
It appears this change isn't compatible with winapi_util's minimum supported Rust version of 1.34. Empirically, it needs Rust 1.48, which would be another reason to do a major bump. Looking at ripgrep's
|
This forks the parts of winapi_util that winx needs, applying the BurntSushi/winapi-util#13 patch which updates it to windows-sys.
Is there any way to get this merged (preferably including an update to Looking at In contrast 17 crates pull in
|
I have to look into this and, honestly, it isn't a priority for me. The main issue I have with An alternative is inlining the bindings themselves into this crate. I think I'd be more amenable to that. |
For the compile times it looks like a win. Cross-compiling I can't deny that there's some version churn, but I don't think it's that much of a problem. Most of the time it's just a version number bump because the API surface is so large and you're unlikely to be using the part that changed. Pretty sure I've seen a single update in the last two years that required minor code changes.
PS: Thanks for the updating the PR so quickly, @sunfishcode. |
This ports winapi_util from using winapi internally to using windows-sys internally.
https://kennykerr.ca/rust-getting-started/standalone-code-generation.html
Awesome! Thanks for testing that.
I hear you. But to be clear here, this is a decision for me to make, since I'm the maintainer and the one who will be experiencing the churn. I move pretty slowly, and needing to do semver incompatible updates every few months is too much for me. If their cadence is every 8 months, that is... perhaps okay. Do they have a release policy written down anywhere?
I was unaware of this issue. That's unfortunate. Indeed, it looks like that doesn't avoid version churn. The next thing on my list here would be to look at what |
Obviously and it wasn't my intention to imply otherwise. Apologies if it came across that way.
Apparently they switched from a 3-6 months cadence to on-demand releases in Nov 2022 (microsoft/windows-rs#2156 (comment) and microsoft/windows-rs#2156 (comment)). Might at times be more volatile than every 8 months then. |
I'll admit you can't beat |
While it's not declared as such, from the looks of it, It's because of that that I acknowledge that I've been thinking about this more, and I'm leaning towards just merging this PR and seeing what the churn feels like. |
If a security patch is ever needed, you can always just poke me on discord. But yeah, |
We've hit issues while porting our project to the new |
This PR is on crates.io in |
Notably, this removes winapi in favor of windows-sys, as a result of winapi-util switching over to windows-sys[1]. Annoyingly, when PCRE2 is enabled, this brings in a dependency on `once_cell`[2]. I had worked to remove it from my dependencies and now it's back. Gah. I suppose I could disable the `parallel` feature of `cc`, but that doesn't seem like a good trade-off. [1]: BurntSushi/winapi-util#13 [2]: rust-lang/cc-rs#1037
This ports winapi_util from using winapi internally to using windows-sys
internally.
The port is mostly straightforward, except that windows-sys declares
constants like
FOREGROUND_BLUE
with typeu32
, which is inconvenientbecause they are passed to an API that uses
u16
, but the workaroundis simple and I've filed an issue in windows-sys.
Background: Some projects I'm working on which use winapi_util are
switching to windows-sys because it covers some APIs we need that
winapi lacks and winapi is not responsive on a PR to add them. I don't
know if others are interested in making this change; if not, feel free to
close this.