Skip to content
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

feat(quinn-udp): support both windows-sys v0.52 and v0.59 #2021

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

mxinden
Copy link
Collaborator

@mxinden mxinden commented Oct 28, 2024

quinn-udp depends on the windows-sys crate, more specifically windows_sys::Win32::Networking::WinSock:

use windows_sys::Win32::Networking::WinSock;

use windows_sys::Win32::Networking::WinSock;

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


Additional context:

Note that the ask is to support windows-sys v0.52 only while quinn-udp does not depend on any windows-sys features >= v0.59. As soon as quinn-udp needs any windows-sys >=v0.59 features, it should naturally drop windows-sys v0.52 support.

`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`.
quinn-rs#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
Copy link
Member

@djc djc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable to me. I still also like the solution of pregenerating bindings using windows-bindgen, which would sidestep these issues.

Copy link
Collaborator

@Ralith Ralith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Theoretically significant risk of bitrot here without CI coverage, but I don't expect our use of windows-sys will change meaningfully for the foreseeable future.

@Ralith Ralith added this pull request to the merge queue Oct 28, 2024
Merged via the queue into quinn-rs:main with commit a461695 Oct 28, 2024
14 checks passed
@mxinden
Copy link
Collaborator Author

mxinden commented Oct 28, 2024

Thank you for the very quick help here @djc and @Ralith!

I still also like the solution of pregenerating bindings using windows-bindgen, which would sidestep these issues.

I don't have enough experience with windows-bindgen to say whether it is worth the additional complexity.

Theoretically significant risk of bitrot here without CI coverage, but I don't expect our use of windows-sys will change meaningfully for the foreseeable future.

Agreed!

(At least, once in Firefox, the latest release will be tested a couple million times per day :P )

mxinden added a commit to mxinden/neqo that referenced this pull request Oct 30, 2024
Currently we use `quinn-udp` `v0.5.4`.

