Skip to content

artifacts cache populated incorrectly #284

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
BrunoBonacci opened this issue Jan 11, 2020 · 0 comments · Fixed by #285
Closed

artifacts cache populated incorrectly #284

BrunoBonacci opened this issue Jan 11, 2020 · 0 comments · Fixed by #285

Comments

@BrunoBonacci
Copy link
Contributor

BrunoBonacci commented Jan 11, 2020

when *print-length* is set the cache is truncated and cljr-add-project-dependency fails with the following error

cljr--get-error-value: Error in nrepl-refactor: clojure.lang.Compiler$CompilerException: Syntax error compiling at (refactor_nrepl/artifacts.clj:25:1).
#:clojure.error{:phase :compile-syntax-check, :line 25, :column 1, :source "refactor_nrepl/artifacts.clj"}
 at clojure.lang.Compiler.load (Compiler.java:7648)
    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)
...
Caused by: java.lang.RuntimeException: Map literal must contain an even number of forms
 at clojure.lang.Util.runtimeException (Util.java:221)
    clojure.lang.EdnReader$MapReader.invoke (EdnReader.java:682)
    clojure.lang.EdnReader.read (EdnReader.java:145)
    clojure.lang.EdnReader.read (EdnReader.java:111)
    clojure.lang.EdnReader.readString (EdnReader.java:67)
    clojure.edn$read_string.invokeStatic (edn.clj:46)
    clojure.edn$read_string.invokeStatic (edn.clj:37)
    clojure.edn$read_string.invoke (edn.clj:37)
    refactor_nrepl.artifacts$eval10433.invokeStatic (artifacts.clj:27)
    refactor_nrepl.artifacts$eval10433.invoke (artifacts.clj:26)
    clojure.lang.Compiler.eval (Compiler.java:7177)
    clojure.lang.Compiler.load (Compiler.java:7636)
    clojure.lang.RT.loadResourceScript (RT.java:3

as the cache will contain an ellipsis

{ ***some-content***,
"adzerk/boot-jar2bin" ("1.2.0" "1.1.1" "1.1.0" "1.0.0" "0.1.0"), ...}

This is because pr and derivates respect *print-length*

(set! *print-length* 10)
(pr-str (range 20))
;; "(0 1 2 3 4 5 6 7 8 9 ...)"

the fix for this is as follow:

(binding [*print-length* nil
            *print-level*  nil]
    (pr-str (range 20)))
;; "(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant