gluonhq / client-samples

Client samples to run with Gluon Client plugins for Maven and Gradle
114 stars 23 forks source link

Reintroduce Gradle sample projects #66

Closed jskov closed 7 months ago

jskov commented 4 years ago

Requires changes from https://github.com/gluonhq/client-gradle-plugin/pull/61 to work.

jskov commented 4 years ago

@jperedadnr I had to add com.gluonhq.attach:util:4.0.5 as a dependency to make HelloGluon work.

util is not an service that can be selected, so this seems wrong.

Is the example in need of change (maybe due to attach version update to 4.0.5)? Or am I missing something else?

This was fixed by the util change in the client plugin, thanks.

tlf30 commented 4 years ago

The plugin version in the build.gradle(s) needs to be updated to remove snapshot from it now that 0.1.21 is out.

jskov commented 4 years ago

@jperedadnr is anything missing for this to land?

abhinayagarwal commented 4 years ago

I think this is good to merge. Any small changes, like version update, can be done later as well.

Zethson commented 4 years ago

Would love to see this merged.

Zethson commented 4 years ago
zeth@master /t/c/G/HelloFX (work)> gradle nativeBuild                                                                                                                                  (base) 

> Task :nativeCompile
[Wed Jul 01 10:01:04 CEST 2020][INFO] ==================== COMPILE TASK ====================
[Wed Jul 01 10:01:04 CEST 2020][INFO] We will now compile your code for aarch64-linux-android. This may take some time.

