Open domkm opened 8 years ago
I know @arbscht has been trying to get a patch into clj-v8 so we can do a smooth transition to Nashorn, instead of breaking compatibility with older Java versions, but it's been quiet on that front for a while. See #14.
Work on moving to Nashorn via JSR-223 is in progress again at #14.
Meanwhile, I'd like to see if this can be fixed in the short-term too. Can you provide steps to reproduce the error? (I'm not familiar enough with Boot just yet.)
Sure thing, @arbscht.
boot -d optimus repl
(require 'optimus.optimizations.minify)
(require 'optimus.optimizations.minify :reload-all)
↪ boot -d optimus repl
nREPL server started on port 53974 on host 127.0.0.1 - nrepl://127.0.0.1:53974
REPL-y 0.3.5, nREPL 0.2.8
Clojure 1.7.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_20-b26
Exit: Control+D or (exit) or (quit)
Commands: (user/help)
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Find by Name: (find-name "part-of-name-here")
Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Examples from clojuredocs.org: [clojuredocs or cdoc]
(user/clojuredocs name-here)
(user/clojuredocs "ns-here" "name-here")
boot.user=> (require 'optimus.optimizations.minify)
nil
boot.user=> (require 'optimus.optimizations.minify :reload-all)
clojure.lang.Compiler$CompilerException: java.lang.UnsatisfiedLinkError: Native Library /private/var/folders/t2/kbjbdrwd5dzf_hh9gjfnz_b00000gn/T/libv8.dylib.clj-v8 already loaded in another classloader, compiling:(v8/core.clj:36:1)
java.lang.UnsatisfiedLinkError: Native Library /private/var/folders/t2/kbjbdrwd5dzf_hh9gjfnz_b00000gn/T/libv8.dylib.clj-v8 already loaded in another classloader
@DomKM, this looks like a bug in clj-v8. I've proposed a PR at circleci/clj-v8#15. If you can install from source, see if that works for you.
The underlying problem seems to be that native libraries must not be loaded twice in a JVM, but clj-v8 happens to eagerly (re-)load its native objects.
Now, I don't know which is more likely to land first: a new clj-v8 release or a Nashorn-capable Optimus… :smile:
+1 has a fixed been applied?
When using Optimus with Boot, I get this error:
How close are we to moving from clj-v8 to Nashorn? Is this fixable before the move?
/CC @micha @alandipert @pbiggar