Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run CI with GraalVM #2476

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Run CI with GraalVM #2476

wants to merge 9 commits into from

Conversation

stevenschlansker
Copy link
Member

No description provided.


- name: build
env:
MAVEN_CONFIG: "-Dbasepom.check.skip-enforcer=false -B"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the ci.yml has -B -fae

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I left this out intentionally, it is easier to track down errors when they are always at the end of the build log

@stevenschlansker stevenschlansker force-pushed the graalvm-ci branch 3 times, most recently from 1e5fc6a to c326930 Compare August 24, 2023 02:31
@sonarcloud
Copy link

sonarcloud bot commented Aug 24, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication


<profile>
<id>native</id>
<activation>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all of the modules where this needs to be activated are packaging jars. can't we just use

<property>
        <name>packaging</name>
        <value>!pom</value>
</property>

and avoid more dotfiles?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this actually does not work because maven only supports a single property for activation. sigh. maven is terrible.

</file>
</activation>
<build>
<pluginManagement>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should move outside the profile, into the pluginManagement section above.

<configuration>
<!-- ... -->
</configuration>
<executions>
Copy link
Contributor

@hgschmie hgschmie Aug 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

those should stay here, move into the <plugin> below.

@hgschmie
Copy link
Contributor

hgschmie commented Sep 1, 2023

Have you actually gotten this to work? I get

Failures (1):
  JUnit Jupiter
    => java.lang.NoSuchMethodError: java.lang.invoke.MethodHandle.close()
       org.junit.jupiter.engine.descriptor.AbstractExtensionContext.<clinit>(AbstractExtensionContext.java:43)
       java.base@17.0.6/java.lang.Class.ensureInitialized(DynamicHub.java:528)

@stevenschlansker
Copy link
Member Author

No, I got stuck there for now. I will take another look at some point.

@Eng-Fouad
Copy link
Contributor

Any progress on this? Thanks.

@stevenschlansker
Copy link
Member Author

Hi @Eng-Fouad , sorry I did not look any more yet. I did try the suggested junit configuration tweaks but still ran into the NoSuchMethodError above, and didn't really have the tools to understand what went wrong.
I will take a look again at some point but cannot promise urgency. Please feel free to take the current work and experiment and see if you can make it work.

We will get this working eventually.

@stevenschlansker
Copy link
Member Author

I rebased the branch and adopted the latest version of the native plugin. Let's see how the build does.

@stevenschlansker
Copy link
Member Author

Ok, the good news is the newer Graal and plugin versions seem to make development a lot easier.

@stevenschlansker
Copy link
Member Author

Now I am stuck on getting Mockito to work.

  JUnit Jupiter:TestArgumentsRegistry:testWaffleLong()
    MethodSource [className = 'org.jdbi.v3.core.argument.TestArgumentsRegistry', methodName = 'testWaffleLong', methodParameterTypes = '']
    => org.graalvm.nativeimage.MissingReflectionRegistrationError: The program tried to reflectively access the proxy class inheriting [org.mockito.plugins.MockMaker] without it being registered for runtime reflection. Add [org.mockito.plugins.MockMaker] to the dynamic-proxy metadata to solve this problem. Note: The order of interfaces used to create proxies matters. See https://www.graalvm.org/latest/reference-manual/native-image/metadata/#dynamic-proxy for help.
       org.graalvm.nativeimage.builder/com.oracle.svm.core.reflect.MissingReflectionRegistrationUtils.forProxy(MissingReflectionRegistrationUtils.java:89)
       org.graalvm.nativeimage.builder/com.oracle.svm.core.reflect.proxy.DynamicProxySupport.getProxyClass(DynamicProxySupport.java:176)
       java.base@21.0.1/java.lang.reflect.Proxy.getProxyConstructor(Proxy.java:47)
       java.base@21.0.1/java.lang.reflect.Proxy.newProxyInstance(Proxy.java:1034)
       org.mockito.internal.configuration.plugins.PluginLoader.loadPlugin(PluginLoader.java:77)
       [...]
       Suppressed: java.lang.NullPointerException
         org.mockito.junit.jupiter.MockitoExtension.afterEach(MockitoExtension.java:190)
         [...]

I thought the metadata repository would take care of making Mockito work:

