technomancy / leiningen

Moved to Codeberg; this is a convenience mirror
https://codeberg.org/leiningen/leiningen
Other
7.29k stars 1.61k forks source link

2.5.2-SNAPSHOT doesn't build on Windows 7 with Java 8 #1899

Closed winks closed 9 years ago

winks commented 9 years ago

I just tried to build while helping someone on irc and this was the result: (after hanging forever at ''Compiling leiningen.release")

c:\leiningen\leiningen-core>c:\Apps\bin\lein.bat version
Leiningen 2.5.1 on Java 1.8.0_45 Java HotSpot(TM) 64-Bit Server VM
c:\leiningen\leiningen-core>c:\Apps\bin\lein.bat bootstrap
Created c:\leiningen\leiningen-core\target\leiningen-core-2.5.2-SNAPSHOT.jar
Wrote c:\leiningen\leiningen-core\pom.xml
Installed jar and pom into local repo.
c:\leiningen\leiningen-core>cd ..
c:\leiningen>c:\Apps\bin\lein.bat compile
c:\leiningen>c:\Apps\bin\lein.bat uberjar
Compiling leiningen.search
...
Compiling leiningen.release
...
        at java.lang.ClassLoader.loadClass(Unknown Source)

sometimes I also get Compilation failed: java.lang.StackOverflowError, compiling:(leiningen/release.clj:106:8)

winks commented 9 years ago

Managed to capture everything. https://gist.github.com/winks/8bf274a4dd6534a1fcbc

didasoft commented 9 years ago

I've found the same issue, my java version also the same. Is this issue fixed?

hypirion commented 9 years ago

Is it possible to build 2.6.0-SNAPSHOT?

winks commented 9 years ago

Doesn't look good. Leiningen 2.5.3 on Java 1.8.0_60 Java HotSpot(TM) 64-Bit Server VM

Error output is here: gist

Oh, one thing, not sure if important. CONTRIBUTING.md says:

$ cd leiningen-core
$ lein bootstrap
$ cd ..
$ bin/lein compile
## or the bat file on Windows.

but I have to use my c:\apps\bin\lein.bat in the last step as well, or I'll get this error:

Die Datei ""C:\...\GitHub\leiningen\leiningen-core\.lein-bootstrap"" kann nicht gefunden werden.
Bei Zeile:1 Zeichen:15
+ .\bin\lein.bat <<<<  compile > d:\foo2.txt 2>&1
    + CategoryInfo          : NotSpecified: (Die Datei ""C:\...efunden werden. 
   :String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

Leiningen is missing its dependencies.
Please run "lein bootstrap" in the leiningen-core/ directory
with a stable release of Leiningen. See CONTRIBUTING.md for details.

Translation:

Die Datei ""C:\...\GitHub\leiningen\leiningen-core\.lein-bootstrap"" kann nicht gefunden werden.
File ""C:\...\GitHub\leiningen\leiningen-core\.lein-bootstrap"" could not be found.

But it is there. Maybe because -to Windows- it has no filename, just an extension...

winks commented 9 years ago

OK, some more info on this.

Doing the exact same steps on Java8 + 2.5.3 on Debian = roughly the same error gist Doing the exact same steps on Java7 + 2.5.3 on Debian = :+1: gist

hypirion commented 9 years ago

Hmm, the debain errors are very strange. My attempt of building with Java8 seems to work as intended. Are you in a clean working tree/on latest master?

winks commented 9 years ago

clean as in rebased to upstream/master. Oh, and I used the Oracle JVM.

hypirion commented 9 years ago

@winks Is this making one unable to run lein test on leiningen on Windows as well?

winks commented 9 years ago

Nope,

   clojure.lang.DynamicClassLoader.loadClass (DynamicClassLoader.java:77)
   java.lang.ClassLoader.loadClass (:-1)

many many times

full output:

lein.bat : Compiling leiningen.search
Bei Zeile:1 Zeichen:5
+ lein <<<<  test > x 2>&1
    + CategoryInfo          : NotSpecified: (Compiling leiningen.search:String 
   ) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

WARNING: update already refers to: #'clojure.core/update in namespace: clj-http
.client, being replaced by: #'clj-http.client/update

(WARNING: user-level profile defined in project files.)

clojure.lang.Compiler$CompilerException: java.lang.ExceptionInInitializerError, compiling:(leiningen/test/release.clj:1:1)
 at clojure.lang.Compiler.load (Compiler.java:7239)
    clojure.lang.RT.loadResourceScript (RT.java:371)
    clojure.lang.RT.loadResourceScript (RT.java:362)
    clojure.lang.RT.load (RT.java:446)
    clojure.lang.RT.load (RT.java:412)
    clojure.core$load$fn__5448.invoke (core.clj:5866)
    clojure.core$load.doInvoke (core.clj:5865)
    clojure.lang.RestFn.invoke (RestFn.java:408)
    clojure.core$load_one.invoke (core.clj:5671)
    clojure.core$load_lib$fn__5397.invoke (core.clj:5711)
    clojure.core$load_lib.doInvoke (core.clj:5710)
    clojure.lang.RestFn.applyTo (RestFn.java:142)
    clojure.core$apply.invoke (core.clj:632)
    clojure.core$load_libs.doInvoke (core.clj:5749)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invoke (core.clj:632)
    clojure.core$require.doInvoke (core.clj:5832)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invoke (core.clj:632)
    user$eval832.invoke (NO_SOURCE_FILE:0)
    clojure.lang.Compiler.eval (Compiler.java:6782)
    clojure.lang.Compiler.eval (Compiler.java:6772)
    clojure.lang.Compiler.eval (Compiler.java:6745)
    clojure.core$eval.invoke (core.clj:3081)
    leiningen.core.eval/fn (eval.clj:333)
    clojure.lang.MultiFn.invoke (MultiFn.java:233)
    leiningen.core.eval$eval_in_project.invoke (eval.clj:356)
    leiningen.test$test.doInvoke (test.clj:196)
    clojure.lang.RestFn.invoke (RestFn.java:410)
    clojure.lang.Var.invoke (Var.java:379)
    clojure.lang.AFn.applyToHelper (AFn.java:154)
    clojure.lang.Var.applyTo (Var.java:700)
    clojure.core$apply.invoke (core.clj:632)
    leiningen.core.main$partial_task$fn__6030.doInvoke (main.clj:261)
    clojure.lang.RestFn.invoke (RestFn.java:410)
    clojure.lang.AFn.applyToHelper (AFn.java:154)
    clojure.lang.RestFn.applyTo (RestFn.java:132)
    clojure.lang.AFunction$1.doInvoke (AFunction.java:29)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invoke (core.clj:632)
    leiningen.core.main$apply_task.invoke (main.clj:311)
    leiningen.core.main$resolve_and_apply.invoke (main.clj:317)
    leiningen.core.main$_main$fn__6096.invoke (main.clj:390)
    leiningen.core.main$_main.doInvoke (main.clj:383)
    clojure.lang.RestFn.invoke (RestFn.java:408)
    clojure.lang.Var.invoke (Var.java:379)
    clojure.lang.AFn.applyToHelper (AFn.java:154)
    clojure.lang.Var.applyTo (Var.java:700)
    clojure.core$apply.invoke (core.clj:630)
    clojure.main$main_opt.invoke (main.clj:316)
    clojure.main$main.doInvoke (main.clj:421)
    clojure.lang.RestFn.invoke (RestFn.java:436)
    clojure.lang.Var.invoke (Var.java:388)
    clojure.lang.AFn.applyToHelper (AFn.java:160)
    clojure.lang.Var.applyTo (Var.java:700)
    clojure.main.main (main.java:37)
Caused by: java.lang.ExceptionInInitializerError: null
 at java.lang.Class.forName0 (:-2)
    java.lang.Class.forName (:-1)
    clojure.lang.RT.classForName (RT.java:2154)
    clojure.lang.RT.classForName (RT.java:2163)
    clojure.lang.RT.loadClassForName (RT.java:2182)
    clojure.lang.RT.load (RT.java:436)
    clojure.lang.RT.load (RT.java:412)
    clojure.core$load$fn__5448.invoke (core.clj:5866)
    clojure.core$load.doInvoke (core.clj:5865)
    clojure.lang.RestFn.invoke (RestFn.java:408)
    clojure.core$load_one.invoke (core.clj:5671)
    clojure.core$load_lib$fn__5397.invoke (core.clj:5711)
    clojure.core$load_lib.doInvoke (core.clj:5710)
    clojure.lang.RestFn.applyTo (RestFn.java:142)
    clojure.core$apply.invoke (core.clj:632)
    clojure.core$load_libs.doInvoke (core.clj:5749)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invoke (core.clj:632)
    clojure.core$require.doInvoke (core.clj:5832)
    clojure.lang.RestFn.invoke (RestFn.java:436)
    leiningen.test.release$eval4339$loading__5340__auto____4340.invoke (release.clj:1)
    leiningen.test.release$eval4339.invoke (release.clj:1)
    clojure.lang.Compiler.eval (Compiler.java:6782)
    clojure.lang.Compiler.eval (Compiler.java:6771)
    clojure.lang.Compiler.load (Compiler.java:7227)
    clojure.lang.RT.loadResourceScript (RT.java:371)
    clojure.lang.RT.loadResourceScript (RT.java:362)
    clojure.lang.RT.load (RT.java:446)
    clojure.lang.RT.load (RT.java:412)
    clojure.core$load$fn__5448.invoke (core.clj:5866)
    clojure.core$load.doInvoke (core.clj:5865)
    clojure.lang.RestFn.invoke (RestFn.java:408)
    clojure.core$load_one.invoke (core.clj:5671)
    clojure.core$load_lib$fn__5397.invoke (core.clj:5711)
    clojure.core$load_lib.doInvoke (core.clj:5710)
    clojure.lang.RestFn.applyTo (RestFn.java:142)
    clojure.core$apply.invoke (core.clj:632)
    clojure.core$load_libs.doInvoke (core.clj:5749)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invoke (core.clj:632)
    clojure.core$require.doInvoke (core.clj:5832)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invoke (core.clj:632)
    user$eval832.invoke (NO_SOURCE_FILE:0)
    clojure.lang.Compiler.eval (Compiler.java:6782)
    clojure.lang.Compiler.eval (Compiler.java:6772)
    clojure.lang.Compiler.eval (Compiler.java:6745)
    clojure.core$eval.invoke (core.clj:3081)
    leiningen.core.eval/fn (eval.clj:333)
    clojure.lang.MultiFn.invoke (MultiFn.java:233)
    leiningen.core.eval$eval_in_project.invoke (eval.clj:356)
    leiningen.test$test.doInvoke (test.clj:196)
    clojure.lang.RestFn.invoke (RestFn.java:410)
    clojure.lang.Var.invoke (Var.java:379)
    clojure.lang.AFn.applyToHelper (AFn.java:154)
    clojure.lang.Var.applyTo (Var.java:700)
    clojure.core$apply.invoke (core.clj:632)
    leiningen.core.main$partial_task$fn__6030.doInvoke (main.clj:261)
    clojure.lang.RestFn.invoke (RestFn.java:410)
    clojure.lang.AFn.applyToHelper (AFn.java:154)
    clojure.lang.RestFn.applyTo (RestFn.java:132)
    clojure.lang.AFunction$1.doInvoke (AFunction.java:29)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invoke (core.clj:632)
    leiningen.core.main$apply_task.invoke (main.clj:311)
    leiningen.core.main$resolve_and_apply.invoke (main.clj:317)
    leiningen.core.main$_main$fn__6096.invoke (main.clj:390)
    leiningen.core.main$_main.doInvoke (main.clj:383)
    clojure.lang.RestFn.invoke (RestFn.java:408)
    clojure.lang.Var.invoke (Var.java:379)
    clojure.lang.AFn.applyToHelper (AFn.java:154)
    clojure.lang.Var.applyTo (Var.java:700)
    clojure.core$apply.invoke (core.clj:630)
    clojure.main$main_opt.invoke (main.clj:316)
    clojure.main$main.doInvoke (main.clj:421)
    clojure.lang.RestFn.invoke (RestFn.java:436)
    clojure.lang.Var.invoke (Var.java:388)
    clojure.lang.AFn.applyToHelper (AFn.java:160)
    clojure.lang.Var.applyTo (Var.java:700)
    clojure.main.main (main.java:37)
Caused by: clojure.lang.Compiler$CompilerException: java.lang.StackOverflowError, compiling:(leiningen/release.clj:106:8)
 at clojure.lang.Compiler.analyzeSeq (Compiler.java:6730)
    clojure.lang.Compiler.analyze (Compiler.java:6524)
    clojure.lang.Compiler.analyzeSeq (Compiler.java:6711)
    clojure.lang.Compiler.analyze (Compiler.java:6524)
    clojure.lang.Compiler.access$300 (Compiler.java:38)
    clojure.lang.Compiler$LetExpr$Parser.parse (Compiler.java:6129)
    clojure.lang.Compiler.analyzeSeq (Compiler.java:6723)
    clojure.lang.Compiler.analyze (Compiler.java:6524)
    clojure.lang.Compiler.analyzeSeq (Compiler.java:6711)
    clojure.lang.Compiler.analyze (Compiler.java:6524)
    clojure.lang.Compiler.analyze (Compiler.java:6485)
    clojure.lang.Compiler$IfExpr$Parser.parse (Compiler.java:2777)
    clojure.lang.Compiler.analyzeSeq (Compiler.java:6723)
    clojure.lang.Compiler.analyze (Compiler.java:6524)
    clojure.lang.Compiler.analyze (Compiler.java:6485)
    clojure.lang.Compiler$BodyExpr$Parser.parse (Compiler.java:5861)
    clojure.lang.Compiler$LetExpr$Parser.parse (Compiler.java:6179)
    clojure.lang.Compiler.analyzeSeq (Compiler.java:6723)
    clojure.lang.Compiler.analyze (Compiler.java:6524)
    clojure.lang.Compiler.analyzeSeq (Compiler.java:6711)
    clojure.lang.Compiler.analyze (Compiler.java:6524)
    clojure.lang.Compiler.analyzeSeq (Compiler.java:6711)
    clojure.lang.Compiler.analyze (Compiler.java:6524)
    clojure.lang.Compiler.analyze (Compiler.java:6485)
    clojure.lang.Compiler$BodyExpr$Parser.parse (Compiler.java:5861)
    clojure.lang.Compiler$TryExpr$Parser.parse (Compiler.java:2261)
    clojure.lang.Compiler.analyzeSeq (Compiler.java:6723)
    clojure.lang.Compiler.analyze (Compiler.java:6524)
    clojure.lang.Compiler.analyze (Compiler.java:6485)
    clojure.lang.Compiler$BodyExpr$Parser.parse (Compiler.java:5861)
    clojure.lang.Compiler$LetExpr$Parser.parse (Compiler.java:6179)
    clojure.lang.Compiler.analyzeSeq (Compiler.java:6723)
    clojure.lang.Compiler.analyze (Compiler.java:6524)
    clojure.lang.Compiler.analyzeSeq (Compiler.java:6711)
    clojure.lang.Compiler.analyze (Compiler.java:6524)
    clojure.lang.Compiler.analyzeSeq (Compiler.java:6711)
    clojure.lang.Compiler.analyze (Compiler.java:6524)
    clojure.lang.Compiler.analyze (Compiler.java:6485)
    clojure.lang.Compiler$BodyExpr$Parser.parse (Compiler.java:5861)
    clojure.lang.Compiler$FnMethod.parse (Compiler.java:5296)
    clojure.lang.Compiler$FnExpr.parse (Compiler.java:3925)
    clojure.lang.Compiler.analyzeSeq (Compiler.java:6721)
    clojure.lang.Compiler.analyze (Compiler.java:6524)
    clojure.lang.Compiler.analyzeSeq (Compiler.java:6711)
    clojure.lang.Compiler.analyze (Compiler.java:6524)
    clojure.lang.Compiler.access$300 (Compiler.java:38)
    clojure.lang.Compiler$DefExpr$Parser.parse (Compiler.java:577)
    clojure.lang.Compiler.analyzeSeq (Compiler.java:6723)
    clojure.lang.Compiler.analyze (Compiler.java:6524)
    clojure.lang.Compiler.analyze (Compiler.java:6485)
    clojure.lang.Compiler.eval (Compiler.java:6786)
    clojure.lang.Compiler.load (Compiler.java:7227)
    leiningen.release$eval33531.invoke (file:/C:/Users/Florian/code/GitHub/leiningen/src/leiningen/release.clj:115)
    clojure.lang.Compiler.eval (Compiler.java:6782)
    clojure.lang.Compiler.load (Compiler.java:7227)

last 3 lines repeated very often, then

Caused by: java.lang.StackOverflowError: null
 at java.lang.ClassLoader.findLoadedClass (:-1)
    clojure.lang.DynamicClassLoader.loadClass (DynamicClassLoader.java:73)
    java.lang.ClassLoader.loadClass (:-1)

as written above

m9aertner commented 9 years ago

Well, commit 927b9bf26c63be553a52f27281eb5185f382e78a in my fork seems to work for me. Windows 8, Java 8, CMD.EXE, building from scratch, and with a folder name that contains spaces.

On "master", I do get a similar "file not found" message complaining about ""C:\src\leiningen". That path is bad on two counts: there are two quotes at the beginning, and the spaces in the folder confuse things. The actual folder is C:\src\leiningen with some space.

Anyway, here's a log of what I think is a clean build, as per CONTRIBUTING.md, with that commit above:

C:\src\leiningen with some space>git checkout leiningen-1899
Switched to branch 'leiningen-1899'
Your branch is up-to-date with 'origin/leiningen-1899'.

C:\src\leiningen with some space>git reset --hard
HEAD is now at 927b9bf 2.5.2-SNAPSHOT doesn't build on Windows 7 with Java 8 #1899

C:\src\leiningen with some space>git clean -fdx

C:\src\leiningen with some space>ver

Microsoft Windows [Version 6.3.9600]

C:\src\leiningen with some space>cd leiningen-core

C:\src\leiningen with some space\leiningen-core>lein-stable bootstrap
Created C:\src\leiningen with some space\leiningen-core\target\leiningen-core-2.6.0-SNAPSHOT.jar
Wrote C:\src\leiningen with some space\leiningen-core\pom.xml
Installed jar and pom into local repo.
C:\src\leiningen with some space\leiningen-core>cd ..

C:\src\leiningen with some space>bin\lein.bat compile
Compiling leiningen.search
WARNING: update already refers to: #'clojure.core/update in namespace: clj-http.client, being replac
ed by: #'clj-http.client/update
C:\src\leiningen with some space>bin\lein.bat version
Leiningen 2.6.0-SNAPSHOT on Java 1.8.0_60 Java HotSpot(TM) 64-Bit Server VM
C:\src\leiningen with some space>bin\lein.bat uberjar
Compiling leiningen.search
WARNING: update already refers to: ...
Compiling leiningen.core.classpath
...
Compiling clj-http.client
WARNING: update already refers to: ...
...
Compiling clj-http.client
Created C:\src\leiningen with some space\target\leiningen-2.6.0-SNAPSHOT.jar
Created C:\src\leiningen with some space\target\leiningen-2.6.0-SNAPSHOT-standalone.jar
C:\src\leiningen with some space>
m9aertner commented 9 years ago

Running the tests with bin\lein test works in principle, too, but produces a number of failures, with most tests running OK.

  1. The space character in the folder name seems to be one problem. I then re-ran the tests from a clean build in C:\src\leiningen (cd \src & git clone https://github.com/m9aertner/leiningen.git -b leiningen-1899)
  2. The Windows File Separator (backslash) seems to confuse to some tests that appear to expect forward slashes (see below)
  3. I see one test expects \dev\null (with backslashes, even!) which is not present on Windows.
  4. One line says that a JDK is needed, not a JRE only (maybe add a note to the MD file?).
FAIL in (spliced-target-paths) (clean.clj:132)
expected: (= "/a/b/c/foo/bar/dev" (:target-path p))
  actual: (not (= "/a/b/c/foo/bar/dev" "\\a\\b\\c\\foo\\bar\\dev"))
...
Ran 193 tests containing 700 assertions.
7 failures, 3 errors.
winks commented 9 years ago

Fixed by @m9aertner in PR #2023