On Wed, 18 Jun 2025 06:01:43 GMT, Jaikiran Pai <j...@openjdk.org> wrote:

> Can I please get a review of this change which proposes to address the issue 
> noted in https://bugs.openjdk.org/browse/JDK-8359830?
> 
> macOS operating system's newer version 26 (currently in Beta) is reported as 
> a 16 by older versions of XCode. JDK internally uses the `NSProcessInfo` and 
> `NSOperatingSystemVersion` APIs to identify the macOS version and set the 
> `os.version` system property to that value. The current recommended version 
> to build the JDK on macOS is XCode 15.4. The `NSOperatingSystemVersion` API 
> on that version of XCode reports macOS version as 16 instead of 26.
> 
> The commit in this PR updates the JDK code to handle this mismatch and set 
> the `os.version` appropriately to 26. This fix is similar to what we did with 
> macOS BigSur when the macOS version 10.16 was meant to mean 11 
> https://bugs.openjdk.org/browse/JDK-8253702. 
> 
> The existing `OsVersionTest` has been updated for some trivial clean up. 
> Existing tests in tier1, tier2 and tier3 continue to pass with this change. 
> If anyone has access to a macOS 26 Beta, I request them to build this change 
> and run `tier1` tests to help verify that there aren't any failures.

Hello Alan, I've been pursuing this further and there's a way to address this 
issue in `os_bsd.cpp#get_summary_os_info()`. The ultimate place where we get 
the correct version is the `plist` files that are referenced in this PR. 
`plist` files are XML files and to be able to read those semantically, either a 
XML parser is necessary or we can use the Objective-C APIs that are provided by 
macOS in the `Foundation` framework (the same ones that we currently use in the 
`java_props_macosx.c`). I've been experimenting with using these Objective-C 
APIs in this C++ code of hotspot, but have been running into build issues. I am 
currently discussing those with people familiar with this area and plan to 
continue pursuing it further. However, in the meantime, if it's OK then I would 
like to go ahead and integrate the current state of this PR into mainline (and 
have it backported), so that it gets the necessary testing time both on macOS 
26 Beta and other versions. The few places where this misrepo
 rting of macOS version in os_bsd.cpp is going to impact is the VM error 
reporting (in hs_err files for example) and the output of the newly introduced 
`-XX:+PrintJVMInfoAtExit` option. So I think we can address this issue 
separately (I'll create a follow up issue to track that work). Do you think 
it's OK to go ahead with this integration?

-------------

PR Comment: https://git.openjdk.org/jdk/pull/25865#issuecomment-3000438286

Reply via email to