-
Notifications
You must be signed in to change notification settings - Fork 913
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
Adopt windows-sys #2057
Adopt windows-sys #2057
Conversation
2b93692
to
9e4572b
Compare
My 2 cents, Microsoft is actively asking for feedback so some of this may be useful to share: microsoft/windows-rs#1285 Other 2 cents, this fork seems to work for our small use-case |
Nice! Please create new issues for any feedback: https://github.com/microsoft/windows-rs/issues Very happy to clean up any warts you may find. Compile time will improve, as the win32 metadata namespaces are being refactored as we speak. That is a high priority for me. If it helps, here's another reference port that may be interesting to compare: https://github.com/yoshuawuyts/miow/compare/kenny?expand=1 |
@MarijnS95 I hope I could address all of your comments. Thanks for your review! |
@clemenswasser Thanks! I have a couple more review points ready to be submitted and haven't made it to the end yet, but overall this looks really good! Got some high-prio stuff to take care of first but I'll get back to it ASAP :) |
I must admit that I'm still on the fence when it comes to adopting the That's not to say that I don't appreciate that you're taking the time to do this, it's just that I'm not quite sure the tradeoffs (as things currently stand) are worth it in the end. |
I would argue, winapi is currently unmaintained, so nothing on the compile times or other areas will significantly change. windows-rs on the other hand is a pretty young project with Microsoft behind it, compile times will get better (maybe even better than winapi, who knows?). What I want to say is that windows-rs already has many significant improvements today, with more to come. |
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! (not done with reviewing everything so far)
@maroider @ChrisDenton IMO windows-rs is the future:
I don't think it makes sense for As for the open issues (eg. compile speed), that's a bit of a chicken-and-egg problem. The faster windows-rs gets widespread adoption, the quicker issues can be properly triaged and addressed. However I can also see that it's quite early and with windows-rs breaking updates coming in hot, |
@clemenswasser Fyi windows-rs just released 0.26 with slightly refactored namespaces. I hope that's not causing many issues here as they're mostly related to Direct3D :) |
Not using the |
We're getting hangs internally with 6629e52 ( |
Yeah I completely forgot that I reviewed that when being alerted this morning that our upgrade to windows-rs 0.26 and this PR may have caused the breakage. Surprisingly no segfaults, but I've been told that it's fixed now with the null-terminators added back! |
The |
This seems like it would address my biggest concern with migrating to windows-rs. I do, of course, have smaller complaints, like the atypical module name style and the deepening of I also have a minor concern about the soundness of marking simple wrapper-structs like |
FYI The windows-sys crate has now been published: https://crates.io/crates/windows-sys Here's a small windowing example: https://github.com/microsoft/windows-samples-rs/tree/master/create_window_sys |
The While |
It's nice to see that you fixed this so quickly, but the way you've worded your comment makes it sound like it wasn't a concern in the first place. I could admittedly be misinterpreting your intent, and it's not a massive problem, but I must admit I'm a tad miffed. |
I don't follow. It's been unchanged in the My point was just that we have the type information to generate the code correctly. |
d289b1e
to
9f909d7
Compare
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.
I'd consider microsoft/windows-rs#1504 to be a blocking issue for the time being.
5755b7c
to
ec8c469
Compare
36f8aaf
to
e5b2fe4
Compare
For experimentation and early adopting, I have updated to the latest windows-sys master branch, which includes microsoft/windows-rs#1550 |
e5b2fe4
to
196ef95
Compare
0.33 should be released this week. |
196ef95
to
87bd06c
Compare
Updated to windows-sys 0.33 |
87bd06c
to
a48c1e7
Compare
Rebased to current master |
Some compile time benchmarks: current master: b7e7755 with winapi 0.3.9:
this branch: a48c1e7 with windows-sys 0.33 & 0.32 (through parking-lot):
this branch: a48c1e7 with windows-sys 0.33 and custom parking-lot also updated to windows-sys 0.33:
So currently a light regression. |
Compile times are no problem when we're talking such low numbers, no worries! |
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.
I'm going forward with merging this in order to avoid any new merge conflicts. Given the great number of reviews (thanks to all!) this looks good to go.
Thanks again to @clemenswasser for consistently updating and taking care of this PR!
Btw, I was very vocal in this issue about compile-times going from "13 seconds to around 1 minute" because there wasn't really a benefit code-wise; but if someone wants to go and make our Windows platform use the new features in the |
This was a mistake in the transition to windows-sys: rust-windowing#2057 We used winapi's GET_XBUTTON_WPARAM before which is using HIWORD instead of LOWORD: https://docs.rs/winapi/0.3.9/src/winapi/um/winuser.rs.html#1297-1299
This was a mistake in the transition to windows-sys: #2057 We used winapi's GET_XBUTTON_WPARAM before which is using HIWORD instead of LOWORD: https://docs.rs/winapi/0.3.9/src/winapi/um/winuser.rs.html#1297-1299
Change from using the unofficial winapi bindings, to using the official windows bindings from Microsoft.
cargo fmt
has been run on this branchcargo doc
builds successfullyCHANGELOG.md
if knowledge of this change could be valuable to users