`quinn-udp` `v0.5.5` fixes [`recvmmsg` calls on Android x86](quinn-rs/quinn#1966).

`quinn-udp` `v0.5.6` adds [experimental multi-message support on Apple
platforms](quinn-rs/quinn#1993) and [fixes an
unnecessary `windows-sys` version
restriction](quinn-rs/quinn#2021).

While not strictly necessary, given that our current version specification (i.e.
`version = "0.5.4"`) already allows users to use Neqo with `quinn-udp` `v0.5.6`,
this commit updates to `quinn-udp` `v0.5.6` anyways, thus making sure CI tests
with latest version.

In case mozilla#2208 lands, future compatible
version updates would touch the `Cargo.lock` file, not `Cargo.toml`.
github-merge-queue bot pushed a commit to mozilla/neqo that referenced this pull request Oct 30, 2024
Currently we use `quinn-udp` `v0.5.4`.

`quinn-udp` `v0.5.5` fixes [`recvmmsg` calls on Android x86](quinn-rs/quinn#1966).

`quinn-udp` `v0.5.6` adds [experimental multi-message support on Apple
platforms](quinn-rs/quinn#1993) and [fixes an
unnecessary `windows-sys` version
restriction](quinn-rs/quinn#2021).

While not strictly necessary, given that our current version specification (i.e.
`version = "0.5.4"`) already allows users to use Neqo with `quinn-udp` `v0.5.6`,
this commit updates to `quinn-udp` `v0.5.6` anyways, thus making sure CI tests
with latest version.

In case #2208 lands, future compatible
version updates would touch the `Cargo.lock` file, not `Cargo.toml`.
github-merge-queue bot pushed a commit to mozilla/neqo that referenced this pull request Oct 31, 2024
Currently we use `quinn-udp` `v0.5.4`.

`quinn-udp` `v0.5.5` fixes [`recvmmsg` calls on Android x86](quinn-rs/quinn#1966).

`quinn-udp` `v0.5.6` adds [experimental multi-message support on Apple
platforms](quinn-rs/quinn#1993) and [fixes an
unnecessary `windows-sys` version
restriction](quinn-rs/quinn#2021).

While not strictly necessary, given that our current version specification (i.e.
`version = "0.5.4"`) already allows users to use Neqo with `quinn-udp` `v0.5.6`,
this commit updates to `quinn-udp` `v0.5.6` anyways, thus making sure CI tests
with latest version.

In case #2208 lands, future compatible
version updates would touch the `Cargo.lock` file, not `Cargo.toml`.
github-merge-queue bot pushed a commit to mozilla/neqo that referenced this pull request Oct 31, 2024
Currently we use `quinn-udp` `v0.5.4`.

`quinn-udp` `v0.5.5` fixes [`recvmmsg` calls on Android x86](quinn-rs/quinn#1966).

`quinn-udp` `v0.5.6` adds [experimental multi-message support on Apple
platforms](quinn-rs/quinn#1993) and [fixes an
unnecessary `windows-sys` version
restriction](quinn-rs/quinn#2021).

While not strictly necessary, given that our current version specification (i.e.
`version = "0.5.4"`) already allows users to use Neqo with `quinn-udp` `v0.5.6`,
this commit updates to `quinn-udp` `v0.5.6` anyways, thus making sure CI tests
with latest version.

In case #2208 lands, future compatible
version updates would touch the `Cargo.lock` file, not `Cargo.toml`.
github-merge-queue bot pushed a commit to mozilla/neqo that referenced this pull request Oct 31, 2024
Currently we use `quinn-udp` `v0.5.4`.

`quinn-udp` `v0.5.5` fixes [`recvmmsg` calls on Android x86](quinn-rs/quinn#1966).

`quinn-udp` `v0.5.6` adds [experimental multi-message support on Apple
platforms](quinn-rs/quinn#1993) and [fixes an
unnecessary `windows-sys` version
restriction](quinn-rs/quinn#2021).

While not strictly necessary, given that our current version specification (i.e.
`version = "0.5.4"`) already allows users to use Neqo with `quinn-udp` `v0.5.6`,
this commit updates to `quinn-udp` `v0.5.6` anyways, thus making sure CI tests
with latest version.

In case #2208 lands, future compatible
version updates would touch the `Cargo.lock` file, not `Cargo.toml`.

Co-authored-by: Lars Eggert <[email protected]>
github-merge-queue bot pushed a commit to mozilla/neqo that referenced this pull request Oct 31, 2024
Currently we use `quinn-udp` `v0.5.4`.

`quinn-udp` `v0.5.5` fixes [`recvmmsg` calls on Android x86](quinn-rs/quinn#1966).

`quinn-udp` `v0.5.6` adds [experimental multi-message support on Apple
platforms](quinn-rs/quinn#1993) and [fixes an
unnecessary `windows-sys` version
restriction](quinn-rs/quinn#2021).

While not strictly necessary, given that our current version specification (i.e.
`version = "0.5.4"`) already allows users to use Neqo with `quinn-udp` `v0.5.6`,
this commit updates to `quinn-udp` `v0.5.6` anyways, thus making sure CI tests
with latest version.

In case #2208 lands, future compatible
version updates would touch the `Cargo.lock` file, not `Cargo.toml`.

Co-authored-by: Lars Eggert <[email protected]>
github-merge-queue bot pushed a commit to mozilla/neqo that referenced this pull request Nov 1, 2024
Currently we use `quinn-udp` `v0.5.4`.

`quinn-udp` `v0.5.5` fixes [`recvmmsg` calls on Android x86](quinn-rs/quinn#1966).

`quinn-udp` `v0.5.6` adds [experimental multi-message support on Apple
platforms](quinn-rs/quinn#1993) and [fixes an
unnecessary `windows-sys` version
restriction](quinn-rs/quinn#2021).

While not strictly necessary, given that our current version specification (i.e.
`version = "0.5.4"`) already allows users to use Neqo with `quinn-udp` `v0.5.6`,
this commit updates to `quinn-udp` `v0.5.6` anyways, thus making sure CI tests
with latest version.

In case #2208 lands, future compatible
version updates would touch the `Cargo.lock` file, not `Cargo.toml`.

Co-authored-by: Lars Eggert <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants