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

native-image @argfile parse failure on Windows with the error Fatal error: Unsupported OptionOrigin #4502

Closed
imkiva opened this issue Apr 22, 2022 · 11 comments · Fixed by #4561

Comments

@imkiva
Copy link

imkiva commented Apr 22, 2022

Describe the issue

The @argfile option of native-image show Fatal error: Unsupported OptionOrigin: <the arg file>

For example, this command works (in powershell):

native-image '@args.txt'

while these do not

native-image '@.\args.txt'
native-image '@C:\Users\kiva\git\aya-dev\args.txt'

Steps to reproduce the issue

Please include both build steps as well as run steps

  1. git clone --depth 1 https://github.com/aya-prover/aya-dev.git
  2. .\gradlew nativeCompile

note: the args.txt is just copied from Gradle generated argument file, which is introduced in #3734 but I don't know whether this issue is due to native-image or the Gradle plugin, so I posted here (sorry)

Describe GraalVM and your environment:

More details

Possibly this issue was introduced in #4464

File contents of args.txt and Stack trace: https://gist.github.com/imkiva/3aa4ee72f01df4774ca5c122e9ac4ff5

@oubidar-Abderrahim
Copy link
Member

Hi, Thank you for reporting this, we will take a look into it and get back to you

@ozkanpakdil
Copy link

ozkanpakdil commented Apr 29, 2022

@olpaw
Copy link
Member

olpaw commented May 9, 2022

@michael-simons can you confirm that this issue is windows only?

@michael-simons
Copy link

michael-simons commented May 9, 2022

Yes I can as stupid me does test the build only on Linux machines https://github.com/michael-simons/neo4j-migrations/runs/6334931402?check_suite_focus=true in contrast to the binaries which I release for windows too.

Here's the concrete line @olpaw https://github.com/michael-simons/neo4j-migrations/runs/6334931402?check_suite_focus=true#step:7:83

michael-simons added a commit to michael-simons/neo4j-migrations that referenced this issue May 9, 2022
This is about addressing oracle/graal#4502
which I discovered after releasing 1.5.5.

So this commit is force-pushed onto the main branch and the 1.5.5 tag
has been recreated accordingly.
@olpaw
Copy link
Member

olpaw commented May 10, 2022

@imkiva thank you for your detailed bug report. The fix for this issue is in #4561

As you already mentioned above, one way to workaround the issue for the already released version 22.1 is to ensure that @argfile-use on Windows does not use complex Windows path strings. E.g. using

native-image @myargfile.txt

works just fine on Windows with 22.1, but to use e.g.

native-image @C:\ADE\OLabs\graal\substratevm\myargfile.txt

the changes from my PR are needed.

@imkiva
Copy link
Author

imkiva commented May 10, 2022

@olpaw Thank you for the fix!

gordonforce added a commit to gordonforce/gs-rest-service that referenced this issue May 16, 2022
…s, however, a graalvm bug prevents a successful compile. See oracle/graal#4561, and oracle/graal#4502.

Going to try with maven next.
KevinRoebert added a commit to KevinRoebert/signal-cli that referenced this issue Jun 7, 2022
Version 22.1.0 has a bug on windows. See oracle/graal#4502
KevinRoebert added a commit to KevinRoebert/signal-cli that referenced this issue Jun 7, 2022
Download libs

Change graalvm version

Version 22.1.0 has a bug on windows. See oracle/graal#4502

Bump version

Version

Disable windows build

Disable windows build until new graalvm is release

Added correct dir
KevinRoebert added a commit to KevinRoebert/signal-cli that referenced this issue Jun 7, 2022
Download libs

Change graalvm version

Version 22.1.0 has a bug on windows. See oracle/graal#4502

Bump version

Version

Disable windows build

Disable windows build until new graalvm is release

Added correct dir

.

Use fixed versions
KevinRoebert added a commit to KevinRoebert/signal-cli that referenced this issue Jun 8, 2022
Currently no Windows support. GraalVM in version 22.1.0 has a bug on windows. See oracle/graal#4502
@sysmat
Copy link

sysmat commented Jun 19, 2022

Same her:

ImageClasspath Entry: org.springframework.experimental:spring-native:jar:0.12.0:compile (file:///C:/Users/tomaz/.m2/repository/org/springframework/experimental/spring-native/0.12.0/spring-native-0.12.0.jar)
ImageClasspath Entry: com.example:si:jar:0.0.1-SNAPSHOT (file:///C:/Users/tomaz/Downloads/si/target/si-0.0.1-SNAPSHOT.jar)
jar:file:///C:/Users/tomaz/Downloads/si/target/si-0.0.1-SNAPSHOT.jar!/META-INF/native-image/org.springframework.aot/spring-aot/native-image.properties does not match recommended META-INF/native-image/${groupId}/${artifactId}/native-image.properties layout.
Downloading: Component catalog from www.graalvm.org
Processing Component: Native Image
Downloading: Component native-image: Native Image from github.com
Installing new component: Native Image (org.graalvm.native-image, version 22.1.0)
Executing: C:\Program Files\Java\graalvm-ce-java17-22.1.0\bin\native-image.cmd @C:\Users\tomaz\AppData\Local\Temp\native-image1565914727584519349args
Fatal error: Unsupported OptionOrigin: C:\Users\tomaz\AppData\Local\Temp\native-image1565914727584519349args


@martinformi
Copy link

I am following the example ./mvnw package -Dpackaging=native-image from documentation. How can I successfully test this on Windows? I am getting the same Unsupported OptionOrigin exception.

@imkiva
Copy link
Author

imkiva commented Jul 20, 2022

I am following the example ./mvnw package -Dpackaging=native-image from documentation. How can I successfully test this on Windows? I am getting the same Unsupported OptionOrigin exception.

Try the newest dev builds here: https://github.com/graalvm/graalvm-ce-dev-builds/releases

@sanshengshui
Copy link

upgrade graalvm from 22.1.0 to 22.2.0, fix the above problem! thx

ckipp01 added a commit to ckipp01/bloop that referenced this issue Dec 27, 2022
This will include a fix mentioned in
oracle/graal#4502 which weseem to be hitting
on.
ckipp01 added a commit to ckipp01/bloop that referenced this issue Dec 27, 2022
This was a bit of a rabbit hole, but I just went with it. With the
changes to sbt-ci-release, _somehow_ the graal native image generation
was failing on windows. In order to combat that this pr makes some
changes to CI and to the args we're using with Graal. I'll outline the
changes below.

- Migrate to `graalvm/setup-graalvm` for the graal jobs. This is
  necessary if we want to use the newer graal versions. When I tried
  with `setup-scala` I got jabba erros that what I was looking for
  doesn't exist. Plus `setup-scala` isn't _really_ worked on anymore, so
  migrating away is preferable. Plus, when using `setup-graalvm` it's
  easy to get things like the `native-image` command on all platforms.
- Bump to 22.3.0. I tried to just bump slightly, but there is a bug in
  22.1.0 on windows that I hit on oracle/graal#4502.
  It's fixed in the newer ones, so I just bumped up.
- Use `actions/setup-java` instead of `setup-scala` for jvm tests. Same
  reason as above with maintenance, but also built-in sbt cache. For now
  we're still doing a lot on 11 (where the graal stuff is on 17) but I'm
  trying to not change this too much for now until I get everything
  green and releasing. Then I'll address that.
- Move `publish-binaries-windows` into `publish-binaries`. Now that we
  are using `setup-graalvm` it's trivial to just keep these together,
  using `sbt` and just call it a day. No need for two separate ones.
- Remove the windows-specific `graalVMNativeImageCommand`. Again, now
  that we're using `setup-graalvm` we easily have the `native-image`
  command on the PATH so we don't need to worry about all this extra
  stuff.
- Change a few flags:
  - `--no-server` wasn't valid it seemed as we were getting a message on
    every run that it wasn't recognized and ignored.
  - `-H:EnableUrlProtocols` no just uses `--enable-url-protocols`.
    Apparently it's frowned upon to use the `-H` stuff since it's
    internal, so this was just a bit of cleaning up. We do have a couple
    others, but there doesn't seem to be alternatives so I left them as
    is.
  - `--allow-incomlete-classpath` This is the default now, so no need to
    have it.

You can see a green build for all 3 os's [here in my
fork](https://github.com/ckipp01/bloop/actions/runs/3787821939/jobs/6439973910).
But let's see how all the other jobs go.
ckipp01 added a commit to ckipp01/bloop that referenced this issue Dec 27, 2022
This was a bit of a rabbit hole, but I just went with it. With the
changes to sbt-ci-release, _somehow_ the graal native image generation
was failing on windows. In order to combat that this pr makes some
changes to CI and to the args we're using with Graal. I'll outline the
changes below.

- Migrate to `graalvm/setup-graalvm` for the graal jobs. This is
  necessary if we want to use the newer graal versions. When I tried
  with `setup-scala` I got jabba erros that what I was looking for
  doesn't exist. Plus `setup-scala` isn't _really_ worked on anymore, so
  migrating away is preferable. Plus, when using `setup-graalvm` it's
  easy to get things like the `native-image` command on all platforms.
- Bump to 22.3.0. I tried to just bump slightly, but there is a bug in
  22.1.0 on windows that I hit on oracle/graal#4502.
  It's fixed in the newer ones, so I just bumped up.
- Use `actions/setup-java` instead of `setup-scala` for jvm tests. Same
  reason as above with maintenance, but also built-in sbt cache. For now
  we're still doing a lot on 11 (where the graal stuff is on 17) but I'm
  trying to not change this too much for now until I get everything
  green and releasing. Then I'll address that.
- Move `publish-binaries-windows` into `publish-binaries`. Now that we
  are using `setup-graalvm` it's trivial to just keep these together,
  using `sbt` and just call it a day. No need for two separate ones.
- Remove the windows-specific `graalVMNativeImageCommand`. Again, now
  that we're using `setup-graalvm` we easily have the `native-image`
  command on the PATH so we don't need to worry about all this extra
  stuff.
- Change a few flags:
  - `--no-server` wasn't valid it seemed as we were getting a message on
    every run that it wasn't recognized and ignored.
  - `-H:EnableUrlProtocols` no just uses `--enable-url-protocols`.
    Apparently it's frowned upon to use the `-H` stuff since it's
    internal, so this was just a bit of cleaning up. We do have a couple
    others, but there doesn't seem to be alternatives so I left them as
    is.
  - `--allow-incomlete-classpath` This is the default now, so no need to
    have it.

You can see a green build for all 3 os's [here in my
fork](https://github.com/ckipp01/bloop/actions/runs/3787821939/jobs/6439973910).
But let's see how all the other jobs go.
ckipp01 added a commit to ckipp01/bloop that referenced this issue Dec 27, 2022
This was a bit of a rabbit hole, but I just went with it. With the
changes to sbt-ci-release, _somehow_ the graal native image generation
was failing on windows. In order to combat that this pr makes some
changes to CI and to the args we're using with Graal. I'll outline the
changes below.

- Migrate to `graalvm/setup-graalvm` for the graal jobs. This is
  necessary if we want to use the newer graal versions. When I tried
  with `setup-scala` I got jabba erros that what I was looking for
  doesn't exist. Plus `setup-scala` isn't _really_ worked on anymore, so
  migrating away is preferable. Plus, when using `setup-graalvm` it's
  easy to get things like the `native-image` command on all platforms.
- Bump to 22.3.0. I tried to just bump slightly, but there is a bug in
  22.1.0 on windows that I hit on oracle/graal#4502.
  It's fixed in the newer ones, so I just bumped up.
- Use `actions/setup-java` instead of `setup-scala` for jvm tests. Same
  reason as above with maintenance, but also built-in sbt cache. For now
  we're still doing a lot on 11 (where the graal stuff is on 17) but I'm
  trying to not change this too much for now until I get everything
  green and releasing. Then I'll address that.
- Move `publish-binaries-windows` into `publish-binaries`. Now that we
  are using `setup-graalvm` it's trivial to just keep these together,
  using `sbt` and just call it a day. No need for two separate ones.
- Remove the windows-specific `graalVMNativeImageCommand`. Again, now
  that we're using `setup-graalvm` we easily have the `native-image`
  command on the PATH so we don't need to worry about all this extra
  stuff.
- Change a few flags:
  - `--no-server` wasn't valid it seemed as we were getting a message on
    every run that it wasn't recognized and ignored.
  - `-H:EnableUrlProtocols` no just uses `--enable-url-protocols`.
    Apparently it's frowned upon to use the `-H` stuff since it's
    internal, so this was just a bit of cleaning up. We do have a couple
    others, but there doesn't seem to be alternatives so I left them as
    is.
  - `--allow-incomlete-classpath` This is the default now, so no need to
    have it.

You can see a green build for all 3 os's [here in my
fork](https://github.com/ckipp01/bloop/actions/runs/3787821939/jobs/6439973910).
But let's see how all the other jobs go.
ckipp01 added a commit to ckipp01/bloop that referenced this issue Dec 27, 2022
This was a bit of a rabbit hole, but I just went with it. With the
changes to sbt-ci-release, _somehow_ the graal native image generation
was failing on windows. In order to combat that this pr makes some
changes to CI and to the args we're using with Graal. I'll outline the
changes below.

- Migrate to `graalvm/setup-graalvm` for the graal jobs. This is
  necessary if we want to use the newer graal versions. When I tried
  with `setup-scala` I got jabba erros that what I was looking for
  doesn't exist. Plus `setup-scala` isn't _really_ worked on anymore, so
  migrating away is preferable. Plus, when using `setup-graalvm` it's
  easy to get things like the `native-image` command on all platforms.
- Bump to 22.3.0. I tried to just bump slightly, but there is a bug in
  22.1.0 on windows that I hit on oracle/graal#4502.
  It's fixed in the newer ones, so I just bumped up.
- Use `actions/setup-java` instead of `setup-scala` for jvm tests. Same
  reason as above with maintenance, but also built-in sbt cache. For now
  we're still doing a lot on 11 (where the graal stuff is on 17) but I'm
  trying to not change this too much for now until I get everything
  green and releasing. Then I'll address that.
- Move `publish-binaries-windows` into `publish-binaries`. Now that we
  are using `setup-graalvm` it's trivial to just keep these together,
  using `sbt` and just call it a day. No need for two separate ones.
- Remove the windows-specific `graalVMNativeImageCommand`. Again, now
  that we're using `setup-graalvm` we easily have the `native-image`
  command on the PATH so we don't need to worry about all this extra
  stuff.
- Change a few flags:
  - `--no-server` wasn't valid it seemed as we were getting a message on
    every run that it wasn't recognized and ignored.
  - `-H:EnableUrlProtocols` no just uses `--enable-url-protocols`.
    Apparently it's frowned upon to use the `-H` stuff since it's
    internal, so this was just a bit of cleaning up. We do have a couple
    others, but there doesn't seem to be alternatives so I left them as
    is.
  - `--allow-incomlete-classpath` This is the default now, so no need to
    have it.

You can see a green build for all 3 os's [here in my
fork](https://github.com/ckipp01/bloop/actions/runs/3787821939/jobs/6439973910).
But let's see how all the other jobs go.
ckipp01 added a commit to ckipp01/bloop that referenced this issue Dec 27, 2022
This was a bit of a rabbit hole, but I just went with it. With the
changes to sbt-ci-release, _somehow_ the graal native image generation
was failing on windows. In order to combat that this pr makes some
changes to CI and to the args we're using with Graal. I'll outline the
changes below.

- Migrate to `graalvm/setup-graalvm` for the graal jobs. This is
  necessary if we want to use the newer graal versions. When I tried
  with `setup-scala` I got jabba erros that what I was looking for
  doesn't exist. Plus `setup-scala` isn't _really_ worked on anymore, so
  migrating away is preferable. Plus, when using `setup-graalvm` it's
  easy to get things like the `native-image` command on all platforms.
- Bump to 22.3.0. I tried to just bump slightly, but there is a bug in
  22.1.0 on windows that I hit on oracle/graal#4502.
  It's fixed in the newer ones, so I just bumped up.
- Use `actions/setup-java` instead of `setup-scala` for jvm tests. Same
  reason as above with maintenance, but also built-in sbt cache. For now
  we're still doing a lot on 11 (where the graal stuff is on 17) but I'm
  trying to not change this too much for now until I get everything
  green and releasing. Then I'll address that.
- Move `publish-binaries-windows` into `publish-binaries`. Now that we
  are using `setup-graalvm` it's trivial to just keep these together,
  using `sbt` and just call it a day. No need for two separate ones.
- Remove the windows-specific `graalVMNativeImageCommand`. Again, now
  that we're using `setup-graalvm` we easily have the `native-image`
  command on the PATH so we don't need to worry about all this extra
  stuff.
- Change a few flags:
  - `--no-server` wasn't valid it seemed as we were getting a message on
    every run that it wasn't recognized and ignored.
  - `-H:EnableUrlProtocols` no just uses `--enable-url-protocols`.
    Apparently it's frowned upon to use the `-H` stuff since it's
    internal, so this was just a bit of cleaning up. We do have a couple
    others, but there doesn't seem to be alternatives so I left them as
    is.
  - `--allow-incomlete-classpath` This is the default now, so no need to
    have it.

You can see a green build for all 3 os's [here in my
fork](https://github.com/ckipp01/bloop/actions/runs/3787821939/jobs/6439973910).
But let's see how all the other jobs go.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants