Skip to content

Commit

Permalink
feat(quinn-udp): support both windows-sys v0.52 and v0.59
Browse files Browse the repository at this point in the history
`quinn-udp` depends on the `windows-sys` crate, more specifically
`windows_sys::Win32::Networking::WinSock`:

https://github.com/quinn-rs/quinn/blob/a5d9bd1154b7644ff22b75191a89db9687546fdb/quinn-udp/src/cmsg/windows.rs#L6

https://github.com/quinn-rs/quinn/blob/a5d9bd1154b7644ff22b75191a89db9687546fdb/quinn-udp/src/windows.rs#L13

Previously `quinn-udp` was using `windows-sys` `v0.52`.
#1960 updated `quinn-udp` to `v0.59`.
Note that `windows-sys` went straight from `v0.52` to `v0.59`. There are no
versions in between.

`quinn-udp` does not depend on any `windows-sys` `v0.59` features. In other
words, it can support both `windows-sys` `v0.52` and `v0.59`.

https://github.com/microsoft/windows-rs/releases/tag/0.59.0

This commit allows downstream users of `quinn-udp` to explicitly use `quinn-udp` with `windows-sys` `v0.52`.

For other users not explicitly demanding `windows-sys` `v0.52`, cargo will
choose `windows-sys` `v0.59`:

> It also attempts to use the greatest version currently available within that compatibility range.

https://doc.rust-lang.org/cargo/reference/resolver.html#semver-compatibility
  • Loading branch information
mxinden authored and Ralith committed Oct 28, 2024
1 parent a5d9bd1 commit a461695
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ tracing = { version = "0.1.10", default-features = false, features = ["std"] }
tracing-futures = { version = "0.2.0", default-features = false, features = ["std-future"] }
tracing-subscriber = { version = "0.3.0", default-features = false, features = ["env-filter", "fmt", "ansi", "time", "local-time"] }
url = "2"
windows-sys = { version = "0.59", features = ["Win32_Foundation", "Win32_System_IO", "Win32_Networking_WinSock"] }
windows-sys = { version = ">=0.52, <=0.59", features = ["Win32_Foundation", "Win32_System_IO", "Win32_Networking_WinSock"] }

[profile.bench]
debug = true
Expand Down

0 comments on commit a461695

Please sign in to comment.