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

[GR-58542] [Native Image] handling --version is not consistent #9771

Open
1 task
vvlevchenko opened this issue Sep 27, 2024 · 1 comment
Open
1 task

[GR-58542] [Native Image] handling --version is not consistent #9771

vvlevchenko opened this issue Sep 27, 2024 · 1 comment
Assignees

Comments

@vvlevchenko
Copy link

Describe the Issue

--version with composition with other options report errors in consistent, depending on the way additional options are provided. e.g.

~/.sdkman/candidates/java/24.ea.13-graal/bin/native-image --version -o 1.txt
Error: Option --version cannot be combined with other options.

and

NATIVE_IMAGE_OPTIONS="-o 1.txt" ~/.sdkman/candidates/java/24.ea.13-graal/bin/native-image --version
Error: Cannot specify main class in environment variable NATIVE_IMAGE_OPTIONS

Using the latest version of GraalVM can resolve many issues.

GraalVM Version

 ~/.sdkman/candidates/java/24.ea.13-graal/bin/java -version
java version "24" 2025-03-18
Java(TM) SE Runtime Environment Oracle GraalVM 24-dev+14.1 (build 24+14-jvmci-b01)
Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 24-dev+14.1 (build 24+14-jvmci-b01, mixed mode, sharing)

Operating System and Version

Darwin DE-UNIT-1497 23.6.0 Darwin Kernel Version 23.6.0: Mon Jul 29 21:13:04 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6020 arm64

Build Command

Darwin DE-UNIT-1497 23.6.0 Darwin Kernel Version 23.6.0: Mon Jul 29 21:13:04 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6020 arm64

Expected Behavior

It'd be better to ignore all options in case of --version, that let use NATIVE_IMAGE_OPTIONS with build-native-tools more freely.

Actual Behavior

~/.sdkman/candidates/java/24.ea.13-graal/bin/native-image --version -o 1.txt
Error: Option --version cannot be combined with other options.

and

NATIVE_IMAGE_OPTIONS="-o 1.txt" ~/.sdkman/candidates/java/24.ea.13-graal/bin/native-image --version
Error: Cannot specify main class in environment variable NATIVE_IMAGE_OPTIONS

Steps to Reproduce

native-image --version -o 1.txt
or
NATIVE_IMAGE_OPTIONS="-o 1.txt" native-image --version

Additional Context

No response

Build Log Output and Error Messages

No response

@selhagani
Copy link
Member

Hi @vvlevchenko,

Thank you for reaching out to us. I tested the cases you provided and I confirm the outcome you observed. We'll take a closer look into this and I'll make sure to keep you updated.

@selhagani selhagani changed the title [Native Image] handling --version is not consistent [GR-58542] [Native Image] handling --version is not consistent Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants