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

./jbang export local --native calls the wrong native-image executable on Windows Server 2022 #1394

Closed
helpermethod opened this issue Jul 6, 2022 · 7 comments · Fixed by #1395
Labels
bug Something isn't working

Comments

@helpermethod
Copy link

Describe the bug
On Windows Server 2022, ./jbang export local --native ... tries to call native-image.exe instead of native-image.cmd, see

https://github.com/helpermethod/p2e/runs/7211828761?check_suite_focus=true#step:5:62

To Reproduce
Steps to reproduce the behavior:

  1. Create a GitHub Actions Workflow
  2. Use the official setup-graalvm Action for settings up Java 17 with native-image
  3. Run ./jbang export local --native --output p2e p2e.java on Windows Server 2022
  4. The wrong executable is called by jbang

image

Expected behavior
native-image.cmd is called instead.

JBang version

[jbang] jbang version 0.95.0
Cache: /Users/weilero/.jbang/cache
Config: /Users/weilero/.jbang
Repository:/Users/weilero/.m2/repository
0.95.0
@helpermethod helpermethod added the bug Something isn't working label Jul 6, 2022
@maxandersen
Copy link
Collaborator

Your link results in 404. Can You paste the relevant output?

@helpermethod
Copy link
Author

Sorry, the repo was accidentally set to private. The link should work now.

@quintesse
Copy link
Contributor

Yup, .exe is hard-coded. I'm guessing that up to now native-image has always been an EXE on Windows. They must have changed that recently?

https://github.com/jbangdev/jbang/blob/main/src/main/java/dev/jbang/source/builders/BaseBuilder.java#L305

@helpermethod
Copy link
Author

helpermethod commented Jul 6, 2022

I guess they changed it when it became an optional part of the GraalVM dist. I'll see If I can find out sth.

@quintesse
Copy link
Contributor

It seems the .exe is now located in $JAVA_HOME/lib/svm/bin and the .cmd just starts that. Probably they reorganized things.

quintesse added a commit to quintesse/jbang that referenced this issue Jul 6, 2022
We no longer assume the compiler executables will always be .exe when
running on Windows. In fact in the latest Graal versions the
`native-image` executable is a .cmd file.

Fixes jbangdev#1394
@quintesse
Copy link
Contributor

Ok, I created a fix for this which should work. #1395

quintesse added a commit to quintesse/jbang that referenced this issue Jul 6, 2022
We no longer assume the compiler executables will always be .exe when
running on Windows. In fact in the latest Graal versions the
`native-image` executable is a .cmd file.

Fixes jbangdev#1394
@quintesse
Copy link
Contributor

Ok, so the fix does work, but I encountered a couple of other issues along the way:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants