RFR: 8366369: Add @requires linux for GTK L&F tests

Sergey Bylokhov serb at openjdk.org
Tue Sep 2 16:47:50 UTC 2025


On Mon, 1 Sep 2025 13:55:39 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

>>>The purpose of this PR is to avoid running GTK L&F specific tests on the platforms where GTK L&F isn't available.
>> 
>> But why not try loading it? That would help verify that the validation for missing dependencies works correctly.
>> I think the patch is based on assumptions that are not necessarily true:
>>  - GTK L&F cannot be supported on platforms other than Linux
>>  - headful systems always have the GTK library installed
>
>> > The purpose of this PR is to avoid running GTK L&F specific tests on the platforms where GTK L&F isn't available.
>> 
>> But why not try loading it? That would help verify that the validation for missing dependencies works correctly. I think the patch is based on assumptions that are not necessarily true:
> 
> Both assumptions are true:
> 
>> * GTK L&F cannot be supported on platforms other than Linux
> 
> If I run the test on Windows or on macOS, I get ` java.lang.ClassNotFoundException: com.sun.java.swing.plaf.gtk.GTKLookAndFeel`.
> 
> GTK L&F may be supported on other platforms but *it is not*.
> 
>> * headful systems always have the GTK library installed
> 
> Since GNOME is the only desktop environment officially supported, there's no way GTK library isn't installed on a correctly configured headful host. If GTK library isn't available, it needs installing.
> 
> This is why I think these tests have to fail if `GTKLookAndFeel` can't be loaded rather than silently ignore the failure… even on Linux hosts.
> 
> Thus, I'm standing with my intent: I see no point in even trying to start a GTK L&F test on platforms other than Linux.
> 
> I did run the updated tests on CI, and the tests pass.

> > * GTK L&F cannot be supported on platforms other than Linux
> 
> If I run the test on Windows or on macOS, I get ` java.lang.ClassNotFoundException: com.sun.java.swing.plaf.gtk.GTKLookAndFeel`.
> 
> GTK L&F may be supported on other platforms but _it is not_.

What's the point of testing on Windows and macOS? For the question above, it should be tested on Unix-like systems such as SAP or BSD.

> > * headful systems always have the GTK library installed
> 
> Since GNOME is the only desktop environment officially supported, there's no way GTK library isn't installed on a correctly configured headful host. If GTK library isn't available, it needs installing.

Supported by the OpenJDK? That’s definitely not true. It is supported and certified on various systems, many of which do not include GTK. This is one of the reasons why failing to load the GTK library is not considered fatal.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26995#discussion_r2316642289


More information about the client-libs-dev mailing list