You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Change Environment.OSVersion to return actual OS version on macOS #34977
Similar to #33643, but for macOS (or OSX). We are now returning an understandable version for Windows 10 (ex. 10.0.18363.0), we should start returning understandable versions for macOS.
I don' know (or recall) why mono returns the Darwin kernel version number (and did not know this was the same for dotnet).
It is not very user/developer friendly. However the runtime code is identical for macOS, iOS, tvOS and watchOS. If we break this to return the macOS version (like 10.15.4.0) then a different implementation will be needed for iOS, tvOS and watchOS runtimes
Shining:FunctionalTests furt$ sysctl -a| grep -e release -e version
kern.osrelease: 19.3.0
kern.version: Darwin Kernel Version 19.3.0: Thu Jan 9 20:58:23 PST 2020; root:xnu-6153.81.5~1/RELEASE_X86_64
kern.posix1version: 200112
kern.osversion: 19D76
kern.osproductversion: 10.15.3
kern.iossupportversion: 13.0
In this case, osversion seems completely bogus so we picked up osrelease.
Do you know @spouliot what we return for various *OS flavors? It would be also nice to return user visible string like 13.3.1 and not underlying kernel.
With the proposal #33331, it is going to be super inconsistent if Environment.OSVersion.Version is returning 19.4.0.0, but RuntimeInformation is returning false for IsOSPlatformOrLater(OSPlatform.iOS, 13, 5).
I think it's better (and a good time) to fix this inconsistency :)
But TBH this situation has existed since forever and rarely comes up in issues (I can't recall any for iOS/macOS SDK). I think the existing API (similar to the proposed ones) makes it easy to check for features/API that (almost) no one ever used Environment.OSVersion on the mobile SDK.
Note that this issue isn't just about mobile. In the dotnet/sdk we have to work around this issue in order to return the actual OS version when running dotnet --info. It would be super confusing to users to report that they are running on OS Version 19.4.0.0.
Activity
spouliot commentedon Apr 15, 2020
I don' know (or recall) why mono returns the Darwin kernel version number (and did not know this was the same for dotnet).
It is not very user/developer friendly. However the runtime code is identical for macOS, iOS, tvOS and watchOS. If we break this to return the macOS version (like
10.15.4.0) then a different implementation will be needed for iOS, tvOS and watchOS runtimeswfurt commentedon Apr 16, 2020
My guess we tried to match Apple's terminoplogy:
In this case,
osversionseems completely bogus so we picked uposrelease.Do you know @spouliot what we return for various
*OSflavors? It would be also nice to return user visible string like 13.3.1 and not underlying kernel.spouliot commentedon Apr 16, 2020
@wfurt
19.4.0.0(the kernel version) comes out of my iOS phone - which is what I expected since it's the same (Darwin-based) code from mono.The SDK themselves do offer other API to get and compare the "marketing" versions.
eerhardt commentedon Apr 16, 2020
With the proposal #33331, it is going to be super inconsistent if
Environment.OSVersion.Versionis returning19.4.0.0, butRuntimeInformationis returningfalseforIsOSPlatformOrLater(OSPlatform.iOS, 13, 5).spouliot commentedon Apr 24, 2020
I think it's better (and a good time) to fix this inconsistency :)
But TBH this situation has existed since forever and rarely comes up in issues (I can't recall any for iOS/macOS SDK). I think the existing API (similar to the proposed ones) makes it easy to check for features/API that (almost) no one ever used
Environment.OSVersionon the mobile SDK.eerhardt commentedon Apr 24, 2020
Note that this issue isn't just about mobile. In the dotnet/sdk we have to work around this issue in order to return the actual OS version when running
dotnet --info. It would be super confusing to users to report that they are running on OS Version19.4.0.0.See
https://github.com/dotnet/sdk/blob/ac704f6190eb2a10c768f188ac57fc139b7e0aac/src/Cli/Microsoft.DotNet.Cli.Utils/RuntimeEnvironment.cs#L68-L86
Return the correct OSVersion on OSX like systems. (#36029)
Fix macOS version test, now that dotnet/runtime#34977 is fixed.
[master] Update dependencies from dotnet/runtime (#11588)
Use Environment.OSVersion on Windows and macOS. (#11636)