Fork me on GitHub
#graalvm
<
2021-08-06
>
ericdallo01:08:47

Great news, next version of sqlite-jdbc will not need any graalvm extra config as not that config is built-in 🙂 https://github.com/xerial/sqlite-jdbc/pull/631#event-5120382679

🎉 12
bocaj06:08:04

I’m running stuck using github actions. I keep getting this error line 8: --initialize-at-build-time: command not found and the image name is empty in the logs

bocaj06:08:40

`jobs: linux-static: runs-on: ubuntu-latest steps: - name: Setup Graalvm id: setup-graalvm uses: DeLaGuardo/setup-graalvm@master with: # GraalVM version, no pattern syntax available atm graalvm: ‘21.1.0’ # Java version, optional, defaults to ‘java8’. Available options are ‘java8’ and ‘java11’. java: ‘java11’ # Architecture flag, optional, defaults to ‘amd64’. Available options are ‘amd64’ and ‘aarch64’. Later is available only for linux runners. arch: ‘amd64’ - name: Install native-image component run: | gu install native-image - name: Install clojure tools uses: DeLaGuardo/[email protected] with: cli: 1.10.3.933 # 1.10.1.693 # Clojure CLI based on tools.deps - name: Checkout uses: actions/checkout@v2 - name: Install musl on Linux and MacOS # run: chmod u+x ./script/musl-setup && sudo ./script/musl-setup run: | sudo apt-get update sudo apt-get install -y musl curl unzip build-essential zlib1g-dev sudo shell: bash - name: Make the uberjar dataloader.jar run: clojure “-X:uberjar” shell: bash - name: Make native image run: | native-image \ -jar ./dataloader.jar \ -H:Name=dataloader \ -H:+ReportExceptionStackTraces \ --report-unsupported-elements-at-runtime \ --verbose \ --initialize-at-build-time \ --allow-incomplete-classpath \ -J-Dclojure.compiler.direct-linking=true \ --no-fallback \ --no-server \ --static \ --libc=musl \ --initialize-at-run-time=com.microsoft.sqlserver.jdbc.SQLServerFMTQuery \ --initialize-at-run-time=com.microsoft.sqlserver.jdbc.SQLServerBouncyCastleLoader \ --initialize-at-run-time=com.microsoft.sqlserver.jdbc.SQLServerMSAL4JUtils \ --initialize-at-run-time=com.microsoft.sqlserver.jdbc.SQLServerBulkCSVFileRecord \ --initialize-at-run-time=com.microsoft.sqlserver.jdbc.SQLServerBulkCopyOptions \ --initialize-at-run-time=com.microsoft.sqlserver.jdbc.SQLServerBulkCopy \ -H:IncludeResourceBundles=com.microsoft.sqlserver.jdbc.SQLServerResource \ -H:ServiceLoaderFeatureExcludeServices=javax.sound.sampled.spi.AudioFileReader \ -H:ServiceLoaderFeatureExcludeServices=javax.sound.midi.spi.MidiFileReader \ -H:ServiceLoaderFeatureExcludeServices=javax.sound.sampled.spi.MixerProvider \ -H:ServiceLoaderFeatureExcludeServices=javax.sound.sampled.spi.FormatConversionProvider \ -H:ServiceLoaderFeatureExcludeServices=javax.sound.sampled.spi.AudioFileWriter \ -H:ServiceLoaderFeatureExcludeServices=javax.sound.midi.spi.MidiDeviceProvider \ -H:ServiceLoaderFeatureExcludeServices=javax.sound.midi.spi.SoundbankReader \ -H:ServiceLoaderFeatureExcludeServices=javax.sound.midi.spi.MidiFileWriter `

bocaj06:08:52

Apologies for the large “help me find my typo” question.

bocaj06:08:56

`[ :2554] classlist: 3,239.56 ms, 0.96 GB https://github.com/Jacob-Kroeze/data-loader/runs/3259594483?check_suite_focus=true#step:8:124 [ :2554] (cap): 689.34 ms, 0.96 GB https://github.com/Jacob-Kroeze/data-loader/runs/3259594483?check_suite_focus=true#step:8:125 [ :2554] setup: 2,864.88 ms, 0.96 GB https://github.com/Jacob-Kroeze/data-loader/runs/3259594483?check_suite_focus=true#step:8:126 [ :2554] (clinit): 266.36 ms, 1.70 GB https://github.com/Jacob-Kroeze/data-loader/runs/3259594483?check_suite_focus=true#step:8:127 [ :2554] (typeflow): 9,985.32 ms, 1.70 GB https://github.com/Jacob-Kroeze/data-loader/runs/3259594483?check_suite_focus=true#step:8:128 [ :2554] (objects): 10,188.50 ms, 1.70 GB https://github.com/Jacob-Kroeze/data-loader/runs/3259594483?check_suite_focus=true#step:8:129 [ :2554] (features): 605.69 ms, 1.70 GB https://github.com/Jacob-Kroeze/data-loader/runs/3259594483?check_suite_focus=true#step:8:130 [ :2554] analysis: 21,342.17 ms, 1.70 GB https://github.com/Jacob-Kroeze/data-loader/runs/3259594483?check_suite_focus=true#step:8:131 [ :2554] universe: 734.91 ms, 2.30 GB https://github.com/Jacob-Kroeze/data-loader/runs/3259594483?check_suite_focus=true#step:8:132 [ :2554] (parse): 3,140.11 ms, 2.30 GB https://github.com/Jacob-Kroeze/data-loader/runs/3259594483?check_suite_focus=true#step:8:133 [ :2554] (inline): 4,286.25 ms, 2.30 GB https://github.com/Jacob-Kroeze/data-loader/runs/3259594483?check_suite_focus=true#step:8:134 [ :2554] (compile): 22,182.83 ms, 2.30 GB https://github.com/Jacob-Kroeze/data-loader/runs/3259594483?check_suite_focus=true#step:8:135 [ :2554] compile: 30,460.92 ms, 2.30 GB https://github.com/Jacob-Kroeze/data-loader/runs/3259594483?check_suite_focus=true#step:8:136 [ :2554] image: 1,926.08 ms, 2.30 GB https://github.com/Jacob-Kroeze/data-loader/runs/3259594483?check_suite_focus=true#step:8:137 [ :2554] write: 263.94 ms, 2.30 GB https://github.com/Jacob-Kroeze/data-loader/runs/3259594483?check_suite_focus=true#step:8:138 # Printing build artifacts to: .build_artifacts.txt https://github.com/Jacob-Kroeze/data-loader/runs/3259594483?check_suite_focus=true#step:8:139 [ :2554] [total]: 61,066.73 ms, 2.30 GB`

ericdallo13:08:28

maybe some issue with yaml + \ ?

ericdallo13:08:48

why you don't move all that code to a .sh or makefile and call it from the gh action?

ericdallo13:08:45

maybe better, why you don't move those configs/args to the resources META-INF folder following graal conventions just like this example: https://github.com/ericdallo/sqlite-graalvm-sample/tree/master/resources/META-INF/native-image/sqlite-graalvm-sample/sqlite-graalvm-sample

👍 3
dev-hartmann14:08:42

Hello fellow clojurians, I could need some help

dev-hartmann14:08:26

I have a project that's using clojure.java-time and I try to create an executable from that project via native-image

dev-hartmann14:08:46

creation works fine, but when I call that executable i get the following issue with

dev-hartmann14:08:42

java.lang.Comparable
                at clojure.lang.Util.compare(Util.java:153)
                at clojure.lang.APersistentVector.compareTo(APersistentVector.java:439)
                at java.util.concurrent.ConcurrentHashMap.compareComparables(ConcurrentHashMap.java:739)
                at java.util.concurrent.ConcurrentHashMap$TreeBin.<init>(ConcurrentHashMap.java:2819)
                at java.util.concurrent.ConcurrentHashMap.treeifyBin(ConcurrentHashMap.java:2676)
                at java.util.concurrent.ConcurrentHashMap.putVal(ConcurrentHashMap.java:1068)
                at java.util.concurrent.ConcurrentHashMap.putIfAbsent(ConcurrentHashMap.java:1541)
                at java_time.potemkin.util$fast_memoize$fn__1809.invoke(util.clj:50)
                at java_time.graph.ConversionGraph$fn__2025.invoke(graph.clj:153)
                at clojure.core$filter$fn__5912.invoke(core.clj:2821)
                at clojure.lang.LazySeq.sval(LazySeq.java:42)
                at clojure.lang.LazySeq.seq(LazySeq.java:51)
                at clojure.lang.ChunkedCons.chunkedNext(ChunkedCons.java:59)
                at clojure.core$chunk_next.invokeStatic(core.clj:710)
                at clojure.core$reduce1.invokeStatic(core.clj:944)
                at clojure.core$set.invokeStatic(core.clj:4101)
                at clojure.core$set.invoke(core.clj:4093)
                at java_time.graph.ConversionGraph.equivalent_targets(graph.clj:154)
                at java_time.graph$graph_conversion_path.invokeStatic(graph.clj:193)
                at java_time.graph$graph_conversion_path.invoke(graph.clj:188)
                at java_time.graph$fn__2146.invokeStatic(graph.clj:303)
                at java_time.graph$fn__2146.invoke(graph.clj:300)
                at java_time.potemkin.util$fast_memoize$fn__1809.invoke(util.clj:52)
                at java_time.graph$conversion_fn.invokeStatic(graph.clj:316)
                at java_time.graph$conversion_fn.invoke(graph.clj:312)
                at java_time.temporal$instant.invokeStatic(temporal.clj:350)
                at java_time.temporal$instant.invoke(temporal.clj:350)
                at dev_hartmann.transformer$review_request__GT_todo.invokeStatic(transformer.clj:27)
                at dev_hartmann.transformer$review_request__GT_todo.invoke(transformer.clj:23)
                at clojure.core$map$fn__5885.invoke(core.clj:2757)
                at clojure.lang.LazySeq.sval(LazySeq.java:42)
                at clojure.lang.LazySeq.seq(LazySeq.java:51)
                at clojure.lang.RT.seq(RT.java:535)
                at clojure.core$seq__5420.invokeStatic(core.clj:139)
                at clojure.core$map_indexed$mapi__8573$fn__8574.invoke(core.clj:7306)
                at clojure.lang.LazySeq.sval(LazySeq.java:42)
                at clojure.lang.LazySeq.seq(LazySeq.java:51)
                at clojure.lang.RT.seq(RT.java:535)
                at clojure.core$seq__5420.invokeStatic(core.clj:139)
                at clojure.core$map$fn__5885.invoke(core.clj:2750)
                at clojure.lang.LazySeq.sval(LazySeq.java:42)
                at clojure.lang.LazySeq.seq(LazySeq.java:51)
                at clojure.lang.RT.seq(RT.java:535)
                at clojure.lang.RT.countFrom(RT.java:650)
                at clojure.lang.RT.count(RT.java:643)
                at dev_hartmann.graphql_connector$get_items$iter__1073__1077$fn__1078.invoke(graphql_connector.clj:86)
                at clojure.lang.LazySeq.sval(LazySeq.java:42)
                at clojure.lang.LazySeq.seq(LazySeq.java:51)
                at clojure.lang.RT.seq(RT.java:535)
                at clojure.lang.RT.countFrom(RT.java:650)
                at clojure.lang.RT.count(RT.java:643)
                at dev_hartmann.formatters$print_todos_BANG_.invokeStatic(formatters.clj:12)
                at dev_hartmann.formatters$print_todos_BANG_.invoke(formatters.clj:9)
                at dev_hartmann.gitodo$_main.invokeStatic(gitodo.clj:31)
                at dev_hartmann.gitodo$_main.doInvoke(gitodo.clj:25)
                at clojure.lang.RestFn.invoke(RestFn.java:397)
                at clojure.lang.AFn.applyToHelper(AFn.java:152)
                at clojure.lang.RestFn.applyTo(RestFn.java:132)
                at dev_hartmann.gitodo.main(Unknown Source)
 

Karol Wójcik14:08:43

Please post the message

dev-hartmann14:08:17

which message do you mean?

Karol Wójcik14:08:31

Is it a full stacktrace?

Karol Wójcik14:08:49

Like it should be something like some error message and then stacktrace

dev-hartmann14:08:25

ah, sry, forgot to copy the first part

dev-hartmann14:08:28

Exception in thread "main" java.lang.ClassCastException: java_time.graph.Types cannot be cast to java.lang.Comparable

Karol Wójcik14:08:26

Looks like a reflection issue

dev-hartmann14:08:58

ah, dang, this might be the case, not sure how stuff is happening under the hood with that lib

dev-hartmann14:08:47

running the project via cli tool and from jar works fine

borkdude14:08:56

@dev-hartmann This is an issue I've seen more often with clojure-java-time. It's because of the eval

Karol Wójcik14:08:14

At least not that one

borkdude14:08:36

Ah ok, well, just don't use that lib and use java.time directly, it has issues ;)

👍 3
Karol Wójcik14:08:15

Totally agree with this!

dev-hartmann14:08:06

@borkdude thanks, will do that instead then

dev-hartmann14:08:24

@karol.wojcik thanks for taking a look too!

dev-hartmann15:08:11

hm, I refactored to use java.time but I get the same stack trace, when running the executable

borkdude15:08:33

I don't think you have shared the entire stacktrace. Can you do that, in a gist/pastebin?

dev-hartmann15:08:28

Actually it's the complete trace

dev-hartmann15:08:45

this is the code that's causing the issue

dev-hartmann15:08:23

well actually the stacktrace says the issue is line 86

borkdude15:08:39

Is there no other error message? Just java.lang.Comparable?

dev-hartmann15:08:53

the first part is this

dev-hartmann15:08:01

Exception in thread "main" java.lang.ClassCastException: java_time.graph.Types cannot be cast to java.lang.Comparable

borkdude15:08:20

ok, well, maybe that's true?

borkdude15:08:39

but on the JVM it works right?

dev-hartmann15:08:53

seems to be the

dev-hartmann15:08:21

an issue here with the duration/between

borkdude15:08:38

oh, hm, java_time.Types comes from the clojure lib?

borkdude15:08:00

that's a bad name for a clojure lib type

borkdude15:08:26

get rid of this library completely

dev-hartmann15:08:56

nothing in deps.edn using java.time

borkdude15:08:57

but how can you then still see a reference to one of its types?

borkdude15:08:05

do you have a stale target dir?

dev-hartmann15:08:11

maybe that's the issue