Karm / mandrel-integration-tests

Integration tests for GraalVM and its Mandrel distribution. Runs Quarkus, Helidon and Micronaut applications and small targeted reproducers. The focus is solely on native-image utility and compilation of Java applications into native executables.
Apache License 2.0
5 stars 3 forks source link

Deal with experimental VM options warnings in 23.1/24.0 #184

Closed jerboaa closed 9 months ago

jerboaa commented 10 months ago

With Mandrel 23.1 and/or GraalVM 24.0 almost all -H options get flagged like so:

org.opentest4j.AssertionFailedError: 
build-and-run.log log should not contain error or warning lines that are not whitelisted. See /disk/graal/upstream-sources/mandrel-integration-tests/testsuite/target/archived-logs/org.graalvm.tests.integration.DebugSymbolsTest/debugSymbolsSmokeGDB/build-and-run.log and check these offending lines: 
Warning: The option '-H:+PreserveFramePointer' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
Warning: The option '-H:-DeleteLocalSymbols' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
Warning: The option '-H:+TrackNodeSourcePosition' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
Warning: The option '-H:GenerateDebugInfo=1' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
Warning: The option '-H:+OmitInlinedMethodDebugLineInfo' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
Warning: The option '-H:+DebugCodeInfoUseSourceMappings' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
Warning: Please re-evaluate whether any experimental option is required, and either remove or unlock it. The build output lists all active experimental options, including where they come from and possible alternatives. If you think an experimental option should be considered as stable, please file an issue. ==> expected: <true> but was: <false>
    at org.graalvm.tests.integration.DebugSymbolsTest.debugSymbolsSmokeGDB(DebugSymbolsTest.java:190)

We need to add hooks in the test suite so as to surround them by -H:+UnlockExperimentalVMOptions and -H:-UnlockExperimentalVMOptions.

jerboaa commented 10 months ago

The above are probably a bad example as they're added by Quarkus. But the imageio tests for example have those:

2023-09-05 18:02:44.670 INFO  [o.g.t.i.u.Commands$ProcessRunner] (run) Command: [native-image, -J-Djava.awt.headless=true, -H:IncludeResources=Grace_M._Hopper.jp2,MyFreeMono.ttf,MyFreeSerif.ttf, --no-fallback, -jar, target/imageio.jar, target/imageio]
Warning: The option '-H:IncludeResources=Grace_M._Hopper.jp2,MyFreeMono.ttf,MyFreeSerif.ttf' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
Warning: Please re-evaluate whether any experimental option is required, and either remove or unlock it. The build output lists all active experimental options, including where they come from and possible alternatives. If you think an experimental option should be considered as stable, please file an issue.
========================================================================================================================
GraalVM Native Image: Generating 'imageio' (executable)...
========================================================================================================================
For detailed information and explanations on the build output, visit:
https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/BuildOutput.md
------------------------------------------------------------------------------------------------------------------------
[1/8] Initializing...                                                                                    (2.6s @ 0.18GB)
 Java version: 21-beta+34-ea, vendor version: Mandrel-24.0.0-dev5444bbd56f05
 Graal compiler: optimization level: 2, target machine: x86-64-v3
 C compiler: gcc (redhat, x86_64, 12.3.1)
 Garbage collector: Serial GC (max heap size: 80% of RAM)
 1 user-specific feature(s):
 - com.oracle.svm.thirdparty.gson.GsonFeature
------------------------------------------------------------------------------------------------------------------------
 1 experimental option(s) unlocked:
 - '-H:IncludeResources' (origin(s): command line)
------------------------------------------------------------------------------------------------------------------------
Build resources:
 - 26.49GB of memory (42.4% of 62.55GB system memory, determined at start)
 - 12 thread(s) (100.0% of 12 available processor(s), determined at start)
[2/8] Performing analysis...  [*****]                                                                   (12.1s @ 0.57GB)
    5,546 reachable types   (76.3% of    7,271 total)
    9,358 reachable fields  (55.2% of   16,949 total)
   28,203 reachable methods (50.9% of   55,385 total)
    1,727 types,    92 fields, and   951 methods registered for reflection
      128 types,   203 fields, and   117 methods registered for JNI access
        4 native libraries: dl, pthread, rt, z
[3/8] Building universe...                                                                               (2.7s @ 0.53GB)
[4/8] Parsing methods...      [*]                                                                        (1.5s @ 0.62GB)
[5/8] Inlining methods...     [***]                                                                      (1.2s @ 0.64GB)
[6/8] Compiling methods...    [****]                                                                    (12.5s @ 0.66GB)
[7/8] Layouting methods...    [**]                                                                       (2.6s @ 0.55GB)
[8/8] Creating image...       [**]                                                                       (2.8s @ 0.67GB)
  13.47MB (47.16%) for code area:    17,206 compilation units
  14.75MB (51.64%) for image heap:  160,042 objects and 55 resources
 350.48kB ( 1.20%) for other data
  28.56MB in total
------------------------------------------------------------------------------------------------------------------------
Top 10 origins of code area:                                Top 10 object types in image heap:
   6.02MB java.base                                            3.90MB byte[] for code metadata
   5.76MB java.desktop                                         2.13MB byte[] for java.lang.String
   1.08MB svm.jar (Native Image)                               1.60MB java.lang.String
 119.52kB java.logging                                         1.42MB byte[] for embedded resources
  65.00kB org.graalvm.nativeimage.base                         1.27MB java.lang.Class
  53.50kB jdk.crypto.ec                                      476.61kB com.oracle.svm.core.hub.DynamicHubCompanion
  50.47kB java.datatransfer                                  368.82kB heap alignment
  50.02kB imageio.jar                                        316.85kB java.lang.String[]
  47.59kB jdk.proxy1                                         299.13kB byte[] for general heap data
  45.84kB jdk.proxy3                                         291.63kB java.lang.Object[]
  72.37kB for 6 more packages                                  2.72MB for 1151 more object types
------------------------------------------------------------------------------------------------------------------------
Recommendations:
 HEAP: Set max heap for improved and more predictable memory usage.
 CPU:  Enable more CPU features with '-march=native' for improved performance.
------------------------------------------------------------------------------------------------------------------------
                        2.5s (6.3% of total time) in 339 GCs | Peak RSS: 1.17GB | CPU load: 9.11
------------------------------------------------------------------------------------------------------------------------
Produced artifacts:
 /disk/graal/upstream-sources/mandrel-integration-tests/apps/imageio/target/imageio (executable)
 /disk/graal/upstream-sources/mandrel-integration-tests/apps/imageio/target/libawt.so (jdk_library)
 /disk/graal/upstream-sources/mandrel-integration-tests/apps/imageio/target/libawt_headless.so (jdk_library)
 /disk/graal/upstream-sources/mandrel-integration-tests/apps/imageio/target/libawt_xawt.so (jdk_library)
 /disk/graal/upstream-sources/mandrel-integration-tests/apps/imageio/target/libfontmanager.so (jdk_library)
 /disk/graal/upstream-sources/mandrel-integration-tests/apps/imageio/target/libjava.so (jdk_library_shim)
 /disk/graal/upstream-sources/mandrel-integration-tests/apps/imageio/target/libjavajpeg.so (jdk_library)
 /disk/graal/upstream-sources/mandrel-integration-tests/apps/imageio/target/libjvm.so (jdk_library_shim)
 /disk/graal/upstream-sources/mandrel-integration-tests/apps/imageio/target/liblcms.so (jdk_library)
========================================================================================================================
Finished generating 'imageio' in 38.7s.
zakkak commented 10 months ago

The above are probably a bad example as they're added by Quarkus.

For reference the Quarkus PR for handling this is https://github.com/quarkusio/quarkus/pull/35379

jerboaa commented 10 months ago

I've filed an issue to consider the include resources options as stable: https://github.com/oracle/graal/issues/7354

jerboaa commented 10 months ago

The above are probably a bad example as they're added by Quarkus.

For reference the Quarkus PR for handling this is quarkusio/quarkus#35379

Doesn't seem the full story. See https://github.com/quarkusio/quarkus/issues/35788

zakkak commented 10 months ago

Doesn't seem the full story. See quarkusio/quarkus#35788

Good catch. I created a complementary PR for the rest of the options https://github.com/quarkusio/quarkus/pull/35772

jerboaa commented 10 months ago

I'm splitting all those failures out into individual issues so we can have a more accurate historical view.

Filed:

jerboaa commented 9 months ago

Closing this one as I think all experimental VM options are now either ignored or properly dealt with. See https://github.com/Karm/mandrel-integration-tests/issues/184#issuecomment-1710109728 for all individual issues that got fixed.