RFR: 8303485: Replacing os.name for operating system customization

Roger Riggs rriggs at openjdk.org
Thu Mar 9 16:17:31 UTC 2023


On Thu, 9 Mar 2023 15:24:04 GMT, Erik Joelsson <erikj at openjdk.org> wrote:

>> src/java.base/share/classes/jdk/internal/misc/OperatingSystemProps.java.template line 39:
>> 
>>> 37: 
>>> 38:     // Index/ordinal of the current OperatingSystem enum as substituted by the build
>>> 39:     static final int TARGET_OS_ORDINAL = TARGET_OS_@@OPENJDK_TARGET_OS@@;
>> 
>> This represents the current OS.  What about renaming it to:
>> Suggestion:
>> 
>>     static final int CURRENT_OS_ORDINAL = @@OS_NAME@@;
>
> I would argue that we should keep the replacement string matching the make variable its getting the value from. It makes it easier to trace the origin of the value. 
> 
> Using the terms `CURRENT` or `TARGET` inside the java class is less clear. `TARGET` is a references to how the JDK was built while `CURRENT` is more of a reference to the current runtime. Both are correct, it's more about what mental model we want at this level.

The symbol has to match the build usage of OPENJDK_TARGET_OS, not the name.

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

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



More information about the build-dev mailing list