rabbitmq / rabbitmq/rabbitmq-java-client

Warning when native building with GraalVM for JDK 21

Open
#1,421 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
1.3k
Forks
587
Avg merge
7h 29m
Merged PRs (30d)
41

Description

Describe the bug

-H:±UnlockExperimentalVMOptions was introduced in GraalVM for JDK 21 (see https://github.com/oracle/graal/issues/7105).

When building an app natively, the following warning appears:

Warning: The option '-H:IncludeResources=rabbitmq-amqp-client.properties|version.properties' 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.

This warning comes from:

https://github.com/rabbitmq/rabbitmq-java-client/blob/b4e86c7563fb814dea4612e3a44104e499f7e4b2/src/main/resources/META-INF/native-image/com.rabbitmq/amqp-client/native-image.properties#L1

Reproduction steps
  1. Compile an app with GraalVM and JDK 21 (or later)
    ...
Expected behavior

Compilation without the warning

Additional context

The warning is usually solved by wrapping the mention arg (or removing the need of it). Something like:

-H:+UnlockExperimentalVMOptions -H:IncludeResources=rabbitmq-amqp-client.properties|version.properties -H:-UnlockExperimentalVMOptions

However, I'm unsure regarding the behavior of it on lower JDK versions

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/main/resources/META-INF/native-image/com.rabbitmq/amqp-client/native-image.properties at the referenced line and review the native-image.properties option used for resource inclusion. Check the proposed unlock behavior on GraalVM with JDK 21 and lower JDK versions. Done means native compilation completes without the experimental-option warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.