Skip to content
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

Leiningen creates non-backwards compatible data_readers.clj #2530

Closed
opqdonut opened this issue Feb 13, 2019 · 3 comments · Fixed by #2531

Comments

@opqdonut
Copy link
Contributor

commented Feb 13, 2019

Steps to reproduce:

% docker run -it clojure:openjdk-8-lein bash 
root@aa41a92991df:/tmp# echo '(defproject bug "bug" :dependencies [[org.clojure/clojure "1.8.0"] [org.flatland/ordered "1.5.6"]])' > project.clj
root@aa41a92991df:/tmp# lein uberjar
Created /tmp/target/bug-bug.jar
Created /tmp/target/bug-bug-standalone.jar
root@aa41a92991df:/tmp# java -cp /tmp/target/bug-bug-standalone.jar clojure.main
clojure.lang.LispReader$ReaderException: java.lang.RuntimeException: Reader tag must be a symbol
	at clojure.lang.LispReader.read(LispReader.java:292)
	at clojure.lang.LispReader.read(LispReader.java:196)
	at clojure.lang.LispReader.read(LispReader.java:185)
	at clojure.core$read.invokeStatic(core.clj:3666)
	at clojure.core$load_data_reader_file.invokeStatic(core.clj:7485)
	at clojure.core$load_data_reader_file.invoke(core.clj:7480)
	at clojure.core.protocols$fn__6755.invokeStatic(protocols.clj:167)
	at clojure.core.protocols$fn__6755.invoke(protocols.clj:124)
	at clojure.core.protocols$fn__6710$G__6705__6719.invoke(protocols.clj:19)
	at clojure.core.protocols$seq_reduce.invokeStatic(protocols.clj:31)
	at clojure.core.protocols$fn__6738.invokeStatic(protocols.clj:75)
	at clojure.core.protocols$fn__6738.invoke(protocols.clj:75)
	at clojure.core.protocols$fn__6684$G__6679__6697.invoke(protocols.clj:13)
	at clojure.core$reduce.invokeStatic(core.clj:6545)
	at clojure.core$load_data_readers$fn__7291.invoke(core.clj:7511)
	at clojure.lang.AFn.applyToHelper(AFn.java:154)
	at clojure.lang.AFn.applyTo(AFn.java:144)
	at clojure.lang.Var.alterRoot(Var.java:303)
	at clojure.core$alter_var_root.invokeStatic(core.clj:5299)
	at clojure.core$alter_var_root.doInvoke(core.clj:5294)
	at clojure.lang.RestFn.invoke(RestFn.java:425)
	at clojure.core$load_data_readers.invokeStatic(core.clj:7510)
	at clojure.core$fn__7294.invokeStatic(core.clj:7515)
	at clojure.core$fn__7294.invoke(core.clj:7515)
	at clojure.core__init.load(Unknown Source)
	at clojure.core__init.<clinit>(Unknown Source)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)
	at clojure.lang.RT.classForName(RT.java:2168)
	at clojure.lang.RT.classForName(RT.java:2177)
	at clojure.lang.RT.loadClassForName(RT.java:2196)
	at clojure.lang.RT.load(RT.java:443)
	at clojure.lang.RT.load(RT.java:419)
	at clojure.lang.RT.doInit(RT.java:461)
	at clojure.lang.RT.<clinit>(RT.java:331)
	at clojure.main.<clinit>(main.java:20)
Caused by: java.lang.RuntimeException: Reader tag must be a symbol
	at clojure.lang.LispReader$CtorReader.invoke(LispReader.java:1221)
	at clojure.lang.LispReader$DispatchReader.invoke(LispReader.java:684)
	at clojure.lang.LispReader.read(LispReader.java:263)
	... 35 more
Exception in thread "main" java.lang.ExceptionInInitializerError
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)
	at clojure.lang.RT.classForName(RT.java:2168)
	at clojure.lang.RT.classForName(RT.java:2177)
	at clojure.lang.RT.loadClassForName(RT.java:2196)
	at clojure.lang.RT.load(RT.java:443)
	at clojure.lang.RT.load(RT.java:419)
	at clojure.lang.RT.doInit(RT.java:461)
	at clojure.lang.RT.<clinit>(RT.java:331)
	at clojure.main.<clinit>(main.java:20)
Caused by: clojure.lang.LispReader$ReaderException: java.lang.RuntimeException: Reader tag must be a symbol
	at clojure.lang.LispReader.read(LispReader.java:292)
	at clojure.lang.LispReader.read(LispReader.java:196)
	at clojure.lang.LispReader.read(LispReader.java:185)
	at clojure.core$read.invokeStatic(core.clj:3666)
	at clojure.core$load_data_reader_file.invokeStatic(core.clj:7485)
	at clojure.core$load_data_reader_file.invoke(core.clj:7480)
	at clojure.core.protocols$fn__6755.invokeStatic(protocols.clj:167)
	at clojure.core.protocols$fn__6755.invoke(protocols.clj:124)
	at clojure.core.protocols$fn__6710$G__6705__6719.invoke(protocols.clj:19)
	at clojure.core.protocols$seq_reduce.invokeStatic(protocols.clj:31)
	at clojure.core.protocols$fn__6738.invokeStatic(protocols.clj:75)
	at clojure.core.protocols$fn__6738.invoke(protocols.clj:75)
	at clojure.core.protocols$fn__6684$G__6679__6697.invoke(protocols.clj:13)
	at clojure.core$reduce.invokeStatic(core.clj:6545)
	at clojure.core$load_data_readers$fn__7291.invoke(core.clj:7511)
	at clojure.lang.AFn.applyToHelper(AFn.java:154)
	at clojure.lang.AFn.applyTo(AFn.java:144)
	at clojure.lang.Var.alterRoot(Var.java:303)
	at clojure.core$alter_var_root.invokeStatic(core.clj:5299)
	at clojure.core$alter_var_root.doInvoke(core.clj:5294)
	at clojure.lang.RestFn.invoke(RestFn.java:425)
	at clojure.core$load_data_readers.invokeStatic(core.clj:7510)
	at clojure.core$fn__7294.invokeStatic(core.clj:7515)
	at clojure.core$fn__7294.invoke(core.clj:7515)
	at clojure.core__init.load(Unknown Source)
	at clojure.core__init.<clinit>(Unknown Source)
	... 10 more
Caused by: java.lang.RuntimeException: Reader tag must be a symbol
	at clojure.lang.LispReader$CtorReader.invoke(LispReader.java:1221)
	at clojure.lang.LispReader$DispatchReader.invoke(LispReader.java:684)
	at clojure.lang.LispReader.read(LispReader.java:263)
	... 35 more

This is because the generated data_readers.clj uses namespaced map syntax, which clojure 1.8 doesn't support:

root@aa41a92991df:/tmp# unzip -c /tmp/target/bug-bug-standalone.jar data_readers.clj
Archive:  /tmp/target/bug-bug-standalone.jar
  inflating: data_readers.clj        
#:ordered{set flatland.ordered.set/into-ordered-set, map flatland.ordered.map/ordered-map}
@opqdonut

This comment has been minimized.

Copy link
Contributor Author

commented Feb 13, 2019

Oh right, some version info:

root@aa41a92991df:/tmp# lein --version
Leiningen 2.9.0 on Java 1.8.0_181 OpenJDK 64-Bit Server VM
@technomancy technomancy added the bug label Feb 13, 2019
@technomancy

This comment has been minimized.

Copy link
Owner

commented Feb 13, 2019

Wow, I had no idea the latest Clojure would break this. Ugh. What a mess.

Thanks for pointing this out.

@opqdonut

This comment has been minimized.

Copy link
Contributor Author

commented Feb 14, 2019

I'll try to make a quick PR for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.