Re: RFR: 8253702: BigSur java/lang/System/OsVersionTest.java: 10.16 != 11.0 [v2]

2021-02-11 Thread Roger Riggs
On Thu, 11 Feb 2021 19:09:52 GMT, Kevin Rushforth  wrote:

>> src/java.base/macosx/native/libjava/java_props_macosx.c line 262:
>> 
>>> 260: // Copy out the char*
>>> 261: osVersionCStr = strdup([nsVerStr UTF8String]);
>>> 262: } else if (getenv("SYSTEM_VERSION_COMPAT") == NULL) {
>> 
>> If version is 10.16 and `SYSTEM_VERSION_COMPAT` is set, you will fall 
>> through to the pre-10.9 Mac OS code fallback. Just checking to see if that's 
>> what you intended.
>
> FWIW, it seems to work OK using the legacy fallback path (reports 10.16 if I 
> set `SYSTEM_VERSION_COMPAT=1`).

The same version string is available from both APIs, reading from the 
SystemVersion.plist is a bit slower.
It would be clearer to move the checking of SYSTEM_VERSION_COMPAT to the first 
test (line:252)
so the version info does not need to be read from the files.

-

PR: https://git.openjdk.java.net/jdk/pull/2530


Re: RFR: 8253702: BigSur java/lang/System/OsVersionTest.java: 10.16 != 11.0 [v2]

2021-02-11 Thread Kevin Rushforth
On Thu, 11 Feb 2021 18:53:08 GMT, Kevin Rushforth  wrote:

>> Roger Riggs has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Correct double-negative in 'other than 10.16'
>
> src/java.base/macosx/native/libjava/java_props_macosx.c line 262:
> 
>> 260: // Copy out the char*
>> 261: osVersionCStr = strdup([nsVerStr UTF8String]);
>> 262: } else if (getenv("SYSTEM_VERSION_COMPAT") == NULL) {
> 
> If version is 10.16 and `SYSTEM_VERSION_COMPAT` is set, you will fall through 
> to the pre-10.9 Mac OS code fallback. Just checking to see if that's what you 
> intended.

FWIW, it seems to work OK using the legacy fallback path (reports 10.16 if I 
set `SYSTEM_VERSION_COMPAT=1`).

-

PR: https://git.openjdk.java.net/jdk/pull/2530


Re: RFR: 8253702: BigSur java/lang/System/OsVersionTest.java: 10.16 != 11.0 [v2]

2021-02-11 Thread Kevin Rushforth
On Thu, 11 Feb 2021 18:34:54 GMT, Roger Riggs  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.
>
> Roger Riggs has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Correct double-negative in 'other than 10.16'

src/java.base/macosx/native/libjava/java_props_macosx.c line 262:

> 260: // Copy out the char*
> 261: osVersionCStr = strdup([nsVerStr UTF8String]);
> 262: } else if (getenv("SYSTEM_VERSION_COMPAT") == NULL) {

If version is 10.16 and `SYSTEM_VERSION_COMPAT` is set, you will fall through 
to the pre-10.9 Mac OS code fallback. Just checking to see if that's what you 
intended.

-

PR: https://git.openjdk.java.net/jdk/pull/2530


Re: RFR: 8253702: BigSur java/lang/System/OsVersionTest.java: 10.16 != 11.0 [v2]

2021-02-11 Thread Roger Riggs
> 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.

Roger Riggs has updated the pull request incrementally with one additional 
commit since the last revision:

  Correct double-negative in 'other than 10.16'

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/2530/files
  - new: https://git.openjdk.java.net/jdk/pull/2530/files/7ac2b6a6..c7b05857

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk=2530=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk=2530=00-01

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2530.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2530/head:pull/2530

PR: https://git.openjdk.java.net/jdk/pull/2530