In a recent conversation with the maintainer of the various windows crates, he suggested migrating off windows-sys and instead generating dedicated bindings with windows-bindgen
Personally, I would prefer to depend on an official MS crate for platform-specific code (and really like the fact that these crates exist[1]); both as a platform-specific-library developer and consumer.
What is your opinion, either as a consumer of downstream crates which need platform-specific bindings or as a developer of such libraries?
- Stick with
windows-sys- even with slow updates it's official and therefore more trustworthy for an upstream consumer (like 2018 inverse dependents, vs 15 forwindows-bindgen) - Generate minimal, specific bindings via an integration test which fails if they change (this is what
chronodoes) - Have a separate bin crate which can be run to regenerate bindings on demand, store this is the same repo but don't publish (recommendation from
windowsmaintainer) - Generate bindings every time in build.rs (option suggested by
windowsmaintainer for direct binary crates) - Create a second, dedicated
win-cdrom-bindingscrate, publish and depend on that (risks flooding the ecosystem with loads of similar, slightly-overlapping crates)
Please don't turn this into an MS-bashing session ↩︎