This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-06-10
Channels
- # announcements (1)
- # babashka-sci-dev (16)
- # beginners (5)
- # calva (3)
- # cider (42)
- # clojure (103)
- # clojure-europe (79)
- # clojure-nl (2)
- # clojure-norway (17)
- # clojure-sweden (2)
- # clojure-uk (8)
- # clojurescript (7)
- # community-development (7)
- # core-async (1)
- # core-typed (18)
- # cursive (9)
- # data-science (1)
- # dev-tooling (14)
- # events (1)
- # fulcro (2)
- # hugsql (2)
- # hyperfiddle (1)
- # leiningen (7)
- # malli (11)
- # re-frame (14)
- # releases (9)
- # ring (18)
- # shadow-cljs (55)
Anyone else ran into the file watcher not working under GraalVM 22?
Execution error (NoSuchMethodError) at com.oracle.truffle.api.library.LibraryFactory/ensureLibraryInitialized (LibraryFactory.java:384).
'void sun.misc.Unsafe.ensureClassInitialized(java.lang.Class)'
macos uses the directory-watcher lib, otherwise the default built-in JVM thing is used
I'm having the same issue
for me it's related to https://github.com/nextjournal/markdown/pull/24
@U5H74UNSF I'm going to take a look at this as part of nextjournal/beholder
@U0524T275 Ah that is a slightly different GraalVM 22 issue though - EDIT - it's related to the same removal of sun.misc.Unsafe
I wonder it the JVM built-in watcher works better for macOS these days? people used to complain that it was too slow. basically never checked this again since java8?
well interestingly with asdf I installed adoptjdk
and it works with 11 or 17
with the previous temurin it didn't work for any version for me
I can reproduce with nextjournal.markdown though, not with nextjournal.beholder nor with shadow
compiling this
(ns test)
(defn ^:export init []
(println #inst "2022-02-02"))
using shadow-cljs 2.25.4
onwards emits the following error:
Failed writing cache for test: java.lang.Exception: Not supported: class java.time.Instant
In the changelog it mentions adding root-source-info to the analysis env. Could this be the cause?no. normally #inst
does not return a java.time.Instant
? do you have data_readers.clj
that overwrites the default?
this is a clean (I think) repo with only shadow
"2.25.4"
why is that no using the latest shadow-cljs? I don't really care investigating things that might be fixed?
shadow-cljs - watching build :app
[:app] Configuring build.
[:app] Compiling ...
[:app] Build completed. (119 files, 118 compiled, 0 warnings, 5.79s)
do you maybe start via cider-jack-in or something along those line? injecting extra dependencies from the command line maybe?
oh sorry, I was looking back to when it was introduced, updated the repo
I'm seeing this
$ npx shadow-cljs release :app
shadow-cljs - config: /Users/peder/scratch/shadow-cache-issue/shadow-cljs.edn
shadow-cljs - updating dependencies
shadow-cljs - dependencies updated
[:app] Compiling ...
Failed writing cache for test: java.lang.Exception: Not supported: class java.time.Instant
[:app] Build completed. (45 files, 2 compiled, 0 warnings, 5.22s)
anything outside the repo that could be causing this?
we're seeing it in ci as well
for existing types or in general?
but regardless, no sure what that might be. will look into it later. its not a critical error, just won't have cache for that file
we pull in stuff like this: https://github.com/henryw374/time-literals you recommend against that?
I'd ask why, but I imagine you've explained your stance several times 😄
precisely due to issues such as this one. reader literals create objects that the compiler then has to deal with. in CLJ that has very much the same issues when it comes to AOT compilation.
I'm unsure how something turns from a Date to an Instant, so thats weird. especially given that release and watch use the same caching code, so why does watch not trigger it
yeah, I dunno. It happened somewhere between 2.25.3 and 2.25.4. not sure if there are more changes then the changelog lets on
well, you correctly identified the cause. it was that change, since that adds the form to the analyzer data. what I'm unsure is how it becomes a java.time.Instant
when it should be a java.util.Date
what is even weirder is that I can't reproduce this in the shadow-cljs project directly
thanks! did you figure out why it happened?