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

Already on GitHub? Sign in to your account

Exception on Windows for lein plugin install swank-clojure 1.4.0-SNAPSHOT #252

Closed
ath opened this Issue Aug 7, 2011 · 13 comments

Comments

9 participants
Contributor

ath commented Aug 7, 2011

“lein plugin install swank-clojure 1.4.0-SNAPSHOT” works and makes swank-clojure 1.4.0 available, but it throws this error message:

C:\Users\ath.emacs.d>lein plugin install swank-clojure 1.4.0-SNAPSHOT
Installing shell wrapper to C:\Users\ath.lein\bin\swank-clojure
Installing shell wrapper to C:\Users\ath.lein\bin\swank-clojure.bat
Copying 4 files to C:\Users\ath\AppData\Local\Temp\lein-f6ad7787-29e4-4ba0-b793-20dd4a418c02\lib\dev
Including swank-clojure-1.4.0-SNAPSHOT.jar
Exception in thread "main" java.io.IOException: Couldn't delete C:\Users\ath\AppData\Local\Temp\lein-f6ad7787-29e4-4ba0-b793-20dd4a418c02\lib\dev\clojure-1.2.1.
jar (NO_SOURCE_FILE:0)
at clojure.lang.Compiler.eval(Compiler.java:5440)
at clojure.lang.Compiler.eval(Compiler.java:5391)
at clojure.core$eval.invoke(core.clj:2382)
at clojure.main$eval_opt.invoke(main.clj:235)
at clojure.main$initialize.invoke(main.clj:254)
at clojure.main$script_opt.invoke(main.clj:270)
at clojure.main$main.doInvoke(main.clj:354)
at clojure.lang.RestFn.invoke(RestFn.java:551)
at clojure.lang.Var.invoke(Var.java:390)
at clojure.lang.AFn.applyToHelper(AFn.java:193)
at clojure.lang.Var.applyTo(Var.java:482)
at clojure.main.main(main.java:37)
Caused by: java.io.IOException: Couldn't delete C:\Users\ath\AppData\Local\Temp\lein-f6ad7787-29e4-4ba0-b793-20dd4a418c02\lib\dev\clojure-1.2.1.jar
at clojure.java.io$delete_file.doInvoke(io.clj:413)
at clojure.lang.RestFn.invoke(RestFn.java:423)
at leiningen.util.file$delete_file_recursively.doInvoke(file.clj:18)
at clojure.lang.RestFn.invoke(RestFn.java:423)
at leiningen.util.file$delete_file_recursively.doInvoke(file.clj:17)
at clojure.lang.RestFn.invoke(RestFn.java:423)
at leiningen.util.file$delete_file_recursively.doInvoke(file.clj:17)
at clojure.lang.RestFn.invoke(RestFn.java:423)
at leiningen.util.file$delete_file_recursively.doInvoke(file.clj:17)
at clojure.lang.RestFn.invoke(RestFn.java:410)
at leiningen.plugin$install.invoke(plugin.clj:49)
at leiningen.plugin$plugin.invoke(plugin.clj:75)
at clojure.lang.Var.invoke(Var.java:373)
at clojure.lang.AFn.applyToHelper(AFn.java:167)
at clojure.lang.Var.applyTo(Var.java:482)
at clojure.core$apply.invoke(core.clj:540)
at leiningen.core$apply_task.invoke(core.clj:229)
at leiningen.core$_main.doInvoke(core.clj:294)
at clojure.lang.RestFn.applyTo(RestFn.java:139)
at clojure.core$apply.invoke(core.clj:542)
at leiningen.core$_main.invoke(core.clj:297)
at user$eval42.invoke(NO_SOURCE_FILE:1)
at clojure.lang.Compiler.eval(Compiler.java:5424)
... 11 more

Collaborator

mtyaka commented Aug 25, 2011

I wasn't able to reproduce this on Windows Vista.

Contributor

ath commented Aug 29, 2011

I had this originally under Vista, but on Windows 7 it is working. I am closing this issue as I think this may have been some configuration issue (and conflicts with user permissions). If it arises again we can reopen or start a new issue.

@ath ath closed this Aug 29, 2011

CFPROD commented Oct 31, 2011

I confirmed this error on Windows 7 64 bit. Using PowerShell running as Administrator.

Using LEIN VERSION 2.0.0-SNAPSHOT

The file does exist in the Temp folder but will not delete.

