Skip to content

Conversation

@hanna-kruppe
Copy link

@hanna-kruppe hanna-kruppe commented Nov 9, 2025

Tokio and mio already updated to windows-sys 0.61, so socket2 requiring 0.60 makes it hard to avoid multiple copies of windows-sys. In addition, 0.61 finally drops the dependency on large pre-built import libraries (from windows-targets) in favor of Rust's raw-dylib feature.

Since no code changes are needed, I relaxed the version requirement (still allowing 0.60) to avoid increasing socket2's MSRV.

Tokio and mio already updated to windows-sys 0.61, so socket2 requiring
0.60 makes it hard to avoid multiple copies of windows-sys.

Since no code changes are needed, I relaxed the version requirement
(still allowing 0.60) to avoid increasing socket2's MSRV.
@hanna-kruppe
Copy link
Author

FWIW, the MSRV bump would be 1.70 -> 1.71. It seems that CI doesn't exercise the windows + Rust 1.70 combination, but it would give this error:

error: package `windows-link v0.2.1` cannot be built because it requires rustc 1.71 or newer, while the currently active rustc version is 1.70.0
Either upgrade to rustc 1.71 or newer, or use
cargo update -p [email protected] --precise ver
where `ver` is the latest version of `windows-link` supporting rustc 1.70.0

which unfortunately makes the wrong suggestion, the fix is to run

cargo update windows-sys --precise 0.60.2

@Thomasdezeeuw
Copy link
Collaborator

We're not going to increase the MSRV in v0.6. I also don't see a new (v0.7/v1) release in the near future as we just released v0.6 and I don't want to create churn for windows-sys.

We though we finally fixed all the windows-sys related churn, but not yet :(

@hanna-kruppe
Copy link
Author

hanna-kruppe commented Nov 14, 2025

This PR doesn't increase MSRV, though. It would make it more annoying to use socket2 on Rust 1.70, since cargo's MSRV-aware resolver doesn't always generate a lockfile that works, but using 1.70 would remain entirely possible.

@hanna-kruppe
Copy link
Author

hanna-kruppe commented Nov 14, 2025

FWIW, many other popular crates with MSRV < 1.71 also depend on windows-sys with multi-version ranges that allow but don't require windows-sys 0.61. Among the top 20 reverse dependencies:

crate MSRV windows-sys range
rustix 1.63 0.52 -- 0.61
tempfile 1.63 0.52 -- 0.61
errno 1.56 0.52 -- 0.61
anstyle-query 1.66.0 0.60 -- 0.61
nu-ansi-term 1.62.1 0.59 -- 0.61
is-terminal 1.63.0 0.52 -- 0.61

(disclaimer: the anstyle-query version range was merged and released just yesterday, on my request)

So what this PR is proposing is a common practice, and anyone who needs MSRV <= 1.70 for Windows builds is probably already used to dealing with the cargo update --precise dance.

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.

2 participants