This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-03-09
Channels
- # aws (51)
- # beginners (57)
- # calva (10)
- # chlorine-clover (7)
- # cider (20)
- # clj-kondo (55)
- # clojure (43)
- # clojure-europe (9)
- # clojure-italy (1)
- # clojure-nl (5)
- # clojure-spec (8)
- # clojure-uk (71)
- # clojurescript (33)
- # core-async (22)
- # cursive (20)
- # datomic (3)
- # emacs (8)
- # figwheel-main (8)
- # fulcro (13)
- # garden (2)
- # graalvm (60)
- # graphql (26)
- # jobs (6)
- # joker (6)
- # kaocha (2)
- # lambdaisland (5)
- # malli (36)
- # off-topic (9)
- # portkey (15)
- # re-frame (3)
- # reagent (25)
- # remote-jobs (4)
- # spacemacs (3)
- # sql (111)
- # tree-sitter (29)
- # uncomplicate (3)
- # xtdb (2)
pgmig was updated from clojure 1.8.0 (!) to clojure 1.10.2-alpha1: https://github.com/leafclick/pgmig/commit/68864abe8e94910402e6a01d7de88f5d0cdfc504
1.10.2-alpha1
@mkvlr I have a frontend rest service running in native image:
[tiketguard:26315] classlist: 10,791.61 ms
[tiketguard:26315] (cap): 1,308.11 ms
[tiketguard:26315] setup: 3,329.41 ms
[tiketguard:26315] (typeflow): 323,689.19 ms
[tiketguard:26315] (objects): 78,563.42 ms
[tiketguard:26315] (features): 10,511.45 ms
[tiketguard:26315] analysis: 419,706.99 ms
[tiketguard:26315] (clinit): 1,737.86 ms
[tiketguard:26315] universe: 6,046.41 ms
[tiketguard:26315] (parse): 11,295.08 ms
[tiketguard:26315] (inline): 13,751.14 ms
[tiketguard:26315] (compile): 65,125.46 ms
[tiketguard:26315] compile: 95,394.01 ms
[tiketguard:26315] image: 14,677.93 ms
[tiketguard:26315] write: 1,736.10 ms
[tiketguard:26315] [total]: 552,193.88 ms
I think it culprint is some of the deps having spec in its deps (and not in the latest version)
I'll have to investigate. But the message is what I see when "wrong" spec is in com.oracle.svm.core.jdk.UnsupportedFeatureError: Invoke with MethodHandle argument could not be reduced to at most a single call: java.lang.invoke.Invokers$Holder.invoke_MT(Object, Object, Object, Object)
See: https://github.com/lread/clj-graal-docs#jdk11-and-clojurelangreflector and https://github.com/oracle/graal/issues/2214
That'd make sense. I tried to avoid reflection calls in pgmig but that's not feasible in the larger app. I'll try to play again with it soon
@borkdude good tip, the reflector error is gone on java8 graal. There are still problems in the final binary but the build is on track now.
I think I found a better fix for the clojure.lang.Reflector issue with java11! https://github.com/oracle/graal/issues/2214#issuecomment-596598421 No need anymore to patch Clojure itself by overriding the class.
@borkdude is the above a configuration class that can be included in the project along with json configuration? Because I tried the java configuration code before and ran into more troubles.
@katox This is the fix in action: https://github.com/borkdude/sci/commit/4c8190c0e95860ece8e8b195b05d31ad0866d763 you need to compile this with svm.jar on the classpath. The commit shows that.
So am I reading this right. This works both graal java 8 and java 11. And keeps full functionality in both.
You have been busy! How did you learn about @TargetElement
? Just reading source code?
it came up in another issue. See https://github.com/oracle/graal/issues/2136 towards the end.
Oh that’s interesting @borkdude, so with Java substitutions, we can monkey patch Clojure!
so if Clojure is going to have more Java-version specific bits, we can maybe work around it this way
I think oracle provided some maven svm artifact. You could put it as a native image profile dependence.
it is GPL licenced. is this what the classpath exception is for, i.e. when I compile my binary with this, I can still distribute it?
This is from the native-image chat:
Michiel Borkent [4:22 PM]
Is the svm.jar available as a maven library so I can put it on my classpath via a package manager?
Michiel Borkent [4:38 PM]
it seems it is, but not updated for newer versions? (edited)
David Lloyd [4:49 PM]
the group ID changed to org.graalvm.nativeimage
[4:49 PM]
The Central Repository Search Engine
The Search Engine for The Central Repository
Michiel Borkent [4:50 PM]
oh thank you!
Peter Niederwieser [4:50 PM]
afaik the jar can't currently be used with openjdk.
But you don't use it with openjdk. You use graal and the graal's native image to create and link the binary. And the binary on linux is linked to some gnu libc stuff.
the gnu library that normally causes linking license problems is libreadline (its GPL)
Just FYI native-image compilation times for the FE service app - various -J-Xmx settings
16G
[tiketguard:21475] [total]: 280,823.65 ms
10G
[tiketguard:30357] [total]: 874,997.50 ms
8G
java.lang.OutOfMemoryError
for reference the uberjar size is about 40megs (got a heavy cut to actually compile and run as a native-image)
Here's the library: https://github.com/borkdude/clj-reflector-graal-java11-fix