Exception in thread "main" java.io.IOException: Couldn't delete C:\Users\kevin\AppData\Local\Temp\lein-a440dc6c-fe69-488
d-8605-7b3ff5b84e7b\lib\dev\clojure-1.2.1.jar (NO_SOURCE_FILE:0)
at clojure.lang.Compiler.eval(Compiler.java:5440)
at clojure.lang.Compiler.eval(Compiler.java:5391)
at clojure.core$eval.invoke(core.clj:2382)
at clojure.main$eval_opt.invoke(main.clj:235)
at clojure.main$initialize.invoke(main.clj:254)
at clojure.main$script_opt.invoke(main.clj:270)
at clojure.main$main.doInvoke(main.clj:354)
at clojure.lang.RestFn.invoke(RestFn.java:551)
at clojure.lang.Var.invoke(Var.java:390)
at clojure.lang.AFn.applyToHelper(AFn.java:193)
at clojure.lang.Var.applyTo(Var.java:482)
at clojure.main.main(main.java:37)
Caused by: java.io.IOException: Couldn't delete C:\Users\kevin\AppData\Local\Temp\lein-a440dc6c-fe69-488d-8605-7b3ff5b84
e7b\lib\dev\clojure-1.2.1.jar
at clojure.java.io$delete_file.doInvoke(io.clj:413)
at clojure.lang.RestFn.invoke(RestFn.java:423)
at leiningen.util.file$delete_file_recursively.doInvoke(file.clj:18)
at clojure.lang.RestFn.invoke(RestFn.java:423)
at leiningen.util.file$delete_file_recursively.doInvoke(file.clj:17)
at clojure.lang.RestFn.invoke(RestFn.java:423)
at leiningen.util.file$delete_file_recursively.doInvoke(file.clj:17)
at clojure.lang.RestFn.invoke(RestFn.java:423)
at leiningen.util.file$delete_file_recursively.doInvoke(file.clj:17)
at clojure.lang.RestFn.invoke(RestFn.java:410)
at leiningen.plugin$install.invoke(plugin.clj:49)
at leiningen.plugin$plugin.invoke(plugin.clj:75)
at clojure.lang.Var.invoke(Var.java:373)
at clojure.lang.AFn.applyToHelper(AFn.java:167)
at clojure.lang.Var.applyTo(Var.java:482)
at clojure.core$apply.invoke(core.clj:540)
at leiningen.core$apply_task.invoke(core.clj:229)
at leiningen.core$_main.doInvoke(core.clj:294)
at clojure.lang.RestFn.applyTo(RestFn.java:139)
at clojure.core$apply.invoke(core.clj:542)
at leiningen.core$_main.invoke(core.clj:297)
at user$eval288.invoke(NO_SOURCE_FILE:1)
at clojure.lang.Compiler.eval(Compiler.java:5424)
... 11 more

@mtyaka mtyaka reopened this Oct 31, 2011

Contributor

JulianBirch commented Nov 1, 2011

I'm seeing this too. Windows 7 here.

mtyaka added a commit that referenced this issue Nov 12, 2011

Call System/gc before deleting files recursively.
Calling System/gc can help release files on windows.
It will hopefuly help with issues such as #252 and #309.

I wasn't able to reproduce those two issues on Windows
Vista, but I have experienced a related problem when
running the leiningen test suite when some jar files
failed to be deleted. Calling System/gc resolved the
issue in that case.
Collaborator

mtyaka commented Nov 12, 2011

I couldn't reproduce the issue on Windows Vista, but I commited a change that I am hoping will fix the problem, so I am closing this issue. Please reopen if the problem persists.

@mtyaka mtyaka closed this Nov 12, 2011

I can reproduce this consistently on my machine. Windows 7 SP1 x64.
Problem appears when using 64-Bit Sun/Oracle Java.

But not, when switch to 32-Bit Sun/Oracle Java or 64-Bit JRockit.

This one has the same issue.

C:\clojure>lein.bat version
Leiningen 1.7.1 on Java 1.6.0_26 Java HotSpot(TM) 64-Bit Server VM

Others are not:

C:\clojure>lein.bat version
Leiningen 1.7.1 on Java 1.6.0_26 Oracle JRockit(R)
C:\clojure>lein.bat version
Leiningen 1.7.1 on Java 1.7.0_01 Java HotSpot(TM) Client VM

@mtyaka mtyaka reopened this Apr 19, 2012

In attempt to install noir on Windows 7 64-bit: lein plugin install lein-noir 1.2.1 I get the deletion error. Running Leiningen 1.7.1 on Java 1.7.0_03 Java HotSpot(TM) 64-Bit Server VM . I have also tried this with Leiningen 1.4.2 and 1.6.1 and neither worked.

Also seeing this on Windows 7 64bit, with lein plugin install swank-clojure 1.4.1. Using Leiningen 1.7.1 on Java 1.6.0_21 Java HotSpot(TM) 64-Bit Server VM

The cdt jar (and possibly others) are still in use by java.exe (the one lein uses) when lein utils tries to delete them. A quick fix would be to put a try/catch around the file deletion call, so we can at least install plugins on Windows.

Owner

technomancy commented May 15, 2012

Thanks for tracking this down; I've committed a fix on the 1.x branch.

Thanks, it works after I patched plugin.clj:

C:\projects\lib\clojure>lein plugin install swank-clojure 1.4.2
[INFO] Unable to find resource 'swank-clojure:swank-clojure:jar:1.4.2' in reposi
tory central (http://repo1.maven.org/maven2)
Installing shell wrapper to C:\projects\lib\clojure\leiningen\bin\swank-clojure
Installing shell wrapper to C:\projects\lib\clojure\leiningen\bin\swank-clojure.
bat
Copying 4 files to C:\Users\djue\AppData\Local\Temp\lein-ea5bacbf-f022-42fe-9b99
-9abaea2548af\lib
Including swank-clojure-1.4.2.jar
Including cdt-1.2.6.2.jar
Including clj-stacktrace-0.2.4.jar
Including clojure-1.2.1.jar
Including debug-repl-0.3.1.jar
Created swank-clojure-1.4.2.jar

C:\projects\lib\clojure>

Note: swank clojure 1.4.2 is required not 1.4.1, see http://www.raynes.me/logs/irc.freenode.net/leiningen/2012-03-25.txt

yedi commented Jun 24, 2012

how did you patch plugin.clj? (I'm having the same issue on 64bit windows 7 machine)

For me, I just opened plugin.clj in notepad++ and copy & pasted the
modified lines in the patch.

On Sun, Jun 24, 2012 at 12:20 AM, yedi <
reply@reply.github.com

wrote:

how did you patch plugin.clj? (I'm having the same issue on 64bit windows
7 machine)


Reply to this email directly or view it on GitHub:
#252 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment