Closed holyjak closed 5 months ago
This works for me using a REPL initiated in the wolframite project, but not using my example project.
scicloj/wolframite {:git/url "https://github.com/scicloj/wolframite"
:git/sha "f27e5f30f65e2fea616d5f10b78be7b1b293cebe"}
...
I get:
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: Downloading: org/scicloj/clay/2-beta10/clay-2-beta10.pom from clojars Downloading: org/scicloj/clay/2-beta10/clay-2-beta10.jar from clojars Exception in thread "main" Syntax error macroexpanding at (markdown.clj:27:19). at clojure.lang.Compiler$InstanceMethodExpr.eval(Compiler.java:1988) at clojure.lang.Compiler$DefExpr.eval(Compiler.java:464) at clojure.lang.Compiler.eval(Compiler.java:7695) at clojure.lang.Compiler.load(Compiler.java:8156) at clojure.lang.RT.loadResourceScript(RT.java:401) at clojure.lang.RT.loadResourceScript(RT.java:392) at clojure.lang.RT.load(RT.java:479) at clojure.lang.RT.load(RT.java:444) at clojure.core$load$fn__6929.invoke(core.clj:6181) at clojure.core$load.invokeStatic(core.clj:6180) at clojure.core$load.doInvoke(core.clj:6164) at clojure.lang.RestFn.invoke(RestFn.java:411) at clojure.core$load_one.invokeStatic(core.clj:5953) at clojure.core$load_one.invoke(core.clj:5948) at clojure.core$load_lib$fn__6871.invoke(core.clj:5995) at clojure.core$load_lib.invokeStatic(core.clj:5994) at clojure.core$load_lib.doInvoke(core.clj:5973) at clojure.lang.RestFn.applyTo(RestFn.java:145) at clojure.core$apply.invokeStatic(core.clj:669) at clojure.core$load_libs.invokeStatic(core.clj:6036) at clojure.core$load_libs.doInvoke(core.clj:6020) at clojure.lang.RestFn.applyTo(RestFn.java:140) at clojure.core$apply.invokeStatic(core.clj:669) at clojure.core$require.invokeStatic(core.clj:6058) at clojure.core$require.doInvoke(core.clj:6058) at clojure.lang.RestFn.invoke(RestFn.java:808) at scicloj.clay.v2.prepare$eval5764$loading__6810__auto____5765.invoke(prepare.clj:1) at scicloj.clay.v2.prepare$eval5764.invokeStatic(prepare.clj:1) at scicloj.clay.v2.prepare$eval5764.invoke(prepare.clj:1) at clojure.lang.Compiler.eval(Compiler.java:7690) at clojure.lang.Compiler.eval(Compiler.java:7679) at clojure.lang.Compiler.load(Compiler.java:8156) at clojure.lang.RT.loadResourceScript(RT.java:401) at clojure.lang.RT.loadResourceScript(RT.java:392) at clojure.lang.RT.load(RT.java:479) at clojure.lang.RT.load(RT.java:444) at clojure.core$load$fn__6929.invoke(core.clj:6181) at clojure.core$load.invokeStatic(core.clj:6180) at clojure.core$load.doInvoke(core.clj:6164) at clojure.lang.RestFn.invoke(RestFn.java:411) at clojure.core$load_one.invokeStatic(core.clj:5953) at clojure.core$load_one.invoke(core.clj:5948) at clojure.core$load_lib$fn__6871.invoke(core.clj:5995) at clojure.core$load_lib.invokeStatic(core.clj:5994) at clojure.core$load_lib.doInvoke(core.clj:5973) at clojure.lang.RestFn.applyTo(RestFn.java:145) at clojure.core$apply.invokeStatic(core.clj:669) at clojure.core$load_libs.invokeStatic(core.clj:6036) at clojure.core$load_libs.doInvoke(core.clj:6020) at clojure.lang.RestFn.applyTo(RestFn.java:140) at clojure.core$apply.invokeStatic(core.clj:669) at clojure.core$require.invokeStatic(core.clj:6058) at clojure.core$require.doInvoke(core.clj:6058) at clojure.lang.RestFn.invoke(RestFn.java:3662) at scicloj.clay.v2.make$eval4613$loading__6810__auto____4614.invoke(make.clj:1) at scicloj.clay.v2.make$eval4613.invokeStatic(make.clj:1) at scicloj.clay.v2.make$eval4613.invoke(make.clj:1) at clojure.lang.Compiler.eval(Compiler.java:7690) at clojure.lang.Compiler.eval(Compiler.java:7679) at clojure.lang.Compiler.load(Compiler.java:8156) at clojure.lang.RT.loadResourceScript(RT.java:401) at clojure.lang.RT.loadResourceScript(RT.java:392) at clojure.lang.RT.load(RT.java:479) at clojure.lang.RT.load(RT.java:444) at clojure.core$load$fn__6929.invoke(core.clj:6181) at clojure.core$load.invokeStatic(core.clj:6180) at clojure.core$load.doInvoke(core.clj:6164) at clojure.lang.RestFn.invoke(RestFn.java:411) at clojure.core$load_one.invokeStatic(core.clj:5953) at clojure.core$load_one.invoke(core.clj:5948) at clojure.core$load_lib$fn__6871.invoke(core.clj:5995) at clojure.core$load_lib.invokeStatic(core.clj:5994) at clojure.core$load_lib.doInvoke(core.clj:5973) at clojure.lang.RestFn.applyTo(RestFn.java:145) at clojure.core$apply.invokeStatic(core.clj:669) at clojure.core$load_libs.invokeStatic(core.clj:6036) at clojure.core$load_libs.doInvoke(core.clj:6020) at clojure.lang.RestFn.applyTo(RestFn.java:140) at clojure.core$apply.invokeStatic(core.clj:669) at clojure.core$require.invokeStatic(core.clj:6058) at clojure.core$require.doInvoke(core.clj:6058) at clojure.lang.RestFn.invoke(RestFn.java:554) at scicloj.clay.v2.api$eval144$loading__6810__auto____145.invoke(api.clj:1) at scicloj.clay.v2.api$eval144.invokeStatic(api.clj:1) at scicloj.clay.v2.api$eval144.invoke(api.clj:1) at clojure.lang.Compiler.eval(Compiler.java:7690) at clojure.lang.Compiler.eval(Compiler.java:7679) at clojure.lang.Compiler.load(Compiler.java:8156) at clojure.lang.RT.loadResourceScript(RT.java:401) at clojure.lang.RT.loadResourceScript(RT.java:392) at clojure.lang.RT.load(RT.java:479) at clojure.lang.RT.load(RT.java:444) at clojure.core$load$fn__6929.invoke(core.clj:6181) at clojure.core$load.invokeStatic(core.clj:6180) at clojure.core$load.doInvoke(core.clj:6164) at clojure.lang.RestFn.invoke(RestFn.java:411) at clojure.core$load_one.invokeStatic(core.clj:5953) at clojure.core$load_one.invoke(core.clj:5948) at clojure.core$load_lib$fn__6871.invoke(core.clj:5995) at clojure.core$load_lib.invokeStatic(core.clj:5994) at clojure.core$load_lib.doInvoke(core.clj:5973) at clojure.lang.RestFn.applyTo(RestFn.java:145) at clojure.core$apply.invokeStatic(core.clj:669) at clojure.core$load_libs.invokeStatic(core.clj:6036) at clojure.core$load_libs.doInvoke(core.clj:6020) at clojure.lang.RestFn.applyTo(RestFn.java:140) at clojure.core$apply.invokeStatic(core.clj:669) at clojure.core$require.invokeStatic(core.clj:6058) at clojure.core$require.doInvoke(core.clj:6058) at clojure.lang.RestFn.invoke(RestFn.java:424) at user$eval138$loading__6810__auto____139.invoke(user.clj:1) at user$eval138.invokeStatic(user.clj:1) at user$eval138.invoke(user.clj:1) at clojure.lang.Compiler.eval(Compiler.java:7690) at clojure.lang.Compiler.eval(Compiler.java:7679) at clojure.lang.Compiler.load(Compiler.java:8156) at clojure.lang.RT.loadResourceScript(RT.java:401) at clojure.lang.RT.loadResourceScript(RT.java:388) at clojure.lang.RT.maybeLoadResourceScript(RT.java:384) at clojure.lang.RT.doInit(RT.java:506) at clojure.lang.RT.init(RT.java:487) at clojure.main.main(main.java:38) Caused by: java.lang.NoSuchMethodError: 'void sun.misc.Unsafe.ensureClassInitialized(java.lang.Class)' at com.oracle.truffle.api.library.LibraryFactory.ensureLibraryInitialized(LibraryFactory.java:384) at com.oracle.truffle.api.library.LibraryFactory.getUncached(LibraryFactory.java:364) at com.oracle.truffle.api.library.LibraryFactory.<init>(LibraryFactory.java:210) at com.oracle.truffle.api.interop.InteropLibraryGen.<init>(InteropLibraryGen.java:170) at com.oracle.truffle.api.interop.InteropLibraryGen.<clinit>(InteropLibraryGen.java:161) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:529) at java.base/java.lang.Class.forName(Class.java:508) at com.oracle.truffle.api.library.LibraryFactory.loadGeneratedClass(LibraryFactory.java:771) at com.oracle.truffle.api.library.LibraryFactory.resolveImpl(LibraryFactory.java:734) at com.oracle.truffle.api.library.LibraryFactory.resolve(LibraryFactory.java:727) at com.oracle.truffle.api.interop.InteropLibrary.<clinit>(InteropLibrary.java:2878) at com.oracle.truffle.polyglot.PolyglotValueDispatch.<clinit>(PolyglotValueDispatch.java:156) at com.oracle.truffle.polyglot.PolyglotImpl.initialize(PolyglotImpl.java:147) at org.graalvm.polyglot.impl.AbstractPolyglotImpl.setConstructors(AbstractPolyglotImpl.java:238) at org.graalvm.polyglot.Engine$1.loadAndValidateProviders(Engine.java:845) at org.graalvm.polyglot.Engine$1.run(Engine.java:818) at org.graalvm.polyglot.Engine$1.run(Engine.java:792) at java.base/java.security.AccessController.doPrivileged(AccessController.java:319) at org.graalvm.polyglot.Engine.initEngineImpl(Engine.java:792) at org.graalvm.polyglot.Engine.access$000(Engine.java:110) at org.graalvm.polyglot.Engine$ImplHolder.<clinit>(Engine.java:136) at org.graalvm.polyglot.Engine.getImpl(Engine.java:324) at org.graalvm.polyglot.Engine$Builder.build(Engine.java:574) at org.graalvm.polyglot.Context$Builder.build(Context.java:1785) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) at java.base/java.lang.reflect.Method.invoke(Method.java:580) at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:192) at clojure.lang.Compiler$InstanceMethodExpr.eval(Compiler.java:1978) ... 121 more ("exited abnormally with code 1") error in process sentinel: Could not start nREPL server: Downloading: org/scicloj/clay/2-beta10/clay-2-beta10.pom from clojars Downloading: org/scicloj/clay/2-beta10/clay-2-beta10.jar from clojars Exception in thread "main" Syntax error macroexpanding at (markdown.clj:27:19). at clojure.lang.Compiler$InstanceMethodExpr.eval(Compiler.java:1988) at clojure.lang.Compiler$DefExpr.eval(Compiler.java:464) at clojure.lang.Compiler.eval(Compiler.java:7695) at clojure.lang.Compiler.load(Compiler.java:8156) at clojure.lang.RT.loadResourceScript(RT.java:401) at clojure.lang.RT.loadResourceScript(RT.java:392) at clojure.lang.RT.load(RT.java:479) at clojure.lang.RT.load(RT.java:444) at clojure.core$load$fn__6929.invoke(core.clj:6181) at clojure.core$load.invokeStatic(core.clj:6180) at clojure.core$load.doInvoke(core.clj:6164) at clojure.lang.RestFn.invoke(RestFn.java:411) at clojure.core$load_one.invokeStatic(core.clj:5953) at clojure.core$load_one.invoke(core.clj:5948) at clojure.core$load_lib$fn__6871.invoke(core.clj:5995) at clojure.core$load_lib.invokeStatic(core.clj:5994) at clojure.core$load_lib.doInvoke(core.clj:5973) at clojure.lang.RestFn.applyTo(RestFn.java:145) at clojure.core$apply.invokeStatic(core.clj:669) at clojure.core$load_libs.invokeStatic(core.clj:6036) at clojure.core$load_libs.doInvoke(core.clj:6020) at clojure.lang.RestFn.applyTo(RestFn.java:140) at clojure.core$apply.invokeStatic(core.clj:669) at clojure.core$require.invokeStatic(core.clj:6058) at clojure.core$require.doInvoke(core.clj:6058) at clojure.lang.RestFn.invoke(RestFn.java:808) at scicloj.clay.v2.prepare$eval5764$loading__6810__auto____5765.invoke(prepare.clj:1) at scicloj.clay.v2.prepare$eval5764.invokeStatic(prepare.clj:1) at scicloj.clay.v2.prepare$eval5764.invoke(prepare.clj:1) at clojure.lang.Compiler.eval(Compiler.java:7690) at clojure.lang.Compiler.eval(Compiler.java:7679) at clojure.lang.Compiler.load(Compiler.java:8156) at clojure.lang.RT.loadResourceScript(RT.java:401) at clojure.lang.RT.loadResourceScript(RT.java:392) at clojure.lang.RT.load(RT.java:479) at clojure.lang.RT.load(RT.java:444) at clojure.core$load$fn__6929.invoke(core.clj:6181) at clojure.core$load.invokeStatic(core.clj:6180) at clojure.core$load.doInvoke(core.clj:6164) at clojure.lang.RestFn.invoke(RestFn.java:411) at clojure.core$load_one.invokeStatic(core.clj:5953) at clojure.core$load_one.invoke(core.clj:5948) at clojure.core$load_lib$fn__6871.invoke(core.clj:5995) at clojure.core$load_lib.invokeStatic(core.clj:5994) at clojure.core$load_lib.doInvoke(core.clj:5973) at clojure.lang.RestFn.applyTo(RestFn.java:145) at clojure.core$apply.invokeStatic(core.clj:669) at clojure.core$load_libs.invokeStatic(core.clj:6036) at clojure.core$load_libs.doInvoke(core.clj:6020) at clojure.lang.RestFn.applyTo(RestFn.java:140) at clojure.core$apply.invokeStatic(core.clj:669) at clojure.core$require.invokeStatic(core.clj:6058) at clojure.core$require.doInvoke(core.clj:6058) at clojure.lang.RestFn.invoke(RestFn.java:3662) at scicloj.clay.v2.make$eval4613$loading__6810__auto____4614.invoke(make.clj:1) at scicloj.clay.v2.make$eval4613.invokeStatic(make.clj:1) at scicloj.clay.v2.make$eval4613.invoke(make.clj:1) at clojure.lang.Compiler.eval(Compiler.java:7690) at clojure.lang.Compiler.eval(Compiler.java:7679) at clojure.lang.Compiler.load(Compiler.java:8156) at clojure.lang.RT.loadResourceScript(RT.java:401) at clojure.lang.RT.loadResourceScript(RT.java:392) at clojure.lang.RT.load(RT.java:479) at clojure.lang.RT.load(RT.java:444) at clojure.core$load$fn__6929.invoke(core.clj:6181) at clojure.core$load.invokeStatic(core.clj:6180) at clojure.core$load.doInvoke(core.clj:6164) at clojure.lang.RestFn.invoke(RestFn.java:411) at clojure.core$load_one.invokeStatic(core.clj:5953) at clojure.core$load_one.invoke(core.clj:5948) at clojure.core$load_lib$fn__6871.invoke(core.clj:5995) at clojure.core$load_lib.invokeStatic(core.clj:5994) at clojure.core$load_lib.doInvoke(core.clj:5973) at clojure.lang.RestFn.applyTo(RestFn.java:145) at clojure.core$apply.invokeStatic(core.clj:669) at clojure.core$load_libs.invokeStatic(core.clj:6036) at clojure.core$load_libs.doInvoke(core.clj:6020) at clojure.lang.RestFn.applyTo(RestFn.java:140) at clojure.core$apply.invokeStatic(core.clj:669) at clojure.core$require.invokeStatic(core.clj:6058) at clojure.core$require.doInvoke(core.clj:6058) at clojure.lang.RestFn.invoke(RestFn.java:554) at scicloj.clay.v2.api$eval144$loading__6810__auto____145.invoke(api.clj:1) at scicloj.clay.v2.api$eval144.invokeStatic(api.clj:1) at scicloj.clay.v2.api$eval144.invoke(api.clj:1) at clojure.lang.Compiler.eval(Compiler.java:7690) at clojure.lang.Compiler.eval(Compiler.java:7679) at clojure.lang.Compiler.load(Compiler.java:8156) at clojure.lang.RT.loadResourceScript(RT.java:401) at clojure.lang.RT.loadResourceScript(RT.java:392) at clojure.lang.RT.load(RT.java:479) at clojure.lang.RT.load(RT.java:444) at clojure.core$load$fn__6929.invoke(core.clj:6181) at clojure.core$load.invokeStatic(core.clj:6180) at clojure.core$load.doInvoke(core.clj:6164) at clojure.lang.RestFn.invoke(RestFn.java:411) at clojure.core$load_one.invokeStatic(core.clj:5953) at clojure.core$load_one.invoke(core.clj:5948) at clojure.core$load_lib$fn__6871.invoke(core.clj:5995) at clojure.core$load_lib.invokeStatic(core.clj:5994) at clojure.core$load_lib.doInvoke(core.clj:5973) at clojure.lang.RestFn.applyTo(RestFn.java:145) at clojure.core$apply.invokeStatic(core.clj:669) at clojure.core$load_libs.invokeStatic(core.clj:6036) at clojure.core$load_libs.doInvoke(core.clj:6020) at clojure.lang.RestFn.applyTo(RestFn.java:140) at clojure.core$apply.invokeStatic(core.clj:669) at clojure.core$require.invokeStatic(core.clj:6058) at clojure.core$require.doInvoke(core.clj:6058) at clojure.lang.RestFn.invoke(RestFn.java:424) at user$eval138$loading__6810__auto____139.invoke(user.clj:1) at user$eval138.invokeStatic(user.clj:1) at user$eval138.invoke(user.clj:1) at clojure.lang.Compiler.eval(Compiler.java:7690) at clojure.lang.Compiler.eval(Compiler.java:7679) at clojure.lang.Compiler.load(Compiler.java:8156) at clojure.lang.RT.loadResourceScript(RT.java:401) at clojure.lang.RT.loadResourceScript(RT.java:388) at clojure.lang.RT.maybeLoadResourceScript(RT.java:384) at clojure.lang.RT.doInit(RT.java:506) at clojure.lang.RT.init(RT.java:487) at clojure.main.main(main.java:38) Caused by: java.lang.NoSuchMethodError: 'void sun.misc.Unsafe.ensureClassInitialized(java.lang.Class)' at com.oracle.truffle.api.library.LibraryFactory.ensureLibraryInitialized(LibraryFactory.java:384) at com.oracle.truffle.api.library.LibraryFactory.getUncached(LibraryFactory.java:364) at com.oracle.truffle.api.library.LibraryFactory.<init>(LibraryFactory.java:210) at com.oracle.truffle.api.interop.InteropLibraryGen.<init>(InteropLibraryGen.java:170) at com.oracle.truffle.api.interop.InteropLibraryGen.<clinit>(InteropLibraryGen.java:161) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:529) at java.base/java.lang.Class.forName(Class.java:508) at com.oracle.truffle.api.library.LibraryFactory.loadGeneratedClass(LibraryFactory.java:771) at com.oracle.truffle.api.library.LibraryFactory.resolveImpl(LibraryFactory.java:734) at com.oracle.truffle.api.library.LibraryFactory.resolve(LibraryFactory.java:727) at com.oracle.truffle.api.interop.InteropLibrary.<clinit>(InteropLibrary.java:2878) at com.oracle.truffle.polyglot.PolyglotValueDispatch.<clinit>(PolyglotValueDispatch.java:156) at com.oracle.truffle.polyglot.PolyglotImpl.initialize(PolyglotImpl.java:147) at org.graalvm.polyglot.impl.AbstractPolyglotImpl.setConstructors(AbstractPolyglotImpl.java:238) at org.graalvm.polyglot.Engine$1.loadAndValidateProviders(Engine.java:845) at org.graalvm.polyglot.Engine$1.run(Engine.java:818) at org.graalvm.polyglot.Engine$1.run(Engine.java:792) at java.base/java.security.AccessController.doPrivileged(AccessController.java:319) at org.graalvm.polyglot.Engine.initEngineImpl(Engine.java:792) at org.graalvm.polyglot.Engine.access$000(Engine.java:110) at org.graalvm.polyglot.Engine$ImplHolder.<clinit>(Engine.java:136) at org.graalvm.polyglot.Engine.getImpl(Engine.java:324) at org.graalvm.polyglot.Engine$Builder.build(Engine.java:574) at org.graalvm.polyglot.Context$Builder.build(Context.java:1785) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) at java.base/java.lang.reflect.Method.invoke(Method.java:580) at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:192) at clojure.lang.Compiler$InstanceMethodExpr.eval(Compiler.java:1978) ... 121 more ("exited abnormally with code 1")
I don't have time to look at this at the moment, but it looks like it could be a clay issue.
It could be due to the version and origin of your JVM or other dependencies in your project. I think I have seen that markdown problem with Sun elsewhere. It works for me:
clj -Sdeps '{:deps {s/w {:git/url "https://github.com/scicloj/wolframite" :git/sha "f27e5f30f65e2fea616d5f10b78be7b1b293cebe"} org.clojure/clojure {:mvn/version "1.12.0-alpha12"}}}'
Checking out: https://github.com/scicloj/wolframite at f27e5f30f65e2fea616d5f10b78be7b1b293cebe
Clojure 1.12.0-alpha12
user=> (require '[wolframite.core :as w])
nil
user=> (w/init!)
=== Adding path to classpath: /Applications/Wolfram Engine.app/Contents/Resources/Wolfram Player.app/Contents/SystemFiles/Links/JLink/JLink.jar ===
nil
user=> (Class/forName "com.wolfram.jlink.Expr")
com.wolfram.jlink.Expr
I just must remember to not use the same lib name for wolframite and jlink 😅
Issue: We want to give users more control and to make expensive, side-effecting operations explicit.
Fix: Rename old init! to init-kernel! and add a new one, which calls kernel init as well as pre-loading some stuff into Wolfram, and storing the provided
opts
for use during eval calls. Get rid of the make-evaluator, as its role is taken by init!. Also, to push dependency on actual JLink classes to runtime, when they are actually used, introduce a protocol.Bonus: Replace pomegrante with add-lib from clojure 1.12, clean up code.