[INFO] Downloaded GraalVM reachability metadata repository from file:/home/steven/.m2/repository/org/graalvm/buildtools/graalvm-reachability-metadata/0.9.28/graalvm-reachability-metadata-0.9.28-repository.zip
[INFO] [graalvm reachability metadata repository for org.mockito:mockito-core:5.7.0]: Configuration directory not found. Trying latest version.
[INFO] [graalvm reachability metadata repository for org.mockito:mockito-core:5.7.0]: Configuration directory is org.mockito/mockito-core/4.8.1

@Eng-Fouad
Copy link
Contributor

Now I am stuck on getting Mockito to work.

  JUnit Jupiter:TestArgumentsRegistry:testWaffleLong()
    MethodSource [className = 'org.jdbi.v3.core.argument.TestArgumentsRegistry', methodName = 'testWaffleLong', methodParameterTypes = '']
    => org.graalvm.nativeimage.MissingReflectionRegistrationError: The program tried to reflectively access the proxy class inheriting [org.mockito.plugins.MockMaker] without it being registered for runtime reflection. Add [org.mockito.plugins.MockMaker] to the dynamic-proxy metadata to solve this problem. Note: The order of interfaces used to create proxies matters. See https://www.graalvm.org/latest/reference-manual/native-image/metadata/#dynamic-proxy for help.
       org.graalvm.nativeimage.builder/com.oracle.svm.core.reflect.MissingReflectionRegistrationUtils.forProxy(MissingReflectionRegistrationUtils.java:89)
       org.graalvm.nativeimage.builder/com.oracle.svm.core.reflect.proxy.DynamicProxySupport.getProxyClass(DynamicProxySupport.java:176)
       java.base@21.0.1/java.lang.reflect.Proxy.getProxyConstructor(Proxy.java:47)
       java.base@21.0.1/java.lang.reflect.Proxy.newProxyInstance(Proxy.java:1034)
       org.mockito.internal.configuration.plugins.PluginLoader.loadPlugin(PluginLoader.java:77)
       [...]
       Suppressed: java.lang.NullPointerException
         org.mockito.junit.jupiter.MockitoExtension.afterEach(MockitoExtension.java:190)
         [...]

I thought the metadata repository would take care of making Mockito work:

[INFO] Downloaded GraalVM reachability metadata repository from file:/home/steven/.m2/repository/org/graalvm/buildtools/graalvm-reachability-metadata/0.9.28/graalvm-reachability-metadata-0.9.28-repository.zip
[INFO] [graalvm reachability metadata repository for org.mockito:mockito-core:5.7.0]: Configuration directory not found. Trying latest version.
[INFO] [graalvm reachability metadata repository for org.mockito:mockito-core:5.7.0]: Configuration directory is org.mockito/mockito-core/4.8.1

It looks Metadata for Mockito does not include proxy-config.json. Try to add it manually:

proxy-config.json:

[{"interfaces":["org.mockito.plugins.MockMaker"]}]

Then use either -H:DynamicProxyConfigurationFiles=proxy-config.json or -H:DynamicProxyConfigurationResources=proxy-config.json.

@stevenschlansker
Copy link
Member Author

So, by enabling the agent experimental predefined classes, the proxy starts working.
However then I run into:

========================================================================================================================
GraalVM Native Image: Generating 'native-tests' (executable)...
========================================================================================================================
[1/8] Initializing...
                                                                                    (0.0s @ 0.14GB)
Error: More than one predefined class with the same name provided: org.mockito.codegen.Connection$MockitoMock$a3lier1op99200N

@stevenschlansker
Copy link
Member Author

I filed: mockito/mockito#3183

@stevenschlansker
Copy link
Member Author

Some minor progress here - by reducing Mockito usage to only interfaces, and disabling codegen and using Proxy mocks instead, the "more than one class" problem goes away and instead I get some test failures instead. Still more digging needed though.

@stevenschlansker
Copy link
Member Author

stevenschlansker commented Jan 11, 2024

We now removed all uses of the bytebuddy agent and Mockito only runs with pure JVM proxies in mainline. Rebased on top of that, running the build again...

@stevenschlansker
Copy link
Member Author

