From a461695fe3bb20fa1e352f646a9678d07fb5d45a Mon Sep 17 00:00:00 2001 From: Max Inden Date: Mon, 28 Oct 2024 12:18:35 +0100 Subject: [PATCH] feat(quinn-udp): support both windows-sys v0.52 and v0.59 `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`. https://github.com/quinn-rs/quinn/pull/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 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index d9dc1cde7..d50ea2446 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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