fix(uv-platform): adjust windows ostype to match sys-info-rs, fix windows version#18383
Merged
zanieb merged 1 commit intoastral-sh:mainfrom Mar 9, 2026
Merged
Conversation
3ca8f7b to
5a5c9d5
Compare
zanieb
reviewed
Mar 9, 2026
5361207 to
95393e8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
In #18324, sys-info-rs was dropped in favor of a more native reimplementation to provide OsType and OsRelease.
This PR adjusts two areas for windows to match closely previous behavior:
Windowsrather thanWindows_NTDrop thesys-infodependency #18324 (comment) as seen in https://github.com/FillZpp/sys-info-rs/blob/60ecf1470a5b7c90242f429934a3bacb6023ec4d/c/windows.c#L12. This also matches the output ofplatform.system()in CPython.GetVersionExin sys-info-rs. Looking closely, this was used primarily incrates/uv-python/src/interpreter.rsand not in linehaul as linehaul usesplatform.release(). The problem withGetVersionExis that it returns often the wrong version due to legacy reasons (e.g. may be stuck returning6.2.9200). The current implementation only returns the build number from the registry which is prone to problems across windows older variants. The implementation should useRtlGetVersionsystem call which returns the current major, minor, build in the same way as reported bysys.getwindowsversion()in CPython. In order to strike balance, this switches the implementation to use four octects{major}.{minor}.{build}.{revision}as recent windows versioning relies on major, build and revision where as older versions rely on major, minor and service pack. A windows-version crate by the same author as windows-rs was added as it includes the correct system calls for the windows versions.Test Plan
Tested manually on both Windows desktop (10, 11) and Windows Server (2016).