Fork me on GitHub
#sci
<
2022-07-21
>
zane22:07:17

This isn’t a bug report (I can’t reproduce with the latest version of sci) but I’m dying to know why sci.core/eval-string hangs on trivial inputs (e.g. "0") on sci 0.2.7 if reitit is also included as a dependency. 😆 :thinking_face:

zane22:07:46

Weirdly, I don’t even need to require reitit!

zane22:07:24

❯ nix-shell --pure  -p clojure

[nix-shell:~]$ timeout -v 60 clojure -Srepro -Sdeps '{:deps {metosin/reitit {:mvn/version "0.5.18"} org.babashka/sci {:mvn/version "0.2.7"}}}' -M -e "(require '[sci.core :as sci]) (sci/eval-string \"0\")"

timeout: sending signal TERM to command 'clojure'

zane22:07:02

Works fine if reitit is excluded:

[nix-shell:~]$ time clojure -Srepro -Sdeps '{:deps {org.babashka/sci {:mvn/version "0.2.7"}}}' -M -e "(require '[sci.core :as sci]) (sci/eval-string \"0\")"
0

real	0m4.011s
user	0m14.914s
sys	0m0.576s

zane22:07:36

Also works with sci 0.2.8:

[nix-shell:~]$ time clojure -Srepro -Sdeps '{:deps {metosin/reitit {:mvn/version "0.5.18"} org.babashka/sci {:mvn/version "0.2.8"}}}' -M -e "(require '[sci.core :as sci]) (sci/eval-string \"0\")"
0

real	0m4.263s
user	0m15.740s
sys	0m0.657s

zane23:07:14

Simply requiring sci is fine, even with reitit:

[nix-shell:~]$ time clojure -Srepro -Sdeps '{:deps {metosin/reitit {:mvn/version "0.5.18"} org.babashka/sci {:mvn/version "0.2.7"}}}' -M -e "(require '[sci.core :as sci])"

real	0m4.255s
user	0m20.633s
sys	0m0.658s

zane23:07:54

I’ve been staring at the 0.2.8 changelog and nothing stands out. 😆 https://github.com/babashka/sci/blob/master/CHANGELOG.md#v028

borkdude05:07:59

Probably because of Malli which included another version of sci under my personal GitHub account. Inspect the classpath, there's likely two versions of SCI on there