graalvm-mobile

https://github.com/phronmophobic/mobiletest
phronmophobic 2021-06-17T00:41:01.001200Z

šŸ‘‹

raspasov 2021-06-17T00:47:23.001600Z

Nice.

phronmophobic 2021-06-17T00:48:43.002500Z

I'm curious what you would be interesting in build as well what kind of GUI interface you would be looking for.

raspasov 2021-06-17T00:50:44.003300Z

Responding in order: It would be great to double check that theĀ basic mobile setupĀ 1) works , 2) is easy to follow. Iā€™ll try the project tonight.

šŸŽ‰ 1
raspasov 2021-06-17T00:52:30.005400Z

It would great to get your take on what kind of GUI API you think would make sense (clj bindings for SwiftUI?, UIKit, something else?). I think SwiftUI is the future for MacOS/iOS/iPad/iOS. I havenā€™t used it much (just a bit) but the model looks solid. Very close to React, but also made to do ā€œdata syncā€ with classes/mutable objects.

raspasov 2021-06-17T00:53:16.006300Z

UIKit is very low level in comparison, and a very mutable API, 90s style. Do this, do that. Mutable everything.

raspasov 2021-06-17T00:54:56.008100Z

SwiftUI in comparison is very declarative. With caveats, from the surface, it feels like it can be a great fit for Clojure. But I donā€™t have enough experience with it and the interop between Swift/Clojure to say what the technical hurdles are going to be.

raspasov 2021-06-17T00:58:01.011300Z

I'd also like to know what you think of React Native generally. One interesting strategy would be to create bindings to theĀ native sideĀ of React Native. I like React Native. Itā€™s very close to React, basically the same model. It can have limitations but they are mostly in performance for specific cases like animation performance, and can be worked around. There are libraries like Reanimated V2 which solve that quite well. Otherwise, RN is probably the best and most easily iterable way to build general UIs on iOS today.

phronmophobic 2021-06-17T00:58:40.011900Z

SwiftUI does seem pretty functional. I haven't tried it in any real capacity though

raspasov 2021-06-17T00:59:01.012400Z

React Native is built on top of UIKit, btw. It basically uses a ā€œviewā€ like a ā€œdivā€.

raspasov 2021-06-17T00:59:24.013Z

Yes! It is. I have tried a few toy examples. Itā€™s neat.

raspasov 2021-06-17T01:00:30.014600Z

I wouldnā€™t say I like it more than React, but for what Swift/Obj-C is, itā€™s definitely towards best they can have.

phronmophobic 2021-06-17T01:01:07.015300Z

My sense is that's there's way more stuff built on top of UIKit. The other benefit is that objective-c seems more dynamically malleable compared to swift. It seems like it would be possible to implement interop on of obc_msgsend similar to how java interop works

phronmophobic 2021-06-17T01:01:34.016300Z

However, I don't think that's the main consideration

raspasov 2021-06-17T01:02:18.017100Z

Yes, there definitely is. But I think things should be moving towards the SwiftUI direction.

raspasov 2021-06-17T01:02:53.017900Z

Obj-C definitely very dynamic. Whatā€™s your sense about interop between Clojure and Swift? Would it be possible?

phronmophobic 2021-06-17T01:03:34.018200Z

I'm sure it's possible

phronmophobic 2021-06-17T01:04:39.019500Z

worst case scenario is that you use the reference api to generate the interface on both the clojure and swift sides

raspasov 2021-06-17T01:05:54.021100Z

Cool. Iā€™ve been doing a bit of Swift over the last 2 weeks. Definitely not an expert, but learning things. (I needed a custom camera solution and access to the raw frames of the camera, and re-made a component that interfaces with RN to do that)

raspasov 2021-06-17T01:06:50.022Z

If you get the compiler to be happy, Swift ainā€™t that bad. But thatā€™s a big if šŸ˜œ.

raspasov 2021-06-17T01:09:13.023900Z

I am still wrapping my head around the rules about initializations in Swift structs. As long as I stick to (mostly) static classes and static vars, things are much ā€œeasierā€ and ā€œfamiliarā€, sort of Java-static style.

raspasov 2021-06-17T01:09:45.024200Z

Iā€™ll try the project and report here.

phronmophobic 2021-06-17T01:09:51.024400Z

:thumbsup:

raspasov 2021-06-17T07:29:25.025300Z

Going through the GraalVM setup. Should I be using Java 11 or Java 16, any difference?

raspasov 2021-06-17T07:29:30.025500Z

Iā€™ll try with Java 11 to start.

phronmophobic 2021-06-17T07:32:16.025700Z

my setup was java 11

phronmophobic 2021-06-17T07:33:14.026300Z

ideally, it shouldn't matter, but I haven't tried Java 16

raspasov 2021-06-17T07:33:37.026700Z

Alright, not gonna go crazy to start, Java 11 it is šŸ™‚

šŸ™‚ 1
raspasov 2021-06-17T08:05:26.027400Z

Ok, got GraalVM installed, I believe. Perhaps adding a link to this issue can be helpful to somebody https://stackoverflow.com/questions/65786439/problem-with-installing-running-grallvm-on-mac

raspasov 2021-06-17T08:05:44.028Z

Or just a note about MacOS:

xattr -d com.apple.quarantine <PATH TO GRAALVM INSTALLATION>

phronmophobic 2021-06-17T08:06:20.028400Z

good call. it's been so long that I forgot

raspasov 2021-06-17T08:06:42.028900Z

For sure, itā€™s a one-time pain.

phronmophobic 2021-06-17T08:07:24.029300Z

trying to figure out the best place to put the link

phronmophobic 2021-06-17T08:07:31.029500Z

it's on the release page: https://github.com/graalvm/graalvm-ce-builds/releases

phronmophobic 2021-06-17T08:07:35.029700Z

but after all the links

raspasov 2021-06-17T08:07:51.029900Z

Ah

raspasov 2021-06-17T08:08:16.030400Z

I guess I didnā€™t scroll that far. I was going through this page at the moment: https://github.com/BrunoBonacci/graalvm-clojure/blob/master/doc/clojure-graalvm-native-binary.md

raspasov 2021-06-17T08:08:38.030800Z

Omg, itā€™s there also šŸ™‚

raspasov 2021-06-17T08:09:11.031300Z

I am just impatient and donā€™t read things till the end šŸ˜‚

1
phronmophobic 2021-06-17T08:10:20.032100Z

to be fair, Mac OSX has been getting less developer friendly over the years

raspasov 2021-06-17T08:10:48.032400Z

Yeah. Because security.

raspasov 2021-06-17T08:19:49.033800Z

Ok, Iā€™m running ./scripts/compile-shared I get this: ./scripts/compile-shared: line 20: /bin/native-image: No such file or directory

phronmophobic 2021-06-17T08:20:37.034Z

do you have your graalvm home set?

phronmophobic 2021-06-17T08:21:17.034200Z

rather GRAALVM_HOME

raspasov 2021-06-17T08:21:34.034400Z

Ah, 1 sec.

raspasov 2021-06-17T08:26:14.035100Z

I was trying to make it work via jenv but I guess I need the GRAALVM_HOME

phronmophobic 2021-06-17T08:27:16.035500Z

the compile script references GRAALVM_HOME

raspasov 2021-06-17T08:27:26.035900Z

Right, I see it. No problem.

phronmophobic 2021-06-17T08:27:29.036Z

not sure what might be a better alternative

phronmophobic 2021-06-17T08:28:22.036400Z

it's looking for graalvm's native-image

raspasov 2021-06-17T08:31:59.036700Z

Compiling now.

šŸ¤ž 1
raspasov 2021-06-17T08:32:39.037100Z

Taking its time, assume thatā€™s expected.

phronmophobic 2021-06-17T08:32:52.037400Z

yup, it takes some time

šŸ‘Œ 1
raspasov 2021-06-17T08:41:19.037900Z

Oh wow, went to make some food, this is still going šŸ˜„

raspasov 2021-06-17T08:41:35.038100Z

Maybe somethingā€™s wrong?

raspasov 2021-06-17T08:41:54.038400Z

Output so far:

raspasov 2021-06-17T08:41:56.038600Z

