when trying to compile clojure master, I get this error:
compile-clojure:
[java] Exception in thread "main" java.lang.ExceptionInInitializerError
[java] at clojure.lang.Compile.<clinit>(Compile.java:29)
[java] Caused by: Syntax error compiling at (clojure/core.clj:7053:1).
[java] at clojure.lang.Compiler.load(Compiler.java:7648)
[java] at clojure.lang.RT.loadResourceScript(RT.java:381)
[java] at clojure.lang.RT.loadResourceScript(RT.java:372)
[java] at clojure.lang.RT.load(RT.java:459)
[java] at clojure.lang.RT.load(RT.java:424)
[java] at clojure.lang.RT.<clinit>(RT.java:338)
[java] ... 1 more
[java] Caused by: java.lang.NumberFormatException: null
[java] at java.base/java.lang.Integer.parseInt(Integer.java:614)
[java] at java.base/java.lang.Integer.valueOf(Integer.java:983)
[java] at clojure.core$eval4288.invokeStatic(core.clj:7065)
[java] at clojure.core$eval4288.invoke(core.clj:7055)
[java] at clojure.lang.Compiler.eval(Compiler.java:7177)
[java] at clojure.lang.Compiler.load(Compiler.java:7636)
[java] ... 6 more
anyone else seeing this?
I'm running mvn package -Dmaven.test.skip=true
did you clean?
now I did, but same issue
it builds every day here https://build.clojure.org/job/clojure/ - haven't seen any issues
java -version
?
what version + jvm @borkdude
build matrix uses 8-11, but I've tested with 12 and 13
now it worked. mvn clean
didn't work, but rm -rf target
did 😕
$ java -version
openjdk version "1.8.0_212"
$ mvn -version
Apache Maven 3.6.2 (40f52333136460af0dc0d7232c0dc0bcf0d9e117; 2019-08-27T17:06:16+02:00)
thanks.
it seems loading clojure.string in spec.alpha can be avoided (it isn't used for anything there)
Regarding your deleted comment of why clojure.string/... works without require'ing clojure.string, IIRC there is a subset (not all) of the namespaces that come with the Clojure JAR that are require'd during init.
you should never rely on that
as they may change
^^^
not making any fixes to spec.alpha
I'm not saying you should rely on it, but it explains why it works?
require just means to load
it happens that clojure.string is required within clojure.core, iirc
some namespaces loaded during bootstrap load other stuff
but again, that may change
will likely change
the only thing you never have to require is clojure.core
> it happens that clojure.string is required within clojure.core I don't see that anywhere in core.clj?
you guys are tag-teaming us 🙂
that would be a great thing to warn on @borkdude
currently, bootstrap loads clojure.core.server, which loads clojure.string
Some namespaces are created during init other than clojure.core, might be more precise than saying they are require'd.
we have a pending ticket that will avoid loading clojure.core.server (and thus clojure.string) in the case that you don't have socket servers to load
clojure.core
-> <http://clojure.java.io|clojure.java.io>
-> clojure.string
is another place
where the require happens
if we change the order or set of these requires and your code breaks, I'm going to claim your code was already broken :)
(tongue in cheek) Clojure 1.11 seems due for reminding people that clojure.core/hash values can change across releases
@alexmiller that's not why I brought this up. I brought it up because loading namespaces unnecessarily can slow down startup time.
yes, and the point above is - we might improve that in the core :)
(although clojure.string would not likely be a huge win)
although compared to loading core, the rest are pretty tiny
we should just add the hash of the release version into all hashes :)
for continuity (or something like that) the hash of mutable Java collections can include the hash of the previous release version 🙂
if you find anything for spec-alpha2, let me know and I'll fix. I think that one was fixed long ago.
the reason I looked at this was I tried out a patch for CLJ-1472. some notes here: https://gist.github.com/borkdude/dd0857cf1958b25496fddbdbf359ca59
if the patch doesn't apply, it needs to be rebased over current master. patches drift....
@borkdude when you tried CLJ-1472-reentrant-finally2.patch
, which program wasn't loadable by Graal native-image?
and did you compile spec.alpha, too?
@ghadi I updated the notes with the exception I saw during the GraalVM compilation
I first compiled clojure, then spec and then clojure using that compiled spec
I don't think spec.alpha was compiled with the patched clojure if that error cropped up
you would need to change the spec pom.xml to include the patched clojure
yup
(the spec.alpha artifact in Maven is AOT compiled, and it contains a locking
expr)
you're right, I made a mistake there
I'll retry
got rid of that mistake, still same error.
I wanted to get leiningen out of the loop, so I tried this: https://gist.github.com/borkdude/dd0857cf1958b25496fddbdbf359ca59#trying-to-compile-only-using-toolsdeps not sure why it can't find the main entrypoint. I'll try some more later, getting late here