scicloj / viz.clj

A Clojure data visualization library
Other
26 stars 1 forks source link

0.1.1 Incompatibility with clerk? #8

Open mars0i opened 2 years ago

mars0i commented 2 years ago

I'm getting an error when I try to use viz.clj 0.1.1 with the current clerk release, 0.4.316. Not sure if I should report this as an issue for clerk too. (I don't assume that it's worth fixing this problem in viz.clj at this point--there may be higher priorities than clerk compatibility--but I thought I'd make a note of it.)

Here's an MWE with Leiningen: project.clj:

(defproject errordemo "0.1.0-SNAPSHOT"
  :dependencies [[org.clojure/clojure "1.10.3"]
         [io.github.nextjournal/clerk "0.4.316"]
                 [org.scicloj/viz.clj "0.1.1"]
                 [aerial.hanami "0.17.0"]])

errordemo.core.clj:

(ns errordemo.core
   (:require [nextjournal.clerk :as clerk]))

The error:

user=> (require 'errordemo.core)
Execution error (IllegalArgumentException) at com.oracle.truffle.polyglot.PolyglotEngineException/illegalArgument (PolyglotEngineException.java:128).
Could not find option with name engine.WarnInterpreterOnly.

If I comment out [org.scicloj/viz.clj "0.1.1"] in the project file or stop requireing clerk in core.clj, the error goes away. It still happens if I comment out the hanami line in project.clj, but since viz.clj uses hanami, I include it in the example.

(I'm trying to use viz.clj with clerk because I'm having trouble with errors from notespace, and I haven't yet been able to sort out the notespace problems enough that it's worth submitting an issue or asking on Zulip. I suspect that they'll get resolved eventually anyway, but I'll report them if I can figure out what to report. My working Clojure/Java/etc. configuration might be unusual--not sure.)

mars0i commented 2 years ago

Oh, forgot to include the stacktrace. Here it is. Not sure where markdown.clj is. There's no such file in viz.clj. There's a markdown.clj in clerk, but it's only 5 lines long, not 24 as in the first line in the stacktrace.

user=> (pst)
CompilerException Syntax error macroexpanding at (markdown.clj:24:19). #:clojure.error{:phase :execution, :line 24, :column 19, :source "markdown.clj"}
    clojure.lang.Compiler$InstanceMethodExpr.eval (Compiler.java:1562)
    clojure.lang.Compiler$DefExpr.eval (Compiler.java:457)
    clojure.lang.Compiler.eval (Compiler.java:7186)
    clojure.lang.Compiler.load (Compiler.java:7640)
    clojure.lang.RT.loadResourceScript (RT.java:381)
    clojure.lang.RT.loadResourceScript (RT.java:372)
    clojure.lang.RT.load (RT.java:459)
    clojure.lang.RT.load (RT.java:424)
    clojure.core/load/fn--6856 (core.clj:6115)
    clojure.core/load (core.clj:6114)
    clojure.core/load (core.clj:6098)
    clojure.core/load-one (core.clj:5897)
Caused by:
IllegalArgumentException Could not find option with name engine.WarnInterpreterOnly.
    com.oracle.truffle.polyglot.PolyglotEngineException.illegalArgument (PolyglotEngineException.java:128)
    com.oracle.truffle.polyglot.OptionValuesImpl.failNotFound (OptionValuesImpl.java:283)
    com.oracle.truffle.polyglot.OptionValuesImpl.failNotFound (OptionValuesImpl.java:263)
    com.oracle.truffle.polyglot.OptionValuesImpl.findDescriptor (OptionValuesImpl.java:240)
    com.oracle.truffle.polyglot.OptionValuesImpl.put (OptionValuesImpl.java:142)
    com.oracle.truffle.polyglot.OptionValuesImpl.putAll (OptionValuesImpl.java:137)
    com.oracle.truffle.polyglot.PolyglotImpl.createEngineOptions (PolyglotImpl.java:296)
    com.oracle.truffle.polyglot.PolyglotImpl.buildEngine (PolyglotImpl.java:234)
    org.graalvm.polyglot.Engine$Builder.build (Engine.java:546)
    org.graalvm.polyglot.Context$Builder.build (Context.java:1616)
    sun.reflect.NativeMethodAccessorImpl.invoke0 (NativeMethodAccessorImpl.java:-2)
    sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
ashimapanjwani commented 2 years ago

@mars0i Thanks a lot for opening the issue. Your detailed notes will be extremely helpful in exploring this issue. Will look into it and get back to you with a possible fix

daslu commented 2 years ago

Interesting.

By the way, a Clojure CLI project (that is typically more clever handling dependency conflicts) does work, with the following deps.edn:

{:deps {org.clojure/clojure {:mvn/version "1.10.3"}
    io.github.nextjournal/clerk {:mvn/version "0.4.316"}
        org.scicloj/viz.clj {:mvn/version "0.1.1"}
        aerial.hanami {:mvn/version "0.17.0"}}}
mars0i commented 2 years ago

Thanks @ashimapanjwani , @daslu. I verified that deps.edn and clj make the error go away on my system, too. I didn't know that about CLI. (Inertia, pragmatic concerns, and a preference for nREPL's history mechanism over rlwrap have kept me from switching from Leiningen, but maybe I should.)