raspasov@MBP mobiletest % ./scripts/compile-sharedĀ Ā Ā Ā 
+ set -e
+++ dirname ./scripts/compile-shared
++ cd ./scripts
++ pwd
+ DIR=/Users/raspasov/projects/github/mobiletest/scripts
+ cd /Users/raspasov/projects/github/mobiletest/scripts
+ PROJECT_DIR=/Users/raspasov/projects/github/mobiletest/scripts/..
+ cd ..
+ rm -rf ./classes
+ mkdir classes
+ clojure -X com.phronmophobic.mobiletest/compile-interface-class
+ clojure -X:depstar
[main] INFO hf.depstar.uberjar - Synchronizing pom.xml
Skipping paths: classes generated_classes native_test
[main] INFO hf.depstar.uberjar - Compiling com.phronmophobic.mobiletest ...
[main] INFO hf.depstar.uberjar - Compiling com.phronmophobic.mobiletest ...
[main] INFO hf.depstar.uberjar - Building uber jar: target/mobiletest-uber.jar
{:warning "could not find classpath entry", :path "generated_classes"}
{:warning "could not find classpath entry", :path "native_test"}
[main] INFO hf.depstar.uberjar - Processing pom.xml for {com.phronmophobic/mobiletest {:mvn/version "1.00-beta-1"}}
+ pushd library
~/projects/github/mobiletest/library ~/projects/github/mobiletest
+ /Library/Java/JavaVirtualMachines/graalvm-ce-java11-21.1.0/Contents/Home/bin/native-image --report-unsupported-elements-at-runtime --initialize-at-build-time --no-fallback --no-server -H:CompilerBackend=llvm -H:+ExitAfterRelocatableImageWrite -H:+SharedLibrary -H:+AddAllCharsets -H:+ReportExceptionStackTraces -H:-DeadlockWatchdogExitOnTimeout -H:DeadlockWatchdogInterval=0 -H:+RemoveSaturatedTypeFlows -H:-SpawnIsolates -H:PageSize=16384 -Djdk.internal.lambda.eagerlyInitialize=false -H:+ReportExceptionStackTraces -H:TempDirectory=/Users/raspasov/projects/github/mobiletest/scripts/../library/tmp -H:ReflectionConfigurationFiles=/Users/raspasov/projects/github/mobiletest/scripts/../conf/reflectionconfig-arm64-ios.json -H:JNIConfigurationFiles=/Users/raspasov/projects/github/mobiletest/scripts/../conf/jniconfig-arm64-ios.json -H:ResourceConfigurationFiles=/Users/raspasov/projects/github/mobiletest/scripts/../conf/resourceconfig-arm64-ios.json -J-Dclojure.spec.skip-macros=true -J-Xmx20G -J-XX:MaxDirectMemorySize=8G -J-Dclojure.compiler.direct-linking=true -J-Dtech.v3.datatype.graal-native=true -Dsvm.targetName=iOS -Dsvm.targetArch=arm64 -H:+UseCAPCache -H:CAPCacheDir=/Users/raspasov/projects/github/mobiletest/scripts/../conf/capcache '-Dsvm.platform=org.graalvm.nativeimage.Platform$IOS_AARCH64' -jar ../target/mobiletest-uber.jar -cp classes
[mobiletest-uber:8653]Ā Ā classlist: Ā 2,728.25 ms,Ā 0.94 GB
[mobiletest-uber:8653]Ā Ā Ā Ā (cap): Ā Ā 171.45 ms,Ā 0.94 GB
[mobiletest-uber:8653]Ā Ā Ā Ā setup: Ā 1,727.14 ms,Ā 0.94 GB

raspasov 2021-06-17T08:42:36.038900Z

Keep waiting?

phronmophobic 2021-06-17T08:47:16.039500Z

I'm a little surprised it's taking this long, but it's not completely crazy

phronmophobic 2021-06-17T08:48:00.039900Z

especially if compiling the uberjar for the first time needed to download dependencies

raspasov 2021-06-17T08:50:41.040700Z

Yeah it is weirdā€¦ I am on a relatively recent MBP 2018, 2.9 GHz 6-Core Intel Core i9 (not sure if this makes a big difference in compilation)

raspasov 2021-06-17T08:50:47.040900Z

Still waiting.

phronmophobic 2021-06-17T08:51:36.041600Z

I have seen it get stuck on setup before and killing and restarting can help

raspasov 2021-06-17T08:51:46.042200Z

Ok, Iā€™ll try that then?

phronmophobic 2021-06-17T08:51:52.042500Z

:thumbsup:

raspasov 2021-06-17T08:52:04.042700Z

Restarted.

raspasov 2021-06-17T08:52:35.043100Z

There a couple of warnings, {:warning ā€œcould not find classpath entryā€, :path ā€œgenerated_classesā€} {:warning ā€œcould not find classpath entryā€, :path ā€œnative_testā€} Do they matter?

phronmophobic 2021-06-17T08:53:26.043800Z

It shouldn't. I'm just realizing those entries are from the avclj project that I based the initial project on

šŸ‘Œ 1
raspasov 2021-06-17T08:53:52.044100Z

Ok, still waiting at the same spot now.

raspasov 2021-06-17T08:56:32.045500Z

Random feedback for the README, perhaps add right before ./scripts/compile-shared

export GRAALVM_HOME=/Library/Java/JavaVirtualMachines/graalvm-ce-java11-VERSION/Contents/Home
export PATH=$GRAALVM_HOME/bin:$PATH
(assuming MacOS)

šŸ‘ 1
raspasov 2021-06-17T09:03:25.046Z

Hmm something looks very stuck, not sure whyā€¦

raspasov 2021-06-17T09:03:50.047100Z

(based on Activity Monitor, it doesnā€™t seem itā€™s doing much CPU or network)

phronmophobic 2021-06-17T09:03:51.047200Z

that does seem suspicous

phronmophobic 2021-06-17T09:05:04.048200Z

i'm running it on my computer and all the activity seems to be showing up under java rather than "native-image"

raspasov 2021-06-17T09:05:39.048400Z

Ok, let me seeā€¦

phronmophobic 2021-06-17T09:07:36.048700Z

weird. I'm running it now on my computer and it's taking forever

raspasov 2021-06-17T09:07:53.049200Z

You said it needs to download something?

phronmophobic 2021-06-17T09:07:57.049600Z

I don't remember it taking this long before

raspasov 2021-06-17T09:08:09.050100Z

Maybe thereā€™s a way to manually download it? Perhaps some server is down?

phronmophobic 2021-06-17T09:08:14.050300Z

native image shouldn't be downloading anything

phronmophobic 2021-06-17T09:08:31.050700Z

only to make the uberjar, which it looks like you've completed

raspasov 2021-06-17T09:08:49.051Z

Yes, the jar is there under /target

raspasov 2021-06-17T09:09:00.051300Z

34.6MB mobiletest-uber.jar

phronmophobic 2021-06-17T09:12:38.052Z

now it's not working on my computer šŸ˜ž. I swear this was all working earlier

raspasov 2021-06-17T09:13:44.052300Z

I believe you. Hmm.

raspasov 2021-06-17T09:14:05.052500Z

Gets stuck at the same spot?

phronmophobic 2021-06-17T09:14:39.052700Z

ohh

phronmophobic 2021-06-17T09:14:46.053Z

I think I know the issue on my computer

phronmophobic 2021-06-17T09:15:02.053400Z

I forgot to switch my JAVA_HOME to point to graalvm

phronmophobic 2021-06-17T09:15:17.053800Z

if you do which java, does it print the java in graalvm?

raspasov 2021-06-17T09:16:01.054100Z

I think I didnā€™t put the $JAVA_HOME :

raspasov 2021-06-17T09:16:02.054300Z

raspasov@MBP mobiletest % echo $JAVA_HOME raspasov@MBP mobiletest % which javaĀ  /Library/Java/JavaVirtualMachines/graalvm-ce-java11-21.1.0/Contents/Home/bin/java

raspasov 2021-06-17T09:16:14.054600Z

JAVA_HOME is empty but the java is correct

raspasov 2021-06-17T09:16:24.054900Z

Iā€™ll try to set JAVA_HOME

raspasov 2021-06-17T09:18:33.055100Z

export JAVA_HOME=/Library/Java/JavaVirtualMachines/graalvm-ce-java11-21.1.0/Contents/Home
Running againā€¦

raspasov 2021-06-17T09:19:53.056200Z

Seems to be stuck same spotā€¦

phronmophobic 2021-06-17T09:19:57.056300Z

ok, looking back at my setup. My JAVA_HOME wasn't set, but I was using a different the first time around

phronmophobic 2021-06-17T09:20:16.056700Z

I would try deleting the library/classes directory

phronmophobic 2021-06-17T09:20:23.056900Z

and trying again

raspasov 2021-06-17T09:20:33.057300Z

Ok! Trying.

phronmophobic 2021-06-17T09:20:40.057500Z

it did compile for me this time in 213,763.55 ms

phronmophobic 2021-06-17T09:21:10.057700Z

aka ~3.5 minutes

raspasov 2021-06-17T09:22:36.058Z

Progress: Warning: RecomputeFieldValue.FieldOffset automatic substitution failed. The automatic substitution registration was attempted because a call to jdk.internal.misc.Unsafe.objectFieldOffset(Field) was detected in the static initializer of tech.v3.datatype.UnsafeUtil. Detailed failure reason(s): Could not determine the field where the value produced by the call to jdk.internal.misc.Unsafe.objectFieldOffset(Field) for the field offset computation is stored. The call is not directly followed by a field store or by a sign extend node followed directly by a field store.

phronmophobic 2021-06-17T09:22:43.058200Z

nice!

phronmophobic 2021-06-17T09:22:49.058500Z

that's actually a good sign

phronmophobic 2021-06-17T09:23:16.059200Z

I've noticed that when it prints that, it's past the part where it gets stuck sometimes

raspasov 2021-06-17T09:23:21.059400Z

Ok, error, but a bunch of output:

phronmophobic 2021-06-17T09:23:27.059600Z

dang

raspasov 2021-06-17T09:24:13.059900Z

raspasov@MBP mobiletest % ./scripts/compile-shared
+ set -e
+++ dirname ./scripts/compile-shared
++ cd ./scripts
++ pwd
+ DIR=/Users/raspasov/projects/github/mobiletest/scripts
+ cd /Users/raspasov/projects/github/mobiletest/scripts
+ PROJECT_DIR=/Users/raspasov/projects/github/mobiletest/scripts/..
+ cd ..
+ rm -rf ./classes
+ mkdir classes
+ clojure -X com.phronmophobic.mobiletest/compile-interface-class
+ clojure -X:depstar
[main] INFO hf.depstar.uberjar - Synchronizing pom.xml
Skipping paths: classes generated_classes native_test
[main] INFO hf.depstar.uberjar - Compiling com.phronmophobic.mobiletest ...
[main] INFO hf.depstar.uberjar - Compiling com.phronmophobic.mobiletest ...
[main] INFO hf.depstar.uberjar - Building uber jar: target/mobiletest-uber.jar
{:warning "could not find classpath entry", :path "generated_classes"}
{:warning "could not find classpath entry", :path "native_test"}
[main] INFO hf.depstar.uberjar - Processing pom.xml for {com.phronmophobic/mobiletest {:mvn/version "1.00-beta-1"}}
+ pushd library
~/projects/github/mobiletest/library ~/projects/github/mobiletest
+ /Library/Java/JavaVirtualMachines/graalvm-ce-java11-21.1.0/Contents/Home/bin/native-image --report-unsupported-elements-at-runtime --initialize-at-build-time --no-fallback --no-server -H:CompilerBackend=llvm -H:+ExitAfterRelocatableImageWrite -H:+SharedLibrary -H:+AddAllCharsets -H:+ReportExceptionStackTraces -H:-DeadlockWatchdogExitOnTimeout -H:DeadlockWatchdogInterval=0 -H:+RemoveSaturatedTypeFlows -H:-SpawnIsolates -H:PageSize=16384 -Djdk.internal.lambda.eagerlyInitialize=false -H:+ReportExceptionStackTraces -H:TempDirectory=/Users/raspasov/projects/github/mobiletest/scripts/../library/tmp -H:ReflectionConfigurationFiles=/Users/raspasov/projects/github/mobiletest/scripts/../conf/reflectionconfig-arm64-ios.json -H:JNIConfigurationFiles=/Users/raspasov/projects/github/mobiletest/scripts/../conf/jniconfig-arm64-ios.json -H:ResourceConfigurationFiles=/Users/raspasov/projects/github/mobiletest/scripts/../conf/resourceconfig-arm64-ios.json -J-Dclojure.spec.skip-macros=true -J-Xmx20G -J-XX:MaxDirectMemorySize=8G -J-Dclojure.compiler.direct-linking=true -J-Dtech.v3.datatype.graal-native=true -Dsvm.targetName=iOS -Dsvm.targetArch=arm64 -H:+UseCAPCache -H:CAPCacheDir=/Users/raspasov/projects/github/mobiletest/scripts/../conf/capcache '-Dsvm.platform=org.graalvm.nativeimage.Platform$IOS_AARCH64' -jar ../target/mobiletest-uber.jar -cp classes
[mobiletest-uber:10698]Ā Ā classlist: Ā 2,932.32 ms,Ā 0.95 GB
[mobiletest-uber:10698]Ā Ā Ā Ā (cap): Ā Ā 191.21 ms,Ā 0.95 GB
[mobiletest-uber:10698]Ā Ā Ā Ā setup: Ā 1,622.68 ms,Ā 0.95 GB
Warning: RecomputeFieldValue.FieldOffset automatic substitution failed. The automatic substitution registration was attempted because a call to jdk.internal.misc.Unsafe.objectFieldOffset(Field) was detected in the static initializer of tech.v3.datatype.UnsafeUtil. Detailed failure reason(s): Could not determine the field where the value produced by the call to jdk.internal.misc.Unsafe.objectFieldOffset(Field) for the field offset computation is stored. The call is not directly followed by a field store or by a sign extend node followed directly by a field store.Ā 
[mobiletest-uber:10698] Ā Ā (clinit): Ā Ā 362.14 ms,Ā 2.69 GB
[mobiletest-uber:10698] Ā (typeflow): Ā 9,919.26 ms,Ā 2.69 GB
[mobiletest-uber:10698]Ā Ā (objects):Ā 10,759.01 ms,Ā 2.69 GB
[mobiletest-uber:10698] Ā (features): Ā 1,717.75 ms,Ā 2.69 GB
[mobiletest-uber:10698] Ā Ā analysis:Ā 23,893.47 ms,Ā 2.69 GB
[mobiletest-uber:10698] Ā Ā universe: Ā Ā 994.07 ms,Ā 3.86 GB
[mobiletest-uber:10698]Ā Ā Ā (parse): Ā 1,572.44 ms,Ā 3.86 GB
[mobiletest-uber:10698] Ā Ā (inline): Ā 5,622.28 ms,Ā 4.49 GB
[mobiletest-uber:10698]Ā Ā (compile): Ā 1,329.01 ms,Ā 4.49 GB
[mobiletest-uber:10698]Ā Ā Ā compile: Ā 8,696.35 ms,Ā 4.49 GB
7 fatal errors detected:

raspasov 2021-06-17T09:24:31.060200Z

Fatal error:org.graalvm.compiler.graph.GraalGraphError: java.lang.NoClassDefFoundError: Could not initialize class com.oracle.svm.core.graal.llvm.LLVMFeature$LLVMVersionChecker
	at node: 6|Conditional { stamp=i32 [0 - 1] ā‡ˆ0000000000000001,Ā }
	at method: void com.oracle.svm.core.graal.snippets.StackOverflowCheckSnippets.throwCachedStackOverflowError()Ā [Direct call from void FunctionPointerLogHandler.fatalError()]
	at com.oracle.svm.core.graal.llvm.NodeLLVMBuilder.doBlock(NodeLLVMBuilder.java:291)
	at com.oracle.svm.core.graal.llvm.SubstrateLLVMBackend.generate(SubstrateLLVMBackend.java:147)
	at com.oracle.svm.core.graal.llvm.SubstrateLLVMBackend.emitLLVM(SubstrateLLVMBackend.java:123)
	at com.oracle.svm.core.graal.llvm.SubstrateLLVMBackend.emitBackEnd(SubstrateLLVMBackend.java:103)
	at jdk.internal.vm.compiler/org.graalvm.compiler.core.GraalCompiler.compile(GraalCompiler.java:146)
	at jdk.internal.vm.compiler/org.graalvm.compiler.core.GraalCompiler.compileGraph(GraalCompiler.java:130)
	at com.oracle.svm.hosted.code.CompileQueue.defaultCompileFunction(CompileQueue.java:998)
	at com.oracle.svm.hosted.code.CompileQueue.doCompile(CompileQueue.java:960)
	at com.oracle.svm.hosted.code.CompileQueue$CompileTask.run(CompileQueue.java:265)
	at com.oracle.graal.pointsto.util.CompletionExecutor.lambda$execute$0(CompletionExecutor.java:173)
	at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.oracle.svm.core.graal.llvm.LLVMFeature$LLVMVersionChecker
	at com.oracle.svm.core.graal.llvm.LLVMGenerator.emitConditionalMove(LLVMGenerator.java:646)
	at com.oracle.svm.core.graal.llvm.NodeLLVMBuilder.emitConditional(NodeLLVMBuilder.java:395)
	at jdk.internal.vm.compiler/org.graalvm.compiler.nodes.calc.ConditionalNode.generate(ConditionalNode.java:297)
	at com.oracle.svm.core.graal.llvm.NodeLLVMBuilder.emitNode(NodeLLVMBuilder.java:327)
	at com.oracle.svm.core.graal.llvm.NodeLLVMBuilder.doBlock(NodeLLVMBuilder.java:287)
	... 15 more
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.
	at node: 61|Conditional { stamp=i32 [0 - 1] ā‡ˆ0000000000000001,Ā }
	at method: void com.oracle.svm.core.thread.VMThreads.detachThread(IsolateThread)Ā [Direct call from int CEntryPointSnippets.detachThreadMT(IsolateThread)]
	at com.oracle.svm.core.graal.llvm.NodeLLVMBuilder.doBlock(NodeLLVMBuilder.java:291)
	at com.oracle.svm.core.graal.llvm.SubstrateLLVMBackend.generate(SubstrateLLVMBackend.java:147)
	at com.oracle.svm.core.graal.llvm.SubstrateLLVMBackend.emitLLVM(SubstrateLLVMBackend.java:123)
	at com.oracle.svm.core.graal.llvm.SubstrateLLVMBackend.emitBackEnd(SubstrateLLVMBackend.java:103)
	at jdk.internal.vm.compiler/org.graalvm.compiler.core.GraalCompiler.compile(GraalCompiler.java:146)
	at jdk.internal.vm.compiler/org.graalvm.compiler.core.GraalCompiler.compileGraph(GraalCompiler.java:130)
	at com.oracle.svm.hosted.code.CompileQueue.defaultCompileFunction(CompileQueue.java:998)
	at com.oracle.svm.hosted.code.CompileQueue.doCompile(CompileQueue.java:960)
	at com.oracle.svm.hosted.code.CompileQueue$CompileTask.run(CompileQueue.java:265)
	at com.oracle.graal.pointsto.util.CompletionExecutor.lambda$execute$0(CompletionExecutor.java:173)
	at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Caused by: com.oracle.svm.core.util.UserError$UserException: Using the LLVM backend requires LLVM to be installed on your machine.
	at com.oracle.svm.core.util.UserError.abort(UserError.java:68)
	at com.oracle.svm.core.graal.llvm.LLVMFeature$LLVMVersionChecker.getLLVMVersion(LLVMFeature.java:149)
	at com.oracle.svm.core.graal.llvm.LLVMFeature$LLVMVersionChecker.<clinit>(LLVMFeature.java:135)
	at com.oracle.svm.core.graal.llvm.LLVMGenerator.emitConditionalMove(LLVMGenerator.java:646)
	at com.oracle.svm.core.graal.llvm.NodeLLVMBuilder.emitConditional(NodeLLVMBuilder.java:395)
	at jdk.internal.vm.compiler/org.graalvm.compiler.nodes.calc.ConditionalNode.generate(ConditionalNode.java:297)
	at com.oracle.svm.core.graal.llvm.NodeLLVMBuilder.emitNode(NodeLLVMBuilder.java:327)
	at com.oracle.svm.core.graal.llvm.NodeLLVMBuilder.doBlock(NodeLLVMBuilder.java:287)
	... 15 more

