RFR: 8303485: Replacing os.name for operating system customization [v2]

Roger Riggs rriggs at openjdk.org
Mon Mar 13 14:15:17 UTC 2023


On Fri, 10 Mar 2023 21:21:56 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> Improvements to support OS specific customization for JDK internal use:
>>  - To select values and code; allowing elimination of unused code and values
>>  - Optionally evaluated by build processes, compilation, or archiving (i.e. CDS)
>>  - Simple API to replace adhoc comparisons with `os.name`
>>  - Clear and consistent use across build, runtime, and JDK modules
>>  
>> The PR includes updates within java.base to use the new API.
>
> Roger Riggs has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Move OperatingSystem from jdk.internal.misc to jdk.internal.util
>   Rename Mac -> MacOS; isMac() -> isMacOS()

A quick look at the freebsd port (jdk19) shows about 19k lines of new code or changes across 294 files, config, makefiles, hotspot and other native code. Pretty much what you'd expect in terms of api differences, configuration differences, and alternate implementations.  
The changes are done with ifdefs in native code, adding enumeration cases where necessary, and testing of os.name.
Changing to an equivalent test for operating system is a lateral move.

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

PR: https://git.openjdk.org/jdk/pull/12931



More information about the build-dev mailing list