Fork me on GitHub
#graalvm
<
2022-06-07
>
grounded_sage19:06:10

I'm trying to use babashka to automate a graalvm native build during development but I am getting this error.

"Warning: Ignoring server-mode native-image argument --no-server.\nError: Darwin native toolchain (x86_64) implies native-image target architecture class jdk.vm.ci.amd64.AMD64 but configured native-image target architecture is class jdk.vm.ci.aarch64.AArch64.\nError: To prevent native-toolchain checking provide command-line option -H:-CheckToolchain\ncom.oracle.svm.core.util.UserError$UserException: Darwin native toolchain (x86_64) implies native-image target architecture class jdk.vm.ci.amd64.AMD64 but configured native-image target architecture is class jdk.vm.ci.aarch64.AArch64.\nTo prevent native-toolchain checking provide command-line option -H:-CheckToolchain\n\tat com.oracle.svm.core.util.UserError.abort(UserError.java:138)\n\tat com.oracle.svm.hosted.c.codegen.CCompilerInvoker.addSkipCheckingInfo(CCompilerInvoker.java:104)\n\tat com.oracle.svm.hosted.c.codegen.CCompilerInvoker.verifyCompiler(CCompilerInvoker.java:95)\n\tat com.oracle.svm.hosted.NativeImageGenerator.setupNativeImage(NativeImageGenerator.java:884)\n\tat com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:555)\n\tat com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:515)\n\tat com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:407)\n\tat com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:585)\n\tat com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:128)\n\tat com.oracle.svm.hosted.NativeImageGeneratorRunner$JDK9Plus.main(NativeImageGeneratorRunner.java:615)\nError: Image build request failed with exit status 1\n"}

grounded_sage19:06:32

Is there something funny with how this happens with Babashka or is it something on my end?

grounded_sage19:06:54

When I run the same shell command it works. Hence a little confused.

borkdude19:06:09

I see some error about mixing aarch64 and amd64

grounded_sage19:06:29

Yea I see that as well. I was thinking that somehow Babashka is confusing it by being the one that invokes the command. I'm basically finding where graalvm native image is installed on the dev machine and then calling it with the commands. We have a lot of build steps and this is probably the trickiest to automate on local machine.

grounded_sage19:06:35

I am on an M1 Mac if that clarifies anything

borkdude19:06:49

@grounded_sage Would a m1 binary of bb help?

borkdude19:06:12

if you go here: https://cirrus-ci.com/task/5967226598588416 and then to artifacts / binaries, you should be able to download a bb binary I just got this working 1 minute ago!

grounded_sage19:06:05

I can try this out. Were you already working on it or spun it up just now? haha Also not entirely sure what to do once I download it. It says it is a document and not an exe on my machine.

borkdude19:06:22

No, I was co-incidentally working on this

borkdude19:06:51

ah I see, I'll give you a better link in a minute

👍 1
grounded_sage19:06:28

Well I am happy to test it straight away. I am just a little less familiar with putting things on paths etc

borkdude19:06:18

It's going to take me half an hour, brb

grounded_sage19:06:55

okay. no rush. I am about to sign off and will be at some things over next couple of days. I do suspect that the M1 binary will solve it.

borkdude21:06:28

bash <(curl ) --version 0.8.3-SNAPSHOT --dir /tmp
You can download the m1 binary now using that

borkdude21:06:52

Make sure to check out (System/getProperty "os.arch") to check if you are running the m1 binary

borkdude21:06:14

$ /tmp/bb -e '(System/getProperty "os.arch")'
"aarch64"