Failures (3):
  JUnit Jupiter:ConstructorMapperTest:allColumnsOfNullableNestedObjectAbsent()
    MethodSource [className = 'org.jdbi.v3.core.mapper.reflect.ConstructorMapperTest', methodName = 'allColumnsOfNullableNestedObjectAbsent', methodParameterTypes = '']
    => java.lang.IllegalArgumentException: Instance factory 'org.jdbi.v3.core.mapper.reflect.ConstructorMapperTest$NullableNestedBean(java.lang.String,org.jdbi.v3.core.mapper.reflect.ConstructorMapperTest$NullableParameterBean)' parameter '[nested]' has no matching columns in the result set. Verify that the Java compiler is configured to emit parameter names, that your result set has the columns expected, annotate the parameter names explicitly with @ColumnName, or annotate nullable parameters as @Nullable
       org.jdbi.v3.core.mapper.reflect.ConstructorMapper.createSpecializedRowMapper(ConstructorMapper.java:268)
       org.jdbi.v3.core.mapper.reflect.ConstructorMapper.specialize(ConstructorMapper.java:189)
       org.jdbi.v3.core.result.internal.ResultSetResultIterator.<init>(ResultSetResultIterator.java:54)
       org.jdbi.v3.core.result.internal.ResultSetResultIterable.iterator(ResultSetResultIterable.java:51)
       org.jdbi.v3.core.result.ResultIterable.one(ResultIterable.java:171)
       org.jdbi.v3.core.mapper.reflect.ConstructorMapperTest.selectOne(ConstructorMapperTest.java:56)
       org.jdbi.v3.core.mapper.reflect.ConstructorMapperTest.allColumnsOfNullableNestedObjectAbsent(ConstructorMapperTest.java:241)
       java.base@21.0.1/java.lang.reflect.Method.invoke(Method.java:580)
       java.base@21.0.1/java.util.ArrayList.forEach(ArrayList.java:1596)
       java.base@21.0.1/java.util.ArrayList.forEach(ArrayList.java:1596)
  JUnit Jupiter:ConstructorMapperTest:testNullableParameterAbsent()
    MethodSource [className = 'org.jdbi.v3.core.mapper.reflect.ConstructorMapperTest', methodName = 'testNullableParameterAbsent', methodParameterTypes = '']
    => java.lang.IllegalArgumentException: Instance factory 'org.jdbi.v3.core.mapper.reflect.ConstructorMapperTest$NullableParameterBean(java.lang.String,int)' parameter '[s]' has no matching columns in the result set. Verify that the Java compiler is configured to emit parameter names, that your result set has the columns expected, annotate the parameter names explicitly with @ColumnName, or annotate nullable parameters as @Nullable
       org.jdbi.v3.core.mapper.reflect.ConstructorMapper.createSpecializedRowMapper(ConstructorMapper.java:268)
       org.jdbi.v3.core.mapper.reflect.ConstructorMapper.specialize(ConstructorMapper.java:189)
       org.jdbi.v3.core.result.internal.ResultSetResultIterator.<init>(ResultSetResultIterator.java:54)
       org.jdbi.v3.core.result.internal.ResultSetResultIterable.iterator(ResultSetResultIterable.java:51)
       org.jdbi.v3.core.result.ResultIterable.one(ResultIterable.java:171)
       org.jdbi.v3.core.mapper.reflect.ConstructorMapperTest.selectOne(ConstructorMapperTest.java:56)
       org.jdbi.v3.core.mapper.reflect.ConstructorMapperTest.testNullableParameterAbsent(ConstructorMapperTest.java:121)
       java.base@21.0.1/java.lang.reflect.Method.invoke(Method.java:580)
       java.base@21.0.1/java.util.ArrayList.forEach(ArrayList.java:1596)
       java.base@21.0.1/java.util.ArrayList.forEach(ArrayList.java:1596)
  JUnit Jupiter:ConstructorMapperTest:nullableNestedNullableParameterAbsent()
    MethodSource [className = 'org.jdbi.v3.core.mapper.reflect.ConstructorMapperTest', methodName = 'nullableNestedNullableParameterAbsent', methodParameterTypes = '']
    => java.lang.IllegalArgumentException: Instance factory 'org.jdbi.v3.core.mapper.reflect.ConstructorMapperTest$NullableParameterBean(java.lang.String,int)' parameter '[s]' has no matching columns in the result set. Verify that the Java compiler is configured to emit parameter names, that your result set has the columns expected, annotate the parameter names explicitly with @ColumnName, or annotate nullable parameters as @Nullable
       org.jdbi.v3.core.mapper.reflect.ConstructorMapper.createSpecializedRowMapper(ConstructorMapper.java:268)
       org.jdbi.v3.core.mapper.reflect.ConstructorMapper.createSpecializedRowMapper(ConstructorMapper.java:247)
       org.jdbi.v3.core.mapper.reflect.ConstructorMapper.specialize(ConstructorMapper.java:189)
       org.jdbi.v3.core.result.internal.ResultSetResultIterator.<init>(ResultSetResultIterator.java:54)
       org.jdbi.v3.core.result.internal.ResultSetResultIterable.iterator(ResultSetResultIterable.java:51)
       org.jdbi.v3.core.result.ResultIterable.one(ResultIterable.java:171)
       org.jdbi.v3.core.mapper.reflect.ConstructorMapperTest.selectOne(ConstructorMapperTest.java:56)
       org.jdbi.v3.core.mapper.reflect.ConstructorMapperTest.nullableNestedNullableParameterAbsent(ConstructorMapperTest.java:232)
       java.base@21.0.1/java.lang.reflect.Method.invoke(Method.java:580)
       java.base@21.0.1/java.util.ArrayList.forEach(ArrayList.java:1596)
       [...]