raspasov 2021-06-17T09:24:39.060400Z

Fatal error:org.graalvm.compiler.graph.GraalGraphError: java.lang.NoClassDefFoundError: Could not initialize class com.oracle.svm.core.graal.llvm.LLVMFeature$LLVMVersionChecker
	at node: 119|Conditional { stamp=i32 [-1 - 2] ā‡Š0000000000000002,Ā }
	at method: int com.oracle.svm.core.graal.snippets.CEntryPointSnippets.initializeIsolate(CEntryPointCreateIsolateParameters)Ā [Direct call from int CEntryPointNativeFunctions.createIsolate(CEntryPointCreateIsolateParameters, CEntryPointNativeFunctions$IsolatePointer, CEntryPointNativeFunctions$IsolateThreadPointer)]
	at com.oracle.svm.core.graal.llvm.NodeLLVMBuilder.doBlock(NodeLLVMBuilder.java:291)
	at com.oracle.svm.core.graal.llvm.SubstrateLLVMBackend.generate(SubstrateLLVMBackend.java:147)
	at com.oracle.svm.core.graal.llvm.SubstrateLLVMBackend.emitLLVM(SubstrateLLVMBackend.java:123)
	at com.oracle.svm.core.graal.llvm.SubstrateLLVMBackend.emitBackEnd(SubstrateLLVMBackend.java:103)
	at jdk.internal.vm.compiler/org.graalvm.compiler.core.GraalCompiler.compile(GraalCompiler.java:146)
	at jdk.internal.vm.compiler/org.graalvm.compiler.core.GraalCompiler.compileGraph(GraalCompiler.java:130)
	at com.oracle.svm.hosted.code.CompileQueue.defaultCompileFunction(CompileQueue.java:998)
	at com.oracle.svm.hosted.code.CompileQueue.doCompile(CompileQueue.java:960)
	at com.oracle.svm.hosted.code.CompileQueue$CompileTask.run(CompileQueue.java:265)
	at com.oracle.graal.pointsto.util.CompletionExecutor.lambda$execute$0(CompletionExecutor.java:173)
	at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.oracle.svm.core.graal.llvm.LLVMFeature$LLVMVersionChecker
	at com.oracle.svm.core.graal.llvm.LLVMGenerator.emitConditionalMove(LLVMGenerator.java:646)
	at com.oracle.svm.core.graal.llvm.NodeLLVMBuilder.emitConditional(NodeLLVMBuilder.java:395)
	at jdk.internal.vm.compiler/org.graalvm.compiler.nodes.calc.ConditionalNode.generate(ConditionalNode.java:297)
	at com.oracle.svm.core.graal.llvm.NodeLLVMBuilder.emitNode(NodeLLVMBuilder.java:327)
	at com.oracle.svm.core.graal.llvm.NodeLLVMBuilder.doBlock(NodeLLVMBuilder.java:287)
	... 15 more
Fatal error:org.graalvm.compiler.graph.GraalGraphError: java.lang.NoClassDefFoundError: Could not initialize class com.oracle.svm.core.graal.llvm.LLVMFeature$LLVMVersionChecker
	at node: 5|Conditional { stamp=i32 [0 - 1] ā‡ˆ0000000000000001,Ā }
	at method: void com.oracle.svm.core.graal.snippets.StackOverflowCheckSnippets.throwNewStackOverflowError()Ā [Direct call from void CEntryPointSnippets.ensureJavaThread()]
	at com.oracle.svm.core.graal.llvm.NodeLLVMBuilder.doBlock(NodeLLVMBuilder.java:291)
	at com.oracle.svm.core.graal.llvm.SubstrateLLVMBackend.generate(SubstrateLLVMBackend.java:147)
	at com.oracle.svm.core.graal.llvm.SubstrateLLVMBackend.emitLLVM(SubstrateLLVMBackend.java:123)
	at com.oracle.svm.core.graal.llvm.SubstrateLLVMBackend.emitBackEnd(SubstrateLLVMBackend.java:103)
	at jdk.internal.vm.compiler/org.graalvm.compiler.core.GraalCompiler.compile(GraalCompiler.java:146)
	at jdk.internal.vm.compiler/org.graalvm.compiler.core.GraalCompiler.compileGraph(GraalCompiler.java:130)
	at com.oracle.svm.hosted.code.CompileQueue.defaultCompileFunction(CompileQueue.java:998)
	at com.oracle.svm.hosted.code.CompileQueue.doCompile(CompileQueue.java:960)
	at com.oracle.svm.hosted.code.CompileQueue$CompileTask.run(CompileQueue.java:265)
	at com.oracle.graal.pointsto.util.CompletionExecutor.lambda$execute$0(CompletionExecutor.java:173)
	at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.oracle.svm.core.graal.llvm.LLVMFeature$LLVMVersionChecker
	at com.oracle.svm.core.graal.llvm.LLVMGenerator.emitConditionalMove(LLVMGenerator.java:646)
	at com.oracle.svm.core.graal.llvm.NodeLLVMBuilder.emitConditional(NodeLLVMBuilder.java:395)
	at jdk.internal.vm.compiler/org.graalvm.compiler.nodes.calc.ConditionalNode.generate(ConditionalNode.java:297)
	at com.oracle.svm.core.graal.llvm.NodeLLVMBuilder.emitNode(NodeLLVMBuilder.java:327)
	at com.oracle.svm.core.graal.llvm.NodeLLVMBuilder.doBlock(NodeLLVMBuilder.java:287)
	... 15 more
Fatal error:org.graalvm.compiler.graph.GraalGraphError: java.lang.NoClassDefFoundError: Could not initialize class com.oracle.svm.core.graal.llvm.LLVMFeature$LLVMVersionChecker
	at node: 167|Conditional { stamp=i32 [0 - 1] ā‡ˆ0000000000000001,Ā }
	at method: JNIObjectHandle com.oracle.svm.jni.functions.JNIFunctions.AllocObject(JNIEnvironment, JNIObjectHandle)Ā [Direct call from JNIObjectHandle IsolateEnterStub.JNIFunctions_AllocObject_fd679b648ff7a5bbe75e2b56d7c12125e4e73817(JNIEnvironment, JNIObjectHandle)]
	at com.oracle.svm.core.graal.llvm.NodeLLVMBuilder.doBlock(NodeLLVMBuilder.java:291)
	at com.oracle.svm.core.graal.llvm.SubstrateLLVMBackend.generate(SubstrateLLVMBackend.java:147)
	at com.oracle.svm.core.graal.llvm.SubstrateLLVMBackend.emitLLVM(SubstrateLLVMBackend.java:123)
	at com.oracle.svm.core.graal.llvm.SubstrateLLVMBackend.emitBackEnd(SubstrateLLVMBackend.java:103)
	at jdk.internal.vm.compiler/org.graalvm.compiler.core.GraalCompiler.compile(GraalCompiler.java:146)
	at jdk.internal.vm.compiler/org.graalvm.compiler.core.GraalCompiler.compileGraph(GraalCompiler.java:130)
	at com.oracle.svm.hosted.code.CompileQueue.defaultCompileFunction(CompileQueue.java:998)
	at com.oracle.svm.hosted.code.CompileQueue.doCompile(CompileQueue.java:960)
	at com.oracle.svm.hosted.code.CompileQueue$CompileTask.run(CompileQueue.java:265)
	at com.oracle.graal.pointsto.util.CompletionExecutor.lambda$execute$0(CompletionExecutor.java:173)
	at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.oracle.svm.core.graal.llvm.LLVMFeature$LLVMVersionChecker
	at com.oracle.svm.core.graal.llvm.LLVMGenerator.emitConditionalMove(LLVMGenerator.java:646)
	at com.oracle.svm.core.graal.llvm.NodeLLVMBuilder.emitConditional(NodeLLVMBuilder.java:395)
	at jdk.internal.vm.compiler/org.graalvm.compiler.nodes.calc.ConditionalNode.generate(ConditionalNode.java:297)
	at com.oracle.svm.core.graal.llvm.NodeLLVMBuilder.emitNode(NodeLLVMBuilder.java:327)
	at com.oracle.svm.core.graal.llvm.NodeLLVMBuilder.doBlock(NodeLLVMBuilder.java:287)
	... 15 more
Fatal error:org.graalvm.compiler.graph.GraalGraphError: java.lang.NoClassDefFoundError: Could not initialize class com.oracle.svm.core.graal.llvm.LLVMFeature$LLVMVersionChecker
	at node: 34|Conditional { stamp=i32 [0 - 1] ā‡ˆ0000000000000001,Ā }
	at method: void com.oracle.svm.core.thread.Safepoint.enterSlowPathSafepointCheck()Ā [Direct call from void CEntryPointSnippets.ensureJavaThread()]
	at com.oracle.svm.core.graal.llvm.NodeLLVMBuilder.doBlock(NodeLLVMBuilder.java:291)
	at com.oracle.svm.core.graal.llvm.SubstrateLLVMBackend.generate(SubstrateLLVMBackend.java:147)
	at com.oracle.svm.core.graal.llvm.SubstrateLLVMBackend.emitLLVM(SubstrateLLVMBackend.java:123)
	at com.oracle.svm.core.graal.llvm.SubstrateLLVMBackend.emitBackEnd(SubstrateLLVMBackend.java:103)
	at jdk.internal.vm.compiler/org.graalvm.compiler.core.GraalCompiler.compile(GraalCompiler.java:146)
	at jdk.internal.vm.compiler/org.graalvm.compiler.core.GraalCompiler.compileGraph(GraalCompiler.java:130)
	at com.oracle.svm.hosted.code.CompileQueue.defaultCompileFunction(CompileQueue.java:998)
	at com.oracle.svm.hosted.code.CompileQueue.doCompile(CompileQueue.java:960)
	at com.oracle.svm.hosted.code.CompileQueue$CompileTask.run(CompileQueue.java:265)
	at com.oracle.graal.pointsto.util.CompletionExecutor.lambda$execute$0(CompletionExecutor.java:173)
	at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.oracle.svm.core.graal.llvm.LLVMFeature$LLVMVersionChecker
	at com.oracle.svm.core.graal.llvm.LLVMGenerator.emitConditionalMove(LLVMGenerator.java:646)
	at com.oracle.svm.core.graal.llvm.NodeLLVMBuilder.emitConditional(NodeLLVMBuilder.java:395)
	at jdk.internal.vm.compiler/org.graalvm.compiler.nodes.calc.ConditionalNode.generate(ConditionalNode.java:297)
	at com.oracle.svm.core.graal.llvm.NodeLLVMBuilder.emitNode(NodeLLVMBuilder.java:327)
	at com.oracle.svm.core.graal.llvm.NodeLLVMBuilder.doBlock(NodeLLVMBuilder.java:287)
	... 15 more

raspasov 2021-06-17T09:24:40.060600Z

Fatal error:org.graalvm.compiler.graph.GraalGraphError: java.lang.NoClassDefFoundError: Could not initialize class com.oracle.svm.core.graal.llvm.LLVMFeature$LLVMVersionChecker
	at node: 42|Conditional { stamp=i32 [0 - 1] ā‡ˆ0000000000000001,Ā }
	at method: void com.oracle.svm.core.thread.Safepoint.enterSlowPathTransitionFromNativeToNewStatus(int)Ā [Direct call from IsolateThread IsolateEnterStub.CEntryPointBuiltins_createIsolate_315bd7239ea2b5ed6515910416de2648c30349ea()]
	at com.oracle.svm.core.graal.llvm.NodeLLVMBuilder.doBlock(NodeLLVMBuilder.java:291)
	at com.oracle.svm.core.graal.llvm.SubstrateLLVMBackend.generate(SubstrateLLVMBackend.java:147)
	at com.oracle.svm.core.graal.llvm.SubstrateLLVMBackend.emitLLVM(SubstrateLLVMBackend.java:123)
	at com.oracle.svm.core.graal.llvm.SubstrateLLVMBackend.emitBackEnd(SubstrateLLVMBackend.java:103)
	at jdk.internal.vm.compiler/org.graalvm.compiler.core.GraalCompiler.compile(GraalCompiler.java:146)
	at jdk.internal.vm.compiler/org.graalvm.compiler.core.GraalCompiler.compileGraph(GraalCompiler.java:130)
	at com.oracle.svm.hosted.code.CompileQueue.defaultCompileFunction(CompileQueue.java:998)
	at com.oracle.svm.hosted.code.CompileQueue.doCompile(CompileQueue.java:960)
	at com.oracle.svm.hosted.code.CompileQueue$CompileTask.run(CompileQueue.java:265)
	at com.oracle.graal.pointsto.util.CompletionExecutor.lambda$execute$0(CompletionExecutor.java:173)
	at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.oracle.svm.core.graal.llvm.LLVMFeature$LLVMVersionChecker
	at com.oracle.svm.core.graal.llvm.LLVMGenerator.emitConditionalMove(LLVMGenerator.java:646)
	at com.oracle.svm.core.graal.llvm.NodeLLVMBuilder.emitConditional(NodeLLVMBuilder.java:395)
	at jdk.internal.vm.compiler/org.graalvm.compiler.nodes.calc.ConditionalNode.generate(ConditionalNode.java:297)
	at com.oracle.svm.core.graal.llvm.NodeLLVMBuilder.emitNode(NodeLLVMBuilder.java:327)
	at com.oracle.svm.core.graal.llvm.NodeLLVMBuilder.doBlock(NodeLLVMBuilder.java:287)
	... 15 more
Error: Image build request failed with exit status 1

raspasov 2021-06-17T09:25:09.060900Z

Does not like something about LLVM.

phronmophobic 2021-06-17T09:25:15.061100Z

yea

phronmophobic 2021-06-17T09:25:19.061300Z

that's a new error to me

phronmophobic 2021-06-17T09:25:36.061600Z

oh

phronmophobic 2021-06-17T09:25:59.062Z

I think I might know what it is. one sec

šŸ‘Œ 1
phronmophobic 2021-06-17T09:26:28.062400Z

from https://www.graalvm.org/reference-manual/native-image/LLVMBackend/ gu install llvm-toolchain

phronmophobic 2021-06-17T09:26:38.062900Z

that should definitely be in the Readme somewhere

raspasov 2021-06-17T09:26:41.063Z

Trying that command.

raspasov 2021-06-17T09:27:10.063300Z

Is it a good idea to be nuking the /library folder every time?

phronmophobic 2021-06-17T09:27:21.063600Z

probably

raspasov 2021-06-17T09:27:32.063800Z

Ok!

phronmophobic 2021-06-17T09:28:12.064100Z

that's probably worth putting in the script

raspasov 2021-06-17T09:28:28.064500Z

Yes, canā€™t hurt.

raspasov 2021-06-17T09:30:17.065400Z

Hmm it seems to be getting stuck again at that previous spot. Unpredictable.

phronmophobic 2021-06-17T09:31:30.065900Z

I guess if it gets stuck before the Warning: RecomputeFieldValue.FieldOffset, then it's worth restarting

raspasov 2021-06-17T09:31:46.066100Z

Yesā€¦

raspasov 2021-06-17T09:32:10.066500Z

So weird why it would do that. Have you seen that before?

phronmophobic 2021-06-17T09:33:33.066900Z

yea. I have noticed it getting stuck there before

phronmophobic 2021-06-17T09:33:36.067100Z

šŸ˜•

raspasov 2021-06-17T09:34:14.067400Z

Ok, restarting once without nuking /library made it go forward.

raspasov 2021-06-17T09:34:23.067700Z

(thatā€™s a guess as to the cause)

phronmophobic 2021-06-17T09:34:45.068Z

interesting

raspasov 2021-06-17T09:34:58.068500Z

Perhaps you need to run it once, and then one more time.

phronmophobic 2021-06-17T09:35:16.069Z

I thought I noticed happening less often, but I could never tell if it was just random or not

raspasov 2021-06-17T09:35:43.069400Z

Seems to be going through the steps.

raspasov 2021-06-17T09:35:52.069600Z

[mobiletest-uber:11153]Ā Ā classlist: Ā 2,731.31 ms,Ā 1.20 GB
[mobiletest-uber:11153]Ā Ā Ā Ā (cap): Ā Ā 232.85 ms,Ā 1.20 GB
[mobiletest-uber:11153]Ā Ā Ā Ā setup: Ā 1,997.64 ms,Ā 1.20 GB
Warning: RecomputeFieldValue.FieldOffset automatic substitution failed. The automatic substitution registration was attempted because a call to jdk.internal.misc.Unsafe.objectFieldOffset(Field) was detected in the static initializer of tech.v3.datatype.UnsafeUtil. Detailed failure reason(s): Could not determine the field where the value produced by the call to jdk.internal.misc.Unsafe.objectFieldOffset(Field) for the field offset computation is stored. The call is not directly followed by a field store or by a sign extend node followed directly by a field store.Ā 
[mobiletest-uber:11153] Ā Ā (clinit): Ā Ā 394.12 ms,Ā 4.66 GB
[mobiletest-uber:11153] Ā (typeflow): Ā 9,692.06 ms,Ā 4.66 GB
[mobiletest-uber:11153]Ā Ā (objects):Ā 11,286.21 ms,Ā 4.66 GB
[mobiletest-uber:11153] Ā (features): Ā 1,601.63 ms,Ā 4.66 GB
[mobiletest-uber:11153] Ā Ā analysis:Ā 24,224.42 ms,Ā 4.66 GB
[mobiletest-uber:11153] Ā Ā universe: Ā 1,081.17 ms,Ā 4.66 GB
[mobiletest-uber:11153]Ā Ā Ā (parse): Ā 2,090.61 ms,Ā 4.66 GB
[mobiletest-uber:11153] Ā Ā (inline): Ā 3,401.28 ms,Ā 4.66 GB
[mobiletest-uber:11153]Ā Ā (compile):Ā 21,491.40 ms,Ā 7.37 GB
[mobiletest-uber:11153]Ā Ā (bitcode): Ā 1,810.94 ms,Ā 7.37 GB
[mobiletest-uber:11153]Ā Ā (prelink): Ā 4,937.09 ms,Ā 7.37 GB

1
raspasov 2021-06-17T09:36:34.070100Z

I think it completed well:

raspasov 2021-06-17T09:36:37.070300Z

# Printing build artifacts to: mobiletest-uber.build_artifacts.txt
[mobiletest-uber:11153]Ā Ā Ā [total]: 136,380.22 ms,Ā 7.61 GB
+ rm -rf ./build/out
+ mkdir -p build/out
++ find . -name llvm.o -print0
++ xargs -r -0 ls -1 -t
++ head -1
+ LLVM_PATH=./tmp/SVM-1623922437105/llvm/llvm.o
+ cp ./tmp/SVM-1623922437105/llvm/llvm.o build/out
++ find . -name mobiletest-uber.o -print0
++ xargs -r -0 ls -1 -t
++ head -1
+ MOBILETEST_PATH=./tmp/SVM-1623922437105/mobiletest-uber.o
+ cp ./tmp/SVM-1623922437105/mobiletest-uber.o build/out
+ popd
~/projects/github/mobiletest

phronmophobic 2021-06-17T09:36:45.070500Z

šŸŽ‰

phronmophobic 2021-06-17T09:36:49.070700Z

yep

raspasov 2021-06-17T09:37:03.071Z

Ok, XCode next?

šŸ‘ 1
raspasov 2021-06-17T09:39:12.071500Z

XCode error:

ld: warning: directory not found for option '-L/Library/Java/JavaVirtualMachines/graalvm-ce-java11-21.1.0/Contents/Home/lib/svm/clibraries/ios-arm64'
ld: library not found for -ljvm

phronmophobic 2021-06-17T09:41:19.071700Z

interesting

raspasov 2021-06-17T09:41:28.072Z

Something about the paths

phronmophobic 2021-06-17T09:41:31.072300Z

MacBook-Air:mobiletest adrian$ ls '/Library/Java/JavaVirtualMachines/graalvm-ce-java11-21.1.0/Contents/Home/lib/svm/clibraries/ios-arm64'
clibraries-ios-arm64.md5	libffi.a			liblibchelper.a
libdarwin.a			libjvm.a			libstrictmath.a

raspasov 2021-06-17T09:42:34.072800Z

I am missing the ā€œios-arm64ā€ directory

raspasov 2021-06-17T09:43:04.073Z

raspasov@MBP ~ % ls '/Library/Java/JavaVirtualMachines/graalvm-ce-java11-21.1.0/Contents/Home/lib/svm/clibraries/ios-arm64'
ls: /Library/Java/JavaVirtualMachines/graalvm-ce-java11-21.1.0/Contents/Home/lib/svm/clibraries/ios-arm64: No such file or directory
raspasov@MBP ~ %

raspasov 2021-06-17T09:43:17.073500Z

Perhaps need to install something?

phronmophobic 2021-06-17T09:43:19.073600Z

is that the right graalvm path?

raspasov 2021-06-17T09:43:25.073900Z

Yesā€¦

raspasov 2021-06-17T09:43:40.074100Z

raspasov@MBP ~ % ls /Library/Java/JavaVirtualMachines/graalvm-ce-java11-21.1.0/Contents/Home/lib/svm/clibraries/
darwin-amd64

raspasov 2021-06-17T09:43:54.074400Z

^^ path exists up to ā€œclibrariesā€

phronmophobic 2021-06-17T09:44:10.074600Z

ok

phronmophobic 2021-06-17T09:44:35.074900Z

let's see if I can figure out how I got those clibraries

phronmophobic 2021-06-17T09:46:31.075200Z

MacBook-Air:mobiletest adrian$ cd '/Library/Java/JavaVirtualMachines/graalvm-ce-java11-21.1.0/Contents/Home/lib/svm/'
MacBook-Air:svm adrian$ ls
LICENSE_NATIVEIMAGE.txt	builder			clibraries.zip		macros
bin			clibraries		library-support.jar
MacBook-Air:svm adrian$ ls -lt
total 320
drwxr-xr-x   4 adrian  staff    128 Jun  5 23:18 clibraries
-rw-r--r--   1 adrian  staff  75393 Jun  5 23:18 clibraries.zip
drwxr-xr-x  16 adrian  staff    512 May  9 23:30 macros
drwxr-xr-x   4 adrian  staff    128 May  9 23:30 bin
-rw-r--r--   1 adrian  staff  21035 May  9 23:30 LICENSE_NATIVEIMAGE.txt
drwxr-xr-x  11 adrian  staff    352 May  9 23:23 builder
-rw-r--r--   1 adrian  staff  59506 Apr 16 04:41 library-support.jar

raspasov 2021-06-17T09:46:51.075600Z

Btw, are you on Intel or Arm mac?

phronmophobic 2021-06-17T09:47:03.076100Z

I'm on Arm/M1

raspasov 2021-06-17T09:47:05.076300Z

(not sure if that makes a difference)

phronmophobic 2021-06-17T09:47:13.076700Z

it looks like I got that clibraries on June 5th

phronmophobic 2021-06-17T09:48:43.077300Z

before trying with clojure

phronmophobic 2021-06-17T09:48:48.077500Z

I tried Gluon Mobile

phronmophobic 2021-06-17T09:49:10.077800Z

and it looks like their maven plugin modified my setup

raspasov 2021-06-17T09:49:55.078300Z

Iā€™ve seen the Gluon Mobile, what is it exactly?

raspasov 2021-06-17T09:50:10.078500Z

And how does it relate to GraalVM?

phronmophobic 2021-06-17T09:50:49.079200Z

They don't make it easy to decipher, but I think it's an implementation of JavaFX and some other stuff that runs iOS/android

raspasov 2021-06-17T09:51:03.079500Z

Does it use GraalVM under the hood?

phronmophobic 2021-06-17T09:51:08.079800Z

it does

phronmophobic 2021-06-17T09:51:19.080300Z

I've tried to exclude any proprietary stuff

raspasov 2021-06-17T09:51:24.080500Z

Got it, so a wrapper on top of GraalVM to help run some Java stuff.

phronmophobic 2021-06-17T09:51:41.080800Z

specifically the javaFX libraries I think

raspasov 2021-06-17T09:51:55.081400Z

ā€¦ to help run JavaFX on mobile.

phronmophobic 2021-06-17T09:52:08.081900Z

they have included some updates to the JVM implementation for mobile as well

raspasov 2021-06-17T09:52:11.082100Z

(never used javaFX myself)

phronmophobic 2021-06-17T09:52:17.082300Z

but most of those changes are released under GPL

phronmophobic 2021-06-17T09:52:22.082500Z

I think

phronmophobic 2021-06-17T09:52:51.083Z

they're integrating those back in to the regular JVM repo afaik

raspasov 2021-06-17T09:53:38.084100Z

Got it; alright Iā€™ll google around as well about the missing ā€œios-arm64ā€ directory.

raspasov 2021-06-17T09:54:04.084700Z

You think you got it through Gluon Mobile or unsure?

phronmophobic 2021-06-17T09:54:24.084900Z

anyway, the clibs can be downloaded from https://download2.gluonhq.com/substrate/clibs/ios-arm64.zip

raspasov 2021-06-17T09:54:34.085100Z

Aha!

phronmophobic 2021-06-17T09:55:51.086200Z

I referenced their maven plugin to figure out how to compile for iOS

raspasov 2021-06-17T09:56:16.086300Z

Aaaand weā€™re liveā€¦ ā€œHello, world!ā€

phronmophobic 2021-06-17T09:56:21.086700Z

whoo!

phronmophobic 2021-06-17T09:56:28.086900Z

did it print anything to console?

raspasov 2021-06-17T09:56:34.087100Z

ā€œhello42ā€ 2021-06-17 02:55:22.904126-0700 MobileTest[12654:4364688] the result is: 42 2021-06-17 02:55:22.904233-0700 MobileTest[12654:4364688] the result is: 42

phronmophobic 2021-06-17T09:56:42.087400Z

šŸŽ‰

raspasov 2021-06-17T09:57:02.087800Z

šŸ’„

phronmophobic 2021-06-17T09:57:03.087900Z

so you have clojure running on your device now

raspasov 2021-06-17T09:57:19.088400Z

Very nice! Thank you! šŸ™‚

phronmophobic 2021-06-17T09:57:32.088900Z

now I just need to go back through the chat and improve the docs

raspasov 2021-06-17T09:58:51.090Z

Looking at the project, which Clojure code is being executed?

phronmophobic 2021-06-17T09:58:51.090100Z

oh, I haven't pushed my changes that starts the nrepl socket server

raspasov 2021-06-17T09:59:02.090500Z

NSLog("the result is: %d",result2);

raspasov 2021-06-17T09:59:21.091Z

(because I see this is printed from Swift)

raspasov 2021-06-17T09:59:48.091700Z

Wow, ok.

raspasov 2021-06-17T09:59:53.091900Z

Eval? String?

raspasov 2021-06-17T09:59:59.092200Z

For real? šŸ™‚ That works??

raspasov 2021-06-17T10:00:13.092500Z

On iOS?

raspasov 2021-06-17T10:00:18.092700Z

Is it expected to work like that?

phronmophobic 2021-06-17T10:00:39.093100Z

call_eval calls into https://github.com/phronmophobic/mobiletest/blob/main/xcode/MobileTest/csource/Bridge.c#L63 which calls into clj_eval in the clojure file

phronmophobic 2021-06-17T10:00:56.093600Z

yea, I was surprised too. Thanks to the magic of sci

raspasov 2021-06-17T10:01:13.093900Z

So is this like ā€¦compiled Clojure or interpreted?

phronmophobic 2021-06-17T10:01:27.094100Z

the eval is interpreted by sci

phronmophobic 2021-06-17T10:01:32.094300Z

but sci is compiled to native

raspasov 2021-06-17T10:01:42.094500Z

This is totally wild šŸ™‚

1
raspasov 2021-06-17T10:03:09.095500Z

So do we get full Clojure here or Sci? (sorry, I am not very familiar with sci, need to learn more)

borkdude 2021-06-17T10:03:37.095900Z

https://github.com/borkdude/sci you get sci, but you can hook it up to whatever Clojure library you want

borkdude 2021-06-17T10:04:09.097Z

Should be fun for making a 4clojure app in ios or so

phronmophobic 2021-06-17T10:04:09.097100Z

right. the union of whatever is graalvm compatible or can be executed by sci

borkdude 2021-06-17T10:04:38.097400Z

or exposing the nrepl server to do whatever from a distance

borkdude 2021-06-17T10:05:01.097900Z

like, making a picture when you tell it to? dunno ;)

raspasov 2021-06-17T10:06:09.099100Z

That is totally wild I gotta say šŸ™‚ Is there a big performance penalty, do you expect to be able to just code a full app with this at this point?

phronmophobic 2021-06-17T10:06:52.099600Z

not totally sure, but I think so. phones are pretty powerful these days

borkdude 2021-06-17T10:07:21.100200Z

@raspasov if you are familiar with babashka, it's the same interpreter. performance is pretty good for say, replacing bash scripts

borkdude 2021-06-17T10:07:53.101200Z

you can try this "full stack app" in babashka + scittle (the CLJS version of sci): https://github.com/kloimhardt/babashka-scittle-guestbook

raspasov 2021-06-17T10:08:10.101600Z

Got it, cool šŸ™‚

borkdude 2021-06-17T10:08:51.102700Z

The thing where it becomes noticeably slower is when you have a loop with 1M iterations. In sci this can take 500ms whereas in Clojure it's only 20ms for example, because Clojure emits direct bytecode.

raspasov 2021-06-17T10:08:51.102800Z

@smith.adriane what about that demo where you had some UI, was this using the same method?

borkdude 2021-06-17T10:09:49.104400Z

But note that the functions you can hook into sci can be natively compiled, so you only pay the performance penalty for the "glue" code

raspasov 2021-06-17T10:10:07.105100Z

@borkdude understood; That much looping is actually rare in a mobile app; so for some UI dev work definitely useable, I assume.

phronmophobic 2021-06-17T10:10:55.106400Z

more or less. I also linked in a graphics library called skia. I have a cross platform UI library that can draw render using skia.

phronmophobic 2021-06-17T10:11:19.107200Z

not sure itā€™s ready for general use, but youā€™re welcome to try

raspasov 2021-06-17T10:12:07.108Z

So you can actually get a REPL running in this? So actually do dev work, like change the UI, etc? Youā€™d need some way to constantly serve the updated code, ala figwheel-main, shadow-cljs etc I assume.

phronmophobic 2021-06-17T10:13:00.108300Z

babashka has a nrepl compatible server

phronmophobic 2021-06-17T10:13:25.109200Z

I use emacs/cider, so it "just worked" for me

raspasov 2021-06-17T10:13:40.109900Z

That should be no problem then, yes.

borkdude 2021-06-17T10:14:02.110700Z

to do actual dev work, it depends what is evaluated at runtime and what is baked statically into the binary

raspasov 2021-06-17T10:14:33.111400Z

@borkdude thatā€™s a good pointā€¦ Wonder if thereā€™s gonna be a difference there between UIKit and SwiftUI

raspasov 2021-06-17T10:14:51.111900Z

UIKit/Objective-C is very dynamic, I think you can do almost anything at runtime.

raspasov 2021-06-17T10:14:59.112200Z

Not sure about SwiftUI though.

raspasov 2021-06-17T10:16:33.113300Z

I lack enough knowledge about the Objective-C runtime/Swift itself to say with 100% certainty.

raspasov 2021-06-17T10:17:19.114100Z

But definitely very cool, wide open possibilities šŸ™‚

phronmophobic 2021-06-17T10:18:33.115400Z

just pushed my changes that start an nrepl server

raspasov 2021-06-17T10:18:45.115800Z

@smith.adriane Do you have an end goal with this experiment, or itā€™s just an exploration? I think if you can actually code native UIā€™s through Clojure, that can serve a niche, even if small.

raspasov 2021-06-17T10:19:35.116300Z

Ok, Iā€™ll pull.

borkdude 2021-06-17T10:19:58.116900Z

How do you guys deploy the app to your phone? I have 0 experience with mobile, but I do have an iPhone :)

raspasov 2021-06-17T10:20:19.117500Z

XCode, you need a dev account (I think?)

phronmophobic 2021-06-17T10:20:21.117700Z

eventually, I'd like to replace html/css/javascript with pure clojure, but no specific timeline šŸ˜›

raspasov 2021-06-17T10:20:27.117900Z

I forget if you need a dev account to run on the phone.

raspasov 2021-06-17T10:20:43.118600Z

$99 a yearā€¦ But you can definitely run on simulator without an account.

phronmophobic 2021-06-17T10:21:08.119100Z

I think you're supposed to be able to run apps on your phone with a free account, but there's a 10 day expiration after each deploy

phronmophobic 2021-06-17T10:21:20.119500Z

if I recall correctly

raspasov 2021-06-17T10:21:34.119800Z

Ah, got itā€¦ @borkdude it comes down to knowing where to click inside of XCode, and itā€™s confusing šŸ™‚

šŸ‘† 1
raspasov 2021-06-17T10:22:04.120400Z

Gotta select a teamā€¦

raspasov 2021-06-17T10:22:28.121100Z

And thatā€™s about it, it should be able to run at this point, assuming no build errors.

raspasov 2021-06-17T10:22:53.121600Z

(Selecting Team applies the correct certificate)

borkdude 2021-06-17T10:23:08.121800Z

ok, I might try it in the weekend

šŸ‘Œ 1
borkdude 2021-06-17T10:23:44.122500Z

what's the link of the repo again?

phronmophobic 2021-06-17T10:24:11.123200Z

https://github.com/phronmophobic/mobiletest

raspasov 2021-06-17T10:24:28.123900Z

iOS simulator is pretty good, so you wonā€™t get much out of the phone per-se. Unless you need to access camera, and some APIs which are not available on the simulator. For most UI work, the simulator is 99% accurate (performance aside, that can be misleading).

phronmophobic 2021-06-17T10:24:51.124300Z

I'll try to update the docs by this weekend based on this chat

1
borkdude 2021-06-17T10:25:41.125Z

cool, I'll try the simulator as well. but for me it's not real unless I can tell others to download the app and install it :)

1
raspasov 2021-06-17T10:26:06.126Z

Haha for sure. Submitting the app is a whole another can of worms.

borkdude 2021-06-17T10:26:25.126800Z

There is a side-loading thing for iOS right?

phronmophobic 2021-06-17T10:26:34.127100Z

I haven't tried to compile for the simulator yet. I assume there's some script changes necessary

raspasov 2021-06-17T10:26:36.127300Z

TestFlight, yes. Thatā€™s easier to setup.

raspasov 2021-06-17T10:26:47.127700Z

@smith.adriane let me try, should be the same

raspasov 2021-06-17T10:27:18.128200Z

Except for IP changes, Simulator is pretty much identical on iOS/XCode. Itā€™s one of the few good things about Xcode šŸ™‚

raspasov 2021-06-17T10:27:48.128400Z

Ha! Actuallyā€¦ error

phronmophobic 2021-06-17T10:28:32.129100Z

yea, I think the architecture is different

raspasov 2021-06-17T10:28:52.129700Z

Ok, that is strange now. I just pulled the changesā€¦ maybe that changed something.

borkdude 2021-06-17T10:29:02.130Z

how long does compilation take on your machines? it seems it's stuck at the setup step on mine

raspasov 2021-06-17T10:29:14.130200Z

@smith.adriane

raspasov 2021-06-17T10:29:38.130800Z

I just managed to compile it 30 min ago, but now I get this error.

raspasov 2021-06-17T10:29:45.131Z

Strange.

borkdude 2021-06-17T10:29:49.131200Z

I mean the shared lib

raspasov 2021-06-17T10:30:06.131900Z

@borkdude yesā€¦ We went through those problems in the chatā€¦.

raspasov 2021-06-17T10:30:18.132200Z

Youā€™re referring to

raspasov 2021-06-17T10:30:24.132500Z

$ ./scripts/compile-shared

phronmophobic 2021-06-17T10:30:24.132700Z

you'll have to recompile the shared library

raspasov 2021-06-17T10:30:26.133Z

?

borkdude 2021-06-17T10:30:28.133200Z

yes

borkdude 2021-06-17T10:30:40.133500Z

I am just compiling the shared library

phronmophobic 2021-06-17T10:30:48.133800Z

the repo adds a new shared library function

borkdude 2021-06-17T10:30:50.134Z

this is what I was referring to, it's not working for me

borkdude 2021-06-17T10:31:01.134300Z

well, it takes longer than I would expect, let's say

raspasov 2021-06-17T10:31:12.134400Z

Ahā€¦ Gotta recompile!

raspasov 2021-06-17T10:31:14.134600Z

Got it

raspasov 2021-06-17T10:31:41.135200Z

Yesā€¦ try restarting the compilation.

raspasov 2021-06-17T10:31:56.135700Z

Or nuking ā€œlibraryā€ folderā€¦ It was not very clear what was the cause of that issue.

borkdude 2021-06-17T10:32:08.136100Z

it seems like a deadlock, which could be related to native library loading

raspasov 2021-06-17T10:32:20.136300Z

Yeah it was strange.

borkdude 2021-06-17T10:32:43.136500Z

https://github.com/oracle/graal/issues/3251

borkdude 2021-06-17T10:33:03.137Z

This comment might be helpful: https://github.com/oracle/graal/issues/3251#issuecomment-842820130

borkdude 2021-06-17T10:34:19.137500Z

Pressing ctrl-\ dumps a thread dump

phronmophobic 2021-06-17T10:36:12.138400Z

I don't think the current repo is loading any native libraries.

raspasov 2021-06-17T10:36:39.139Z

@smith.adriane FWIW, killing it right now and starting again without nuking ā€œlibraryā€ made it continue for meā€¦

phronmophobic 2021-06-17T10:36:40.139100Z

at least, not directly from clojure

raspasov 2021-06-17T10:37:00.139500Z

(compiling again with the new changes)

phronmophobic 2021-06-17T10:37:17.139600Z

yea, that seems like a promising thread to pull

phronmophobic 2021-06-17T10:37:34.139800Z

maybe it's as simple as creating all the necessary directories?

phronmophobic 2021-06-17T10:37:57.140100Z

like ./library/tmp

raspasov 2021-06-17T10:38:02.140300Z

Got an error: Fatal error:org.graalvm.compiler.debug.GraalError: LLVM linking failed into batch 8 (f8000-f9000). Use -H:LLVMMaxFunctionsPerBatch=1 to compile each method individually. (/Users/raspasov/projects/github/mobiletest/scripts/../library/tmp/SVM-1623926169792/llvm/b8.bc): 1

borkdude 2021-06-17T10:38:09.140600Z

trying with the newest dev build... https://github.com/graalvm/graalvm-ce-dev-builds/releases/tag/21.2.0-dev-20210616_2034

phronmophobic 2021-06-17T10:38:36.140700Z

I've seen that error, but I thought it was usually when I compile with the wrong jvm

phronmophobic 2021-06-17T10:38:53.140900Z

maybe it's something different or some cache error

raspasov 2021-06-17T10:39:00.141100Z

raspasov@MBP mobiletest % java --version Ā Ā Ā Ā Ā  openjdk 11.0.11 2021-04-20 OpenJDK Runtime Environment GraalVM CE 21.1.0 (build 11.0.11+8-jvmci-21.1-b05) OpenJDK 64-Bit Server VM GraalVM CE 21.1.0 (build 11.0.11+8-jvmci-21.1-b05, mixed mode, sharing)

raspasov 2021-06-17T10:39:06.141300Z

It should be correct.

raspasov 2021-06-17T10:39:14.141500Z

Ok let me try deleting.

raspasov 2021-06-17T10:39:35.141700Z

It has a suggestion: -H:LLVMMaxFunctionsPerBatch=1

borkdude 2021-06-17T10:39:36.142Z

same problem

borkdude 2021-06-17T10:39:46.142300Z

I'll check back later, exciting stuff

šŸ‘ 2
phronmophobic 2021-06-17T10:39:56.142500Z

I've tried that before, but it never seems to help

raspasov 2021-06-17T10:40:02.142800Z

Ok, good to know.

phronmophobic 2021-06-17T10:45:30.143200Z

however, I've been using quite a bit of guess and check without 100% understanding what every flag does, so any improvements or experimentation are welcome

šŸ‘Œ 1
raspasov 2021-06-17T10:47:14.143500Z

Yeahā€¦ This is getting stuck again for me. Perhaps youā€™re seeing it less often because youā€™re on M1, and if it is a deadlock like borkdude was suggesting, it could be behaving differently on different CPUs.

raspasov 2021-06-17T11:14:55.144300Z

Yeah, unfortunately this is getting stuck for me as well, and not able to compile anymore šŸ˜ž

raspasov 2021-06-17T11:15:27.144900Z

Iā€™ll check back later as well, chat soon.

borkdude 2021-06-17T14:08:05.145600Z

btw, you can always make an issue at oracle/graal about the (seemingly) deadlock thing, as long as you provide clear build instructions (which you already have in the repo)

šŸ‘ 1
borkdude 2021-06-17T14:08:20.146Z

maybe make a branch (to keep a reference for the issue)