gluonhq / gluonfx-gradle-plugin

Plugin that simplifies using Gluon Client for Java/JavaFX gradle projects
BSD 3-Clause "New" or "Revised" License
100 stars 22 forks source link

nativeBuild completed but executable does not start #153

Closed NicolasDrapier closed 1 year ago

NicolasDrapier commented 2 years ago

Hello,

I compiled my application with this plugin with the default settings (except verbose to true) and I get an error free executable thanks to the nativeBuild task. I followed the docs well and I did a gradle clean build before.

When I want to run my executable, nothing happens even in console.

What the fuck!? What am I doing wrong ?

Windows 11, 64 bits

ctoabidmaqbool commented 2 years ago

@NicolasDrapier without logs I think, anyone can't much helps. Please see and put logs here, GluonFx plugin generate many logs files.

NicolasDrapier commented 2 years ago

I have checked all the logs and there are no errors. All the steps of the compilation follow without a hitch and it produces 5 artifacts: graal_isolate.h, main.h, main_dynamic.h, graal_isolate_dynamic.h and build_artifacts.txt. Everything seems to have worked without any problem but I'm sending you the logs right after (be careful, they are obfuscated)

NicolasDrapier commented 2 years ago
Process
=======
compile

Command Line
============
C:\Program Files\GraalVM\bin\native-image.cmd "-Djdk.internal.lambda.eagerlyInitialize=false" --no-server -H:+ExitAfterRelocatableImageWrite -H:+SharedLibrary -H:+AddAllCharsets -H:+ReportExceptionStackTraces -H:-DeadlockWatchdogExitOnTimeout "-H:DeadlockWatchdogInterval=0" -H:+RemoveSaturatedTypeFlows "--features=org.graalvm.home.HomeFinderFeature" "-H:TempDirectory=C:\Users\a\a\a\build\gluonfx\x86_64-windows\gvm\tmp" "-H:EnableURLProtocols=http,https" -H:+PrintAnalysisCallTree "-H:Log=registerResource:" "-H:ReflectionConfigurationFiles=C:\Users\a\a\a\build\gluonfx\x86_64-windows\gvm\reflectionconfig-x86_64-windows.json" "-H:JNIConfigurationFiles=C:\Users\a\a\a\build\gluonfx\x86_64-windows\gvm\jniconfig-x86_64-windows.json" "-H:ResourceConfigurationFiles=C:\Users\a\a\a\build\gluonfx\x86_64-windows\gvm\resourceconfig-x86_64-windows.json" "-H:IncludeResourceBundles=com/sun/javafx/scene/control/skin/resources/controls,com/sun/javafx/scene/control/skin/resources/controls-nt,com.sun.media.jfxmedia.MediaErrors,com.sun.javafx.tk.quantum.QuantumMessagesBundle,com/sun/glass/ui/win/themes" "-Dsvm.platform=org.graalvm.nativeimage.Platform$WINDOWS_AMD64" -cp "C:\Users\s\.gradle\caches\jars-9\2768fb4c80aa792d9799f7fa77dfaa44\substrate-0.0.53.jar;C:\Users\a\a\a\build\gluonfx\x86_64-windows\gvm\tmp\classpathJar.jar" com.s.l.Main

Output
======
Warning: Ignoring server-mode native-image argument --no-server.
========================================================================================================================
GraalVM Native Image: Generating 'com.s.l.main'...
========================================================================================================================
[1/7] Initializing...                                                                                    (4,1s @ 0,13GB)
 Version info: 'GraalVM 22.0.0.2 Java 11 CE'
 2 user-provided feature(s)
  - com.oracle.svm.polyglot.kotlin.KotlinFeature
  - com.oracle.svm.thirdparty.gson.GsonFeature
[Use -Dgraal.LogFile=<path> to redirect Graal log output to a file.]
[thread:1] scope: main
  [thread:1] scope: main.registerResource
  ServiceLoaderFeature: registerResource: META-INF/services/jdk.internal.logger.DefaultLoggerFinder
  [thread:1] scope: main.registerResource
  ServiceLoaderFeature: registerResource: META-INF/services/java.nio.file.spi.FileSystemProvider
  [thread:1] scope: main.registerResource
  ServiceLoaderFeature: registerResource: META-INF/services/sun.util.resources.LocaleData$CommonResourceBundleProvider
  [thread:1] scope: main.registerResource
  ServiceLoaderFeature: registerResource: META-INF/services/sun.util.resources.LocaleData$SupplementaryResourceBundleProvider
  [thread:1] scope: main.registerResource
  Resources have been added by ServiceLoaderFeature. Automatic registration can be disabled with -H:-UseServiceLoaderFeature
  [thread:1] scope: main.registerResource
  ServiceLoaderFeature: registerResource: META-INF/services/javax.script.ScriptEngineFactory
  [thread:1] scope: main.registerResource
  Resources have been added by ServiceLoaderFeature. Automatic registration can be disabled with -H:-UseServiceLoaderFeature
  [thread:1] scope: main.registerResource
  ServiceLoaderFeature: registerResource: META-INF/services/org.graalvm.polyglot.impl.AbstractPolyglotImpl
  [thread:1] scope: main.registerResource
  Resources have been added by ServiceLoaderFeature. Automatic registration can be disabled with -H:-UseServiceLoaderFeature
  [thread:1] scope: main.registerResource
  ServiceLoaderFeature: registerResource: META-INF/services/javax.naming.spi.InitialContextFactory
  [thread:1] scope: main.registerResource
  Resources have been added by ServiceLoaderFeature. Automatic registration can be disabled with -H:-UseServiceLoaderFeature
[2/7] Performing analysis...  [**************]                                                          (30,8s @ 2,85GB)
  10 912 (88,16%) of 12 377 classes reachable
  20 323 (74,65%) of 27 226 fields reachable
  54 657 (62,18%) of 87 900 methods reachable
     613 classes,    86 fields, and 1 172 methods registered for reflection
     136 classes,   155 fields, and   207 methods registered for JNI access
# Printing call tree to: C:\Users\a\a\a\build\gluonfx\x86_64-windows\gvm\s\reports\call_tree_com.s.l.main_20220601_155942.txt
# Printing list of used methods to: C:\Users\a\a\a\build\gluonfx\x86_64-windows\gvm\s\reports\used_methods_com.s.l.main_20220601_155944.txt
# Printing list of used classes to: C:\Users\a\a\a\build\gluonfx\x86_64-windows\gvm\s\reports\used_classes_com.s.l.main_20220601_155944.txt
# Printing list of used packages to: C:\Users\a\a\a\build\gluonfx\x86_64-windows\gvm\s\reports\used_packages_com.s.l.main_20220601_155944.txt
[3/7] Building universe...                                                                               (2,0s @ 3,77GB)
[4/7] Parsing methods...      [**]                                                                       (4,9s @ 3,11GB)
[5/7] Inlining methods...     [****]                                                                     (1,9s @ 3,91GB)
[6/7] Compiling methods...    [****]                                                                    (14,2s @ 1,77GB)
[7/7] Creating image...
------------------------------------------------------------------------------------------------------------------------
                       11,4s (16,7% of total time) in 51 GCs | Peak RSS: 7,55GB | CPU load: 8,51
------------------------------------------------------------------------------------------------------------------------
Produced artifacts:
 C:\Users\a\a\a\build\gluonfx\x86_64-windows\gvm\s\graal_isolate.h (header)
 C:\Users\a\a\a\build\gluonfx\x86_64-windows\gvm\s\com.s.l.main.h (header)
 C:\Users\a\a\a\build\gluonfx\x86_64-windows\gvm\s\graal_isolate_dynamic.h (header)
 C:\Users\a\a\a\build\gluonfx\x86_64-windows\gvm\s\com.s.l.main_dynamic.h (header)
 C:\Users\a\a\a\build\gluonfx\x86_64-windows\gvm\s\com.s.l.main.build_artifacts.txt
========================================================================================================================
Finished generating 'com.s.l.main' in 1m 7s.

Result
======
result: 0
NicolasDrapier commented 2 years ago
Process
=======
link

Command Line
============
link C:\Users\a\a\a\build\gluonfx\x86_64-windows\gvm\l\launcher.obj C:\Users\a\a\a\build\gluonfx\x86_64-windows\gvm\tmp\SVM-1654091946931\com.s.l.main.obj C:\Users\a\a\a\build\gluonfx\x86_64-windows\gvm\l\IconGroup.obj j2pkcs11.lib java.lib net.lib nio.lib prefs.lib fdlibm.lib sunec.lib zip.lib sunmscapi.lib jvm.lib libchelper.lib advapi32.lib iphlpapi.lib secur32.lib userenv.lib version.lib ws2_32.lib winhttp.lib ncrypt.lib crypt32.lib /NODEFAULTLIB:libcmt.lib /SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup comdlg32.lib dwmapi.lib gdi32.lib imm32.lib shell32.lib uiautomationcore.lib urlmon.lib winmm.lib glass.lib javafx_font.lib javafx_iio.lib prism_common.lib prism_d3d.lib /WHOLEARCHIVE:glass.lib /WHOLEARCHIVE:javafx_font.lib /WHOLEARCHIVE:javafx_iio.lib /WHOLEARCHIVE:prism_common.lib /WHOLEARCHIVE:prism_d3d.lib /OUT:C:\Users\a\a\a\build\gluonfx\x86_64-windows\l.exe /LIBPATH:C:\Users\a\.gluon\substrate\javafxStaticSdk\19-ea+4\windows-x86_64\sdk\lib /LIBPATH:C:\Program Files\GraalVM\lib\svm\clibraries\windows-amd64 /LIBPATH:C:\Program Files\GraalVM\lib\static\windows-amd64

Output
======
Microsoft (R) Incremental Linker Version 14.32.31329.0
Copyright (C) Microsoft Corporation.  All rights reserved.

   Cr‚ation de la bibliothŠque C:\Users\a\a\a\build\gluonfx\x86_64-windows\l.lib et de l'objet C:\Users\a\a\a\build\gluonfx\x86_64-windows\l.exp

Result
======
result: 0
NicolasDrapier commented 2 years ago

Any ideas ?

jperedadnr commented 2 years ago

When you run the executable, you do that from a terminal?

Can you try:

l.exe 2> log.txt

That will print all the error output to the log.txt file, then see if you get some exceptions that help you identify why the app doesn't run.