TheBoegl / gradle-launch4j

A gradle-plugin to create windows executables with launch4j
Apache License 2.0
305 stars 42 forks source link

Improved diagnosis possibilitites / output of the launch4j process #160

Closed jschneider closed 1 year ago

jschneider commented 1 year ago

After updating to the latest version, I run into an exception:

Caused by: net.sf.launch4j.BuilderException: net.sf.launch4j.ExecException: Exec failed (1): /home/johannes/projects/com.cedarsoft.monorepo/internal/closed/tools/con-man/build/tmp/launch4j/3.50/bin/windres --preprocessor=cat -J rc -O coff -F pe-i386 /tmp/launch4j9482616871874276650rc /tmp/launch4j17192160986393671510o
        at net.sf.launch4j.Builder.build(Builder.java:149)
        at net.sf.launch4j.Builder$build.call(Unknown Source)
        at edu.sc.seis.launch4j.tasks.Launch4jLibraryTask.run(Launch4jLibraryTask.groovy:51)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:125)
        ... 112 more
Caused by: net.sf.launch4j.ExecException: Exec failed (1): /home/johannes/projects/com.cedarsoft.monorepo/internal/closed/tools/con-man/build/tmp/launch4j/3.50/bin/windres --preprocessor=cat -J rc -O coff -F pe-i386 /tmp/launch4j9482616871874276650rc /tmp/launch4j17192160986393671510o
        at net.sf.launch4j.Util.exec(Util.java:156)
        at net.sf.launch4j.Cmd.exec(Builder.java:215)
        at net.sf.launch4j.Builder.build(Builder.java:100)
        ... 116 more

I have no idea how to continue with looking for the root cause.

It would be great to:

TheBoegl commented 1 year ago

Please attach more information so I can reproduce this. The best would be a minimal reproducible example and the XML generated with -Pl4j-debug for your example with version 3.0.4 of this plugin and the last version that worked for you. What OS and architecture are you trying it on?

jschneider commented 1 year ago

I could identify the problem: The "ico" file has somehow been the problem. I don't know what exactly went wrong, but reverting the ico file "fixed" the issue.

My problem is not so much the exception itself. It is more about the missing error messages and outputs. It is really hard to diagnose a black box. And at the moment the launch4j process is such a black box (at least for me)

TheBoegl commented 1 year ago

I don't really see any other way than to throw the exception that launch4j generates. Do you have any suggestions on how to improve the UX of this plugin in case of an error?

jschneider commented 1 year ago

Ok, thanks for your work.