I guess some reflection metadata is being lost, despite using the agent.

@Eng-Fouad
Copy link
Contributor

Eng-Fouad commented Jan 11, 2024

Failures (3):
  JUnit Jupiter:ConstructorMapperTest:allColumnsOfNullableNestedObjectAbsent()
    MethodSource [className = 'org.jdbi.v3.core.mapper.reflect.ConstructorMapperTest', methodName = 'allColumnsOfNullableNestedObjectAbsent', methodParameterTypes = '']
    => java.lang.IllegalArgumentException: Instance factory 'org.jdbi.v3.core.mapper.reflect.ConstructorMapperTest$NullableNestedBean(java.lang.String,org.jdbi.v3.core.mapper.reflect.ConstructorMapperTest$NullableParameterBean)' parameter '[nested]' has no matching columns in the result set. Verify that the Java compiler is configured to emit parameter names, that your result set has the columns expected, annotate the parameter names explicitly with @ColumnName, or annotate nullable parameters as @Nullable
       org.jdbi.v3.core.mapper.reflect.ConstructorMapper.createSpecializedRowMapper(ConstructorMapper.java:268)
       org.jdbi.v3.core.mapper.reflect.ConstructorMapper.specialize(ConstructorMapper.java:189)
       org.jdbi.v3.core.result.internal.ResultSetResultIterator.<init>(ResultSetResultIterator.java:54)
       org.jdbi.v3.core.result.internal.ResultSetResultIterable.iterator(ResultSetResultIterable.java:51)
       org.jdbi.v3.core.result.ResultIterable.one(ResultIterable.java:171)
       org.jdbi.v3.core.mapper.reflect.ConstructorMapperTest.selectOne(ConstructorMapperTest.java:56)
       org.jdbi.v3.core.mapper.reflect.ConstructorMapperTest.allColumnsOfNullableNestedObjectAbsent(ConstructorMapperTest.java:241)
       java.base@21.0.1/java.lang.reflect.Method.invoke(Method.java:580)
       java.base@21.0.1/java.util.ArrayList.forEach(ArrayList.java:1596)
       java.base@21.0.1/java.util.ArrayList.forEach(ArrayList.java:1596)
  JUnit Jupiter:ConstructorMapperTest:testNullableParameterAbsent()
    MethodSource [className = 'org.jdbi.v3.core.mapper.reflect.ConstructorMapperTest', methodName = 'testNullableParameterAbsent', methodParameterTypes = '']
    => java.lang.IllegalArgumentException: Instance factory 'org.jdbi.v3.core.mapper.reflect.ConstructorMapperTest$NullableParameterBean(java.lang.String,int)' parameter '[s]' has no matching columns in the result set. Verify that the Java compiler is configured to emit parameter names, that your result set has the columns expected, annotate the parameter names explicitly with @ColumnName, or annotate nullable parameters as @Nullable
       org.jdbi.v3.core.mapper.reflect.ConstructorMapper.createSpecializedRowMapper(ConstructorMapper.java:268)
       org.jdbi.v3.core.mapper.reflect.ConstructorMapper.specialize(ConstructorMapper.java:189)
       org.jdbi.v3.core.result.internal.ResultSetResultIterator.<init>(ResultSetResultIterator.java:54)
       org.jdbi.v3.core.result.internal.ResultSetResultIterable.iterator(ResultSetResultIterable.java:51)
       org.jdbi.v3.core.result.ResultIterable.one(ResultIterable.java:171)
       org.jdbi.v3.core.mapper.reflect.ConstructorMapperTest.selectOne(ConstructorMapperTest.java:56)
       org.jdbi.v3.core.mapper.reflect.ConstructorMapperTest.testNullableParameterAbsent(ConstructorMapperTest.java:121)
       java.base@21.0.1/java.lang.reflect.Method.invoke(Method.java:580)
       java.base@21.0.1/java.util.ArrayList.forEach(ArrayList.java:1596)
       java.base@21.0.1/java.util.ArrayList.forEach(ArrayList.java:1596)
  JUnit Jupiter:ConstructorMapperTest:nullableNestedNullableParameterAbsent()
    MethodSource [className = 'org.jdbi.v3.core.mapper.reflect.ConstructorMapperTest', methodName = 'nullableNestedNullableParameterAbsent', methodParameterTypes = '']
    => java.lang.IllegalArgumentException: Instance factory 'org.jdbi.v3.core.mapper.reflect.ConstructorMapperTest$NullableParameterBean(java.lang.String,int)' parameter '[s]' has no matching columns in the result set. Verify that the Java compiler is configured to emit parameter names, that your result set has the columns expected, annotate the parameter names explicitly with @ColumnName, or annotate nullable parameters as @Nullable
       org.jdbi.v3.core.mapper.reflect.ConstructorMapper.createSpecializedRowMapper(ConstructorMapper.java:268)
       org.jdbi.v3.core.mapper.reflect.ConstructorMapper.createSpecializedRowMapper(ConstructorMapper.java:247)
       org.jdbi.v3.core.mapper.reflect.ConstructorMapper.specialize(ConstructorMapper.java:189)
       org.jdbi.v3.core.result.internal.ResultSetResultIterator.<init>(ResultSetResultIterator.java:54)
       org.jdbi.v3.core.result.internal.ResultSetResultIterable.iterator(ResultSetResultIterable.java:51)
       org.jdbi.v3.core.result.ResultIterable.one(ResultIterable.java:171)
       org.jdbi.v3.core.mapper.reflect.ConstructorMapperTest.selectOne(ConstructorMapperTest.java:56)
       org.jdbi.v3.core.mapper.reflect.ConstructorMapperTest.nullableNestedNullableParameterAbsent(ConstructorMapperTest.java:232)
       java.base@21.0.1/java.lang.reflect.Method.invoke(Method.java:580)
       java.base@21.0.1/java.util.ArrayList.forEach(ArrayList.java:1596)
       [...]

I guess some reflection metadata is being lost, despite using the agent.

According to GraalVM maven plugin docs:

Executing your application with the agent is more involved and requires you to configure a separate mojo execution which allows forking the Java process.

Also:

The agent generates the native configuration files in subdirectories of target/native/agent-output. Although those files will be automatically used if you run your build with the agent enabled, you should consider reviewing the generated files and adding them to your sources instead.

So the sole purpose of the agent is to help generating the native metadata configurations (i.e. refelct-config.json, proxy-config.json, etc.) which can then be included when compiling the app to native.

How about creating the native metadata configuration files manually? See this gist. In addition to the classes mentioned in the gist, we need to include all classes (in tests) that are being constructed/accessed by reflection. For example, the following beans need to be registered in reflect-config:

.registerRowMapper(ConstructorMapper.factory(ConstructorBean.class))
.registerRowMapper(ConstructorMapper.factory(ConstructorPropertiesBean.class))
.registerRowMapper(ConstructorMapper.factory(NamedParameterBean.class))
.registerRowMapper(ConstructorMapper.factory(NullableNestedBean.class))
.registerRowMapper(ConstructorMapper.factory(NullableParameterBean.class))
.registerRowMapper(ConstructorMapper.factory(StaticFactoryMethodBean.class));

For reference, see how they maintain reflect-config.json files in Netty project: https://github.com/search?q=repo%3Anetty%2Fnetty%20reflect-config.json&type=code
For Spring project, it seems they build configuration files dynamically by code: https://github.com/spring-projects/spring-framework/blob/main/spring-core/src/main/java/org/springframework/aot/nativex/NativeConfigurationWriter.java#L80

@stevenschlansker
Copy link
Member Author

How about creating the native metadata configuration files manually?

The main reason is that it is a pain in the ass to get right, for something that a human really "shouldn't" have to write, and there are many hundreds of test cases :)
Plus, then we have to manually maintain it going forward, for every test we write that uses SqlObject.
I was hoping the agent would at least get me a starting point that ran the test code. I'll try to manually write one at some point. Hopefully what the agent comes up with is at least close :)

@stevenschlansker
Copy link
Member Author

Thanks for the reference to the Netty config - theirs is very short, so I can see how it's not too big of a deal to maintain. Ours is probably going to be much longer, because we have a ton of random types both in main and test that we access via reflection.

@Eng-Fouad
Copy link
Contributor

Thanks for the reference to the Netty config - theirs is very short, so I can see how it's not too big of a deal to maintain. Ours is probably going to be much longer, because we have a ton of random types both in main and test that we access via reflection.

Probably it is better to create/maintain configs for main sources manually, and use the agent for test sources only.

@stevenschlansker
Copy link
Member Author

Ok, I have a bit more information on the test failures. It looks like a constructor parameter for a test case @Nullable String s loses its annotation and looks like String s in native-image, which means Jdbi thinks it should be required. Not sure yet if this is something the agent missed, or if it is a deeper bug in constructor parameter annotation handling.

@stevenschlansker
Copy link
Member Author

I looked through the reflect-config.json syntax and didn't see anything about including or excluding annotations. So, I guess the agent cannot generate config around this. Therefore this is a Graal bug?

@stevenschlansker
Copy link
Member Author

Interesting, I extracted the code in question into a sample project to have a reproducer, and it works there ???

@stevenschlansker
Copy link
Member Author

Ok, so I think the problem is somehow introduced from the jdbi parent pom. When I inherit from our Jdbi build pom, the test fails. When I inline the native-image configuration and depend on basepom, skipping jdbi build configuration, the test passes.

@stevenschlansker
Copy link
Member Author

I think this is a native-image bug.
I filed graalvm/native-build-tools#562

Copy link

sonarcloud bot commented Jan 29, 2024

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

1 New issue
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@stevenschlansker
Copy link
Member Author

Ok, I added a workaround to the issue I filed above, which we cannot merge, but should get us moving forward to the next problem for now at least.

And...

Error: Classes that should be initialized at run time got initialized during image building:
 org.junit.jupiter.api.condition.JRE was unintentionally initialized at build time. To see why org.junit.jupiter.api.condition.JRE got initialized use --trace-class-initialization=org.junit.jupiter.api.condition.JRE
To see how the classes got initialized, use --trace-class-initialization=org.junit.jupiter.api.condition.JRE

🤔 I'll have to come back to this later

@Eng-Fouad
Copy link
Contributor

Ok, I added a workaround to the issue I filed above, which we cannot merge, but should get us moving forward to the next problem for now at least.

And...


Error: Classes that should be initialized at run time got initialized during image building:

 org.junit.jupiter.api.condition.JRE was unintentionally initialized at build time. To see why org.junit.jupiter.api.condition.JRE got initialized use --trace-class-initialization=org.junit.jupiter.api.condition.JRE

To see how the classes got initialized, use --trace-class-initialization=org.junit.jupiter.api.condition.JRE

🤔 I'll have to come back to this later

Is this relevant? the release notes of JUnit 5.10.0:

Building native images with GraalVM now requires configuring the build arg --initialize-at-build-time=org.junit.platform.launcher.core.LauncherConfig and --initialize-at-build-time=org.junit.jupiter.engine.config.InstantiatingConfigurationParameterConverter.

@stevenschlansker
Copy link
Member Author

It could be! I don't get why core module would work OK but testing wouldn't, but I'll give that a try next time I have a moment to look at this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants