-
Notifications
You must be signed in to change notification settings - Fork 231
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
Bumping windows-sys
is a Semver breaking change
#526
Comments
Yes, this is totally correct. We have a problem where we want to be able to extract the underlying raw/C types, but that means we depend on external crates in our API. For libc this is mostly not a problem because it's stable-ish -- the update to v1 will have this problem though. Windows-sys is worse because they release way too many version for such a low-level crate. We can drop all types from external types from our API, but we want to keep the ability to get the underlying raw/C types. This problem will have to be solved. I don't have a solution for now. |
Any update on this? Has more discussion been had and is there any proposed fix? This issue currently makes it hard for any user of |
No solution yet, not any further discussion either. So let's start one. Socket2 aims to expose some of the underlying types so the raw types can be used if socket2 doesn't have a proper const/function/etc. for it yet. That said, we do support a lot of functionality now so maybe this goals isn't worth it anymore. If we decide that the goal isn't worth it we can close the API a bit more and don't depend on libc/windows-sys types in the public API. Although for Also, if windows-sys could stop release breaking changes every other week that would be great /rant (admittedly this annoys me more than it should) |
How many types is this a problem for? |
Quite a few. For example The main problem is |
Even if it's ugly I think that the opaque pointer solution might be the least bad solution. Then The same problem should not be there for Line 38 in 56e625e
|
|
Aren't the Windows types at ABI level stable though? I don't develop for Windows myself, but one of the good things I hear about it that Windows takes backwards compatibility very serious. So it's quite annoying for such a low level crate to have breaking change that often. And yes, I think that every 6 months is often if you compare it to e.g. the libc crate which has been on the same 0.2.x version since 9 years, i.e. pretty much all of Rust v1. Don't get me wrong though, I do appreciate the work being put into it and I fully understand what a v0.x version means :)
I don't really want to maintain these types myself, personally I think window-sys/libc are the correct places for these types. |
Yes, but that doesn't mean the metadata is fully accurate in all cases. And a fix anywhere can be semver breaking for the whole crate even if most things stay the same. Note that the Windows API is large. It's somewhat comparable to if you said every library and API that ships with Ubuntu is "the Ubuntu API" and put that in a crate. There are some smaller crates now that focus on a specific area, like
Sure. Though I don't think the maintenance cost of windows-bindgen is particular high. E.g. |
Can we just use void pointers? We do that in Tokio for the few functions we have, e.g. |
I agree that void pointers seems the only way to solved this at the moment. |
socket2 0.5.5
depends onwindows-sys 0.48
socket2 0.5.6, 0.5.7
depend onwindows-sys 0.52
This is a breaking change because
windows_sys::Win32::Networking::WinSock::SOCKADDR_STORAGE
is reexported as thesockaddr_storage
type, making it a part of the public API: https://github.com/rust-lang/socket2/blob/master/src/sys/windows.rs#L63This can lead to build failures from a seemingly innocuous
cargo update
:0.5.6
should have been released as0.6.0
.Resolution
socket2
version.windows-sys
dependency should be marked with a warning inCargo.toml
not to bump it in a patch release.We've already worked around the breakage, so I don't really care what happens to the released version.
The text was updated successfully, but these errors were encountered: