RFR: 8253702: BigSur java/lang/System/OsVersionTest.java: 10.16 != 11.0
Kevin Rushforth
kcr at openjdk.java.net
Thu Feb 11 19:15:42 UTC 2021
On Thu, 11 Feb 2021 17:14:35 GMT, Roger Riggs <rriggs at openjdk.org> wrote:
> On Mac Os X, the OSVersionTest detected a difference in the version number reported in the os.version property
> and the version number provided by `sw_vers -productVersion`.
>
> When the java runtime is built with XCode 11.3, the os.version is reported as 10.16
> though the current version numbering is 11.nnn.
>
> The workaround is to derive the os.version number from the ProductBuildVersion.
> When the toolchain is updated to XCode 12.nnn it can be removed.
> The workaround is enabled only when the environment variable SYSTEM_VERSION_COMPAT is unset.
> When the SYSTEM_VERSION_COMPAT is set in the environment the version number is reported as reported by Mac OS X.
I tested this, and get the following behavior on macOS 11.0.1 with a JDK compiled with Xcode 11.3.1 and your patch:
SYSTEM_VERSION_COMPAT not set : 11.0
SYSTEM_VERSION_COMPAT=1 : 10.16
SYSTEM_VERSION_COMPAT=0 : 11.0.1
So the fallback path reports what could be considered a more accurate version, at least on my laptop. Since I'm not sure what is expected, you can decide what to do with this information.
-------------
PR: https://git.openjdk.java.net/jdk/pull/2530
More information about the core-libs-dev
mailing list