registry-rs icon indicating copy to clipboard operation
registry-rs copied to clipboard

Adopt official windows-rs API

Open spikespaz opened this issue 4 years ago • 9 comments
trafficstars

I do not know if this works. I am fairly new to Rust, but I did my best. I did this because I do not want both winapi and windows-rs as dependencies in my future project. Please see https://github.com/rust-windowing/winit/pull/2057, as my contribution is based off of this.

Please leave comments on any problems with the changes, and I will be sure to fix them. I do not know how you are testing this, I may wish to implement tests for you. 😄

spikespaz avatar Nov 18 '21 07:11 spikespaz

Very interesting. I was thinking about investigating this recently, so I'm very happy that you've done that for me haha.

How does this impact build times?

bbqsrc avatar Nov 18 '21 07:11 bbqsrc

4.38s --> 7.66s Edit: May not be an accurate measurement. Best try it yourself.

There's discussion about the speed (or lack thereof) compiling windows-rs in the PR I linked above.

spikespaz avatar Nov 18 '21 07:11 spikespaz

Yeah it's not a strict science, but ballparks are relevant. Will have a think on this for a bit and get back to you. 😄

bbqsrc avatar Nov 18 '21 08:11 bbqsrc

@bbqsrc any update on this ? Would love to have this merged....

Since, The PR repo is deleted, Is there anyway I could least use this PR as a dependency ??


registry = { git = "https://github.com/bbqsrc/registry-rs", tag = "d912b165e826add5d484ff21683a044585cb591f" }

is not working well

EDIT:

registry = { git = "https://github.com/bbqsrc/registry-rs", rev = "refs/pull/5/head" }

is working good. Thanks to this.

U-C-S avatar Apr 09 '22 05:04 U-C-S

I just ran across this again, and wanted to close it because it seems stale. Just checking before I do, to make sure this change isn't wanted.

spikespaz avatar Aug 11 '23 00:08 spikespaz

@spikespaz it looks like everyone is slowly moving away from winapi towards the official and maintained windows bindings, in various forms. Though this PR needs a rather large overhaul as the bindings are now much further ahead and in a much better place than when these changes were made.

If the build times are still an issue on the latest version, and if these types aren't leaking into the public API, you may look into the recently released windows-core crate together with windows-bindgen which generates a more modest private set of bindings limited to "just the ones you need" (unfortunately currently with all the types (in)directly referenced by functions in a module/type).

An up-to-date example is available at https://github.com/strawlab/iana-time-zone/pull/117; let me know if you need assistance integrating/testing this for registry-rs!


And landing this will be a "Fixes #9" :grimacing:

MarijnS95 avatar Aug 26 '23 21:08 MarijnS95

It looks like the Cargo.lock is in the .gitignore. It shouldn't be, the lock files (for almost any build system) are intended to be included in VCS for reproducibility.

Can I fix that?

spikespaz avatar Aug 27 '23 20:08 spikespaz

It looks like the Cargo.lock is in the .gitignore. It shouldn't be, the lock files (for almost any build system) are intended to be included in VCS for reproducibility.

Can I fix that?

I am wrong, that is not the case for libraries.

spikespaz avatar Aug 28 '23 07:08 spikespaz

@spikespaz I'm sure you've already heard this, but the official Rust guidance these days is: It depends on the project's needs, with the default being that the Cargo.lock is included.

stefnotch avatar Apr 13 '24 16:04 stefnotch