On 4/17/2022 2:22 PM, Hiran Chaudhuri wrote:
On Thu, 2022-04-07 at 19:53 -0400, Alexey Semenyuk wrote:

I can see two separate issues with jpackage:
   1. jpackage reports NPE if it can't figure out the package name
from
the supplied application image. It should issue a helpful error
message
instead
   2. jpackage fails to populate application image with Java runtime
and
app specific files when executed in Github but exits with "0" status
indicating no error

I totally agree these are two separate issues.

The major problem in your use case is that jpackage doesn't create
correct application image. Instead, it creates only a directory
structure of application image, but no files and exits with a
"success"
status code. This is quite strange. Is there any chance Gradle
ignores
non-zero exit code from jpackage execution? Can you directly run
jpackage command creating application image in the environment where
it
outputs "empty" application image and check its exit code (please
add
"--verbose" to jpackage command line to get debug output)?

- Alexey

Now this is somewhat puzzling for me:
I tried to factor out Gradle by putting the JPackage commands into a
separate section of the Github Actions script. So now it is invoked
through bash.

No wonder, the command triggered by Gradle and the one triggered by
bash revealed the same result: A lot of files were missing. I verified
this by listing the directories through a 'find'.

But then I followed your advice and added --verbose to the JPackage
command. And find lists a lot more files now.

In case you are interested, check out
https://urldefense.com/v3/__https://github.com/HiranChaudhuri/settlers-installer/runs/5890636608?check_suite_focus=true__;!!ACWV5N9M2RV99hQ!fMwHRzbnvjiQPsoiuBB1Cnl4RNGxATH4RHnb3Ugy-dlsPTPHLoqOF2uSYcFRkfaSYHQA$
Thank you for sharing. I find this piece of log interesting:
---
[19:28:24.553] Command [PID: -1]:
    jlink --output app/build/app-image/SettlersRemake/lib/runtime --module-path /usr/lib/jvm/temurin-17-jdk-amd64/jmods --add-modules jdk.management.jfr,java.rmi,jdk.jdi,jdk.charsets,java.xml,jdk.xml.dom,java.datatransfer,jdk.jstatd,jdk.httpserver,java.desktop,java.security.sasl,jdk.zipfs,java.base,jdk.crypto.ec,jdk.javadoc,jdk.management.agent,jdk.jshell,jdk.editpad,java.sql.rowset,jdk.jsobject,jdk.sctp,java.smartcardio,jdk.unsupported,jdk.jlink,java.security.jgss,java.compiler,jdk.nio.mapmode,jdk.dynalink,jdk.unsupported.desktop,jdk.accessibility,jdk.security.jgss,jdk.incubator.vector,java.sql,java.transaction.xa,java.logging,java.xml.crypto,jdk.jfr,jdk.crypto.cryptoki,jdk.net,jdk.random,java.naming,jdk.internal.ed,java.prefs,java.net.http,jdk.compiler,jdk.naming.rmi,jdk.internal.opt,jdk.jconsole,jdk.attach,jdk.internal.le,java.management,jdk.jdwp.agent,jdk.internal.jvmstat,jdk.incubator.foreign,java.instrument,jdk.management,jdk.security.auth,java.scripting,jdk.jdeps,jdk.jartool,jdk.jpackage,java.management.rmi,jdk.naming.dns,jdk.localedata --strip-native-commands --strip-debug --no-man-pages --no-header-files
---
It is not quite right that pid of jlink invocation is reported as "-1". jlnk fills runtime directory in app image. Something if off here, invocation of jlink in non-verbose mode fails. In the verbose mode, jpackage saves command lines and output of all external tools it invokes and prints saved data to the console. At least there is a workaround for the issue - add "--verbose" to jpackage command line.

I've filed [1] and [2] CRs to track the issues.

[1] https://bugs.openjdk.java.net/browse/JDK-8284973
[2] https://bugs.openjdk.java.net/browse/JDK-8284974

- Alexey


So now I believe that --verbose does not only change log output but
also impacts app-image creation. BTW, the command used is

jpackage --verbose --type app-image --dest app/build/app-image -i
app/build/jpackage_input/app-0.1.0-SNAPSHOT/lib --main-jar app-0.1.0-
SNAPSHOT.jar --main-class settlers.installer.App --name SettlersRemake
--app-version 0.1.0-SNAPSHOT --description 'Settlers 3 remake - see
https://urldefense.com/v3/__https://github.com/__;!!ACWV5N9M2RV99hQ!fMwHRzbnvjiQPsoiuBB1Cnl4RNGxATH4RHnb3Ugy-dlsPTPHLoqOF2uSYcFRkQh1q_el$
 ' --vendor Hiran, --icon
app/build/resources/main/siedler3-helme-logo.png --resource-dir
app/build/resources/jpackage

Hiran


Reply via email to