This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-08-06
Channels
- # aleph (1)
- # announcements (2)
- # beginners (109)
- # calva (48)
- # cider (25)
- # clj-kondo (38)
- # cljdoc (13)
- # clojure (203)
- # clojure-europe (23)
- # clojure-gamedev (3)
- # clojure-nl (3)
- # clojure-uk (7)
- # conjure (2)
- # data-science (1)
- # datalog (2)
- # datomic (7)
- # deps-new (16)
- # depstar (2)
- # docker (2)
- # fulcro (67)
- # graalvm (58)
- # honeysql (16)
- # java (2)
- # jobs (2)
- # jobs-discuss (2)
- # kaocha (4)
- # lsp (82)
- # malli (23)
- # off-topic (35)
- # polylith (18)
- # practicalli (5)
- # releases (1)
- # remote-jobs (1)
- # shadow-cljs (15)
- # sql (17)
- # timbre (1)
- # tools-deps (24)
- # vim (20)
- # xtdb (9)
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
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
`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 `
`[ :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`
why you don't move all that code to a .sh or makefile and call it from the gh action?
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
Hello fellow clojurians, I could need some help
I have a project that's using clojure.java-time and I try to create an executable from that project via native-image
creation works fine, but when I call that executable i get the following issue with
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)
Please post the message
which message do you mean?
Is it a full stacktrace?
Like it should be something like some error message and then stacktrace
ah, sry, forgot to copy the first part
Exception in thread "main" java.lang.ClassCastException: java_time.graph.Types cannot be cast to java.lang.Comparable
Looks like a reflection issue
ah, dang, this might be the case, not sure how stuff is happening under the hood with that lib
running the project via cli tool and from jar works fine
@dev-hartmann This is an issue I've seen more often with clojure-java-time. It's because of the eval
It’s not
At least not that one
Ah ok, well, just don't use that lib and use java.time
directly, it has issues ;)
Totally agree with this!
@borkdude thanks, will do that instead then
@karol.wojcik thanks for taking a look too!
hm, I refactored to use java.time but I get the same stack trace, when running the executable
I don't think you have shared the entire stacktrace. Can you do that, in a gist/pastebin?
Actually it's the complete trace
https://github.com/dev-hartmann/gitodo/blob/main/src/dev_hartmann/graphql_connector.clj#L80
this is the code that's causing the issue
well actually the stacktrace says the issue is line 86
https://github.com/dev-hartmann/gitodo/blob/main/src/dev_hartmann/graphql_connector.clj#L86
oh sry
the first part is this
Exception in thread "main" java.lang.ClassCastException: java_time.graph.Types cannot be cast to java.lang.Comparable
https://github.com/dev-hartmann/gitodo/blob/main/src/dev_hartmann/transformer.clj#L27
It is true: https://github.com/dm3/clojure.java-time/blob/master/src/java_time/graph.clj#L26
seems to be the
an issue here with the duration/between
https://github.com/dev-hartmann/gitodo/blob/main/src/dev_hartmann/transformer.clj#L27
I have
nothing in deps.edn using java.time
good question
maybe that's the issue