[Wed Jul 01 10:01:07 CEST 2020][INFO] [SUB] [hellofx.hellofx:30286]    classlist:   2,774.59 ms,  1.28 GB
[Wed Jul 01 10:01:08 CEST 2020][INFO] [SUB] [hellofx.hellofx:30286]        (cap):     232.75 ms,  1.28 GB
[Wed Jul 01 10:01:09 CEST 2020][INFO] [SUB] [hellofx.hellofx:30286]        setup:   1,651.64 ms,  1.28 GB
[Wed Jul 01 10:01:42 CEST 2020][INFO] [SUB] WARNING GR-10238: VarHandle for static field is currently not fully supported. Static field private static volatile java.lang.System$Logger jdk.internal.event.EventHelper.securityLogger is not properly marked for Unsafe access!
[Wed Jul 01 10:02:00 CEST 2020][INFO] [SUB] [hellofx.hellofx:30286]     (clinit):     691.06 ms,  3.56 GB
[Wed Jul 01 10:02:01 CEST 2020][INFO] [SUB] [hellofx.hellofx:30286]   (typeflow):  24,652.22 ms,  3.56 GB
[Wed Jul 01 10:02:01 CEST 2020][INFO] [SUB] [hellofx.hellofx:30286]    (objects):  22,022.86 ms,  3.56 GB
[Wed Jul 01 10:02:01 CEST 2020][INFO] [SUB] [hellofx.hellofx:30286]   (features):   2,179.28 ms,  3.56 GB
[Wed Jul 01 10:02:01 CEST 2020][INFO] [SUB] [hellofx.hellofx:30286]     analysis:  51,504.44 ms,  3.56 GB
[Wed Jul 01 10:02:02 CEST 2020][INFO] [SUB] [hellofx.hellofx:30286]     universe:   1,462.76 ms,  3.56 GB
[Wed Jul 01 10:02:09 CEST 2020][INFO] [SUB] [hellofx.hellofx:30286]      (parse):   7,014.37 ms,  3.56 GB
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB] [hellofx.hellofx:30286]     (inline):   5,366.76 ms,  4.89 GB
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB] [hellofx.hellofx:30286]    (compile):     224.32 ms,  4.89 GB
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB] [hellofx.hellofx:30286]      compile:  12,843.43 ms,  4.89 GB
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB] 3 fatal errors detected:
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB] Fatal error:org.graalvm.compiler.graph.GraalGraphError: com.oracle.svm.core.util.UserError$UserException: Using the LLVM backend requires LLVM to be installed on your machine.
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at node: 71|Conditional
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at method: int com.oracle.svm.core.graal.snippets.CEntryPointSnippets.initializeIsolate()  [Direct call from IsolateThread CEntryPointBuiltins.createIsolate()]
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at com.oracle.svm.core.graal.llvm.NodeLLVMBuilder.doBlock(NodeLLVMBuilder.java:291)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at com.oracle.svm.core.graal.llvm.SubstrateLLVMBackend.generate(SubstrateLLVMBackend.java:146)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at com.oracle.svm.core.graal.llvm.SubstrateLLVMBackend.emitLLVM(SubstrateLLVMBackend.java:122)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at com.oracle.svm.core.graal.llvm.SubstrateLLVMBackend.emitBackEnd(SubstrateLLVMBackend.java:102)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at jdk.internal.vm.compiler/org.graalvm.compiler.core.GraalCompiler.compile(GraalCompiler.java:146)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at jdk.internal.vm.compiler/org.graalvm.compiler.core.GraalCompiler.compileGraph(GraalCompiler.java:130)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at com.oracle.svm.hosted.code.CompileQueue.defaultCompileFunction(CompileQueue.java:983)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at com.oracle.svm.hosted.code.CompileQueue.doCompile(CompileQueue.java:945)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at com.oracle.svm.hosted.code.CompileQueue$CompileTask.run(CompileQueue.java:263)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at com.oracle.graal.pointsto.util.CompletionExecutor.lambda$execute$0(CompletionExecutor.java:173)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB] Caused by: com.oracle.svm.core.util.UserError$UserException: Using the LLVM backend requires LLVM to be installed on your machine.
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at com.oracle.svm.core.util.UserError.abort(UserError.java:68)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at com.oracle.svm.core.graal.llvm.LLVMFeature$LLVMVersionChecker.getLLVMVersion(LLVMFeature.java:149)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at com.oracle.svm.core.graal.llvm.LLVMFeature$LLVMVersionChecker.<clinit>(LLVMFeature.java:135)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at com.oracle.svm.core.graal.llvm.LLVMGenerator.emitConditionalMove(LLVMGenerator.java:639)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at com.oracle.svm.core.graal.llvm.NodeLLVMBuilder.emitConditional(NodeLLVMBuilder.java:395)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at jdk.internal.vm.compiler/org.graalvm.compiler.nodes.calc.ConditionalNode.generate(ConditionalNode.java:269)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at com.oracle.svm.core.graal.llvm.NodeLLVMBuilder.emitNode(NodeLLVMBuilder.java:327)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at com.oracle.svm.core.graal.llvm.NodeLLVMBuilder.doBlock(NodeLLVMBuilder.java:287)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     ... 15 more
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB] Fatal error:org.graalvm.compiler.graph.GraalGraphError: java.lang.NoClassDefFoundError: Could not initialize class com.oracle.svm.core.graal.llvm.LLVMFeature$LLVMVersionChecker
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at node: 5|Conditional
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at method: void com.oracle.svm.core.graal.snippets.StackOverflowCheckSnippets.throwNewStackOverflowError()  [Direct call from void CEntryPointSnippets.ensureJavaThread()]
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at com.oracle.svm.core.graal.llvm.NodeLLVMBuilder.doBlock(NodeLLVMBuilder.java:291)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at com.oracle.svm.core.graal.llvm.SubstrateLLVMBackend.generate(SubstrateLLVMBackend.java:146)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at com.oracle.svm.core.graal.llvm.SubstrateLLVMBackend.emitLLVM(SubstrateLLVMBackend.java:122)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at com.oracle.svm.core.graal.llvm.SubstrateLLVMBackend.emitBackEnd(SubstrateLLVMBackend.java:102)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at jdk.internal.vm.compiler/org.graalvm.compiler.core.GraalCompiler.compile(GraalCompiler.java:146)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at jdk.internal.vm.compiler/org.graalvm.compiler.core.GraalCompiler.compileGraph(GraalCompiler.java:130)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at com.oracle.svm.hosted.code.CompileQueue.defaultCompileFunction(CompileQueue.java:983)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at com.oracle.svm.hosted.code.CompileQueue.doCompile(CompileQueue.java:945)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at com.oracle.svm.hosted.code.CompileQueue$CompileTask.run(CompileQueue.java:263)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at com.oracle.graal.pointsto.util.CompletionExecutor.lambda$execute$0(CompletionExecutor.java:173)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB] Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.oracle.svm.core.graal.llvm.LLVMFeature$LLVMVersionChecker
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at com.oracle.svm.core.graal.llvm.LLVMGenerator.emitConditionalMove(LLVMGenerator.java:639)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at com.oracle.svm.core.graal.llvm.NodeLLVMBuilder.emitConditional(NodeLLVMBuilder.java:395)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at jdk.internal.vm.compiler/org.graalvm.compiler.nodes.calc.ConditionalNode.generate(ConditionalNode.java:269)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at com.oracle.svm.core.graal.llvm.NodeLLVMBuilder.emitNode(NodeLLVMBuilder.java:327)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at com.oracle.svm.core.graal.llvm.NodeLLVMBuilder.doBlock(NodeLLVMBuilder.java:287)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     ... 15 more
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB] Fatal error:org.graalvm.compiler.graph.GraalGraphError: java.lang.NoClassDefFoundError: Could not initialize class com.oracle.svm.core.graal.llvm.LLVMFeature$LLVMVersionChecker
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at node: 29|Conditional
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at method: void com.oracle.svm.core.thread.Safepoint.enterSlowPathSafepointCheck()  [Direct call from void CEntryPointSnippets.ensureJavaThread()]
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at com.oracle.svm.core.graal.llvm.NodeLLVMBuilder.doBlock(NodeLLVMBuilder.java:291)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at com.oracle.svm.core.graal.llvm.SubstrateLLVMBackend.generate(SubstrateLLVMBackend.java:146)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at com.oracle.svm.core.graal.llvm.SubstrateLLVMBackend.emitLLVM(SubstrateLLVMBackend.java:122)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at com.oracle.svm.core.graal.llvm.SubstrateLLVMBackend.emitBackEnd(SubstrateLLVMBackend.java:102)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at jdk.internal.vm.compiler/org.graalvm.compiler.core.GraalCompiler.compile(GraalCompiler.java:146)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at jdk.internal.vm.compiler/org.graalvm.compiler.core.GraalCompiler.compileGraph(GraalCompiler.java:130)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at com.oracle.svm.hosted.code.CompileQueue.defaultCompileFunction(CompileQueue.java:983)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at com.oracle.svm.hosted.code.CompileQueue.doCompile(CompileQueue.java:945)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at com.oracle.svm.hosted.code.CompileQueue$CompileTask.run(CompileQueue.java:263)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at com.oracle.graal.pointsto.util.CompletionExecutor.lambda$execute$0(CompletionExecutor.java:173)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB] Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.oracle.svm.core.graal.llvm.LLVMFeature$LLVMVersionChecker
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at com.oracle.svm.core.graal.llvm.LLVMGenerator.emitConditionalMove(LLVMGenerator.java:639)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at com.oracle.svm.core.graal.llvm.NodeLLVMBuilder.emitConditional(NodeLLVMBuilder.java:395)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at jdk.internal.vm.compiler/org.graalvm.compiler.nodes.calc.ConditionalNode.generate(ConditionalNode.java:269)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at com.oracle.svm.core.graal.llvm.NodeLLVMBuilder.emitNode(NodeLLVMBuilder.java:327)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     at com.oracle.svm.core.graal.llvm.NodeLLVMBuilder.doBlock(NodeLLVMBuilder.java:287)
[Wed Jul 01 10:02:15 CEST 2020][INFO] [SUB]     ... 15 more
[Wed Jul 01 10:02:18 CEST 2020][INFO] [SUB] Error: Image build request failed with exit status 1

> Task :nativeCompile FAILED
[Wed Jul 01 10:02:18 CEST 2020][SEVERE] Process compile failed with result: 1
Check the log files under /tmp/client-samples/Gradle/HelloFX/build/client/aarch64-android/gvm/log
And please check https://docs.gluonhq.com/client/ for more information.
[Wed Jul 01 10:02:18 CEST 2020][INFO] Logging process [compile] to file: /tmp/client-samples/Gradle/HelloFX/target/client/log/process-compile-1593590538725.log
[Wed Jul 01 10:02:18 CEST 2020][SEVERE] Compiling failed.
Check the log files under /tmp/client-samples/Gradle/HelloFX/build/client/aarch64-android/gvm/log
And please check https://docs.gluonhq.com/client/ for more information.

I even installed LLVM. Do you have any idea?

jskov-jyskebank-dk commented 4 years ago

Sorry. No idea. Looks like you are cross-compiling to Android. Did you install proper LLVM tooling for cross-compilation?

Zethson commented 4 years ago

I was dumb and forgot to uncomment Android :( Sorry!

When executing I am now running into:

zeth@master /t/c/G/H/b/c/x86_64-linux (work)> ./HelloFX                                                                                                                                (base) 
Graphics Device initialization failed for :  es2, sw
Error initializing QuantumRenderer: no suitable pipeline found
java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
    at com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:280)
    at com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:244)
    at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:260)
    at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
    at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
    at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
    at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
    at java.lang.Thread.run(Thread.java:834)
    at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:517)
    at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:193)
Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:94)
    at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
    ... 3 more
Exception in thread "main" java.lang.RuntimeException: No toolkit found
    at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:272)
    at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
    at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
    at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
    at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
    at java.lang.Thread.run(Thread.java:834)
    at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:517)
    at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:193)
jskov-jyskebank-dk commented 4 years ago

Looks like (from the path) that you are using WSL. WSL does not have access to any GUI (as far as I know).

Try executing it on a native linux box (with GUI).

Zethson commented 4 years ago

No, I am on Arch Linux. Not WSL.

jskov-jyskebank-dk commented 4 years ago

No idea then.