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

Windows - 'boot pom jar' fails due to "file already exists" exception #138

Closed
lypanov opened this issue Feb 23, 2015 · 12 comments
Closed

Windows - 'boot pom jar' fails due to "file already exists" exception #138

lypanov opened this issue Feb 23, 2015 · 12 comments

Comments

@lypanov
Copy link

lypanov commented Feb 23, 2015

A command as simple as "boot pom jar install" results in a large stack trace using master boot. A simple work around is to set hard-link to false while doing such installs and then back again when actually wanting to use the tool (hard-link false increases my CLJS projects rebuild speed 2x).

PS C:\Users\Alexander\Documents\GitHub\boot-cljs> boot pom jar install
Writing pom.xml and pom.properties...
Writing boot-cljs-0.0-2814-2.jar...
              clojure.lang.ExceptionInfo: java.nio.file.FileAlreadyExistsException: C:\Users\Alexander\.boot\tmp\Users\Alexander\Documents\GitHub\boot-cljs\51g\11lgcg\META-INF\maven\adzerk\boot-cljs\pom.properties -> C:\Users\Alexander\.boot\tmp\Users\Alexander\Documents\GitHub\boot-cljs\51g\-7kd6cy\915d5b40f8ba7f9f634a3365d431220e
    data: {:file
           "C:\\Users\\ALEXAN~1\\AppData\\Local\\Temp\\boot.user7280911265116778245.clj",
           :line 15}
 java.util.concurrent.ExecutionException: java.nio.file.FileAlreadyExistsException: C:\Users\Alexander\.boot\tmp\Users\Alexander\Documents\GitHub\boot-cljs\51g\11lgcg\META-INF\maven\adzerk\boot-cljs\pom.properties -> C:\Users\Alexander\.boot\tmp\Users\Alexander\Documents\GitHub\boot-cljs\51g\-7kd6cy\915d5b40f8ba7f9f634a3365d431220e
java.nio.file.FileAlreadyExistsException: C:\Users\Alexander\.boot\tmp\Users\Alexander\Documents\GitHub\boot-cljs\51g\11lgcg\META-INF\maven\adzerk\boot-cljs\pom.properties -> C:\Users\Alexander\.boot\tmp\Users\Alexander\Documents\GitHub\boot-cljs\51g\-7kd6cy\915d5b40f8ba7f9f634a3365d431220e
         file: "C:\\Users\\Alexander\\.boot\\tmp\\Users\\Alexander\\Documents\\GitHub\\boot-cljs\\51g\\11lgcg\\META-INF\\maven\\adzerk\\boot-cljs\\pom.properties"
    otherFile: "C:\\Users\\Alexander\\.boot\\tmp\\Users\\Alexander\\Documents\\GitHub\\boot-cljs\\51g\\-7kd6cy\\915d5b40f8ba7f9f634a3365d431220e"
sun.nio.fs.WindowsException.translateToIOException
sun.nio.fs.WindowsException.rethrowAsIOException
sun.nio.fs.WindowsFileSystemProvider.createLink
...
boot.file/hard-link                          file.clj:  105
@lypanov lypanov changed the title Basic functionality broken undrer Windows Windows - 'boot pom jar' fails due to "file already exists" exception Feb 23, 2015
@schmir
Copy link
Contributor

schmir commented Feb 23, 2015

also see #117. I guess boot is again trying to remove a file like in #117 and fails silently. You get that error afterwards...

@schmir
Copy link
Contributor

schmir commented Feb 23, 2015

Can you provide a minimal example that fails?

@lypanov
Copy link
Author

lypanov commented Feb 23, 2015

I could work to make one but it'll take a while alas as I'm on some tight schedules. If you're just after a reproduction then running "boot pom jar" in boot-cljs crashes every time for me. Not intermittent!

@schmir
Copy link
Contributor

schmir commented Feb 23, 2015

looks like I can reproduce the error with boot-cljs.

schmir added a commit that referenced this issue Feb 23, 2015
@schmir
Copy link
Contributor

schmir commented Feb 23, 2015

The above commit seems to fix the issue with boot-cljs for me. Please try it. (run lein install in boot/pod to install the changed version).

@lypanov
Copy link
Author

lypanov commented Feb 23, 2015

Yup! For me also. Awesome! Saves me all that manual hard-link binding hacking whenever I want to install. Thank you!

@lypanov
Copy link
Author

lypanov commented Feb 23, 2015

BTW off topic but in case you're playing with it boot-cljs itself doesn't work on Windows without a patch I have in my fork. Without the patch it generates nonsense characters in it's output main file. I'll try and get a PR in soon as I'm guessing you're not actively using ClojureScript.

@schmir
Copy link
Contributor

schmir commented Feb 23, 2015

No, I'm not using it at the moment. But keep the PRs coming :)

schmir added a commit that referenced this issue Feb 23, 2015
I could fix the issue by forcing an out of memory error since that also
forces garbage collection. But I'm not ready for that yet...

see #117 and #138
@lypanov
Copy link
Author

lypanov commented Feb 24, 2015

I found a new case which can easily be seen with boot-cljs usage itself. Create a compilation error in a CLJS file, save for the watcher to read and after it's spit out the error, fix and save again - this reproducibly gives me the following stack trace:

                                                  ...
                               boot.file/hard-link                          file.clj:  105
                       boot.file/copy-with-lastmod                          file.clj:  118
                    boot.tmpdir.TmpFileSet/commit!                        tmpdir.clj:   69
                                 boot.core/commit!                          core.clj:  360
              boot.task.built-in/fn/fn/fn/fn/fn/fn                      built_in.clj:  167
                 boot.task.built-in/fn/fn/fn/fn/fn                      built_in.clj:  167
                    boot.task.built-in/fn/fn/fn/fn                      built_in.clj:  164
                               boot.core/run-tasks                          core.clj:  668
                                               ...
                              boot.user/eval348/fn  boot.user1946278612174514088.clj:   13
               clojure.core/binding-conveyor-fn/fn                          core.clj: 1910

Maybe editing Clojure source files shows the same issue?

@schmir
Copy link
Contributor

schmir commented Feb 24, 2015

here's the traceback for a single leaked file. this seems to be clojurescript specific:

#264 C:\Users\ralf\.boot\tmp\Users\ralf\home\boot-cljs-example\2ac\-p9hf6h\app.cljs by thread:clojure-agent-send-off-pool-0 on Tue Feb 24 21:29:46 CET 2015
    at java.io.FileInputStream.(Unknown Source)
    at clojure.java.io$fn__8702.invoke(io.clj:229)
    at clojure.java.io$fn__8615$G__8606__8622.invoke(io.clj:69)
    at clojure.java.io$fn__8676.invoke(io.clj:165)
    at clojure.java.io$fn__8628$G__8610__8635.invoke(io.clj:69)
    at clojure.java.io$reader.doInvoke(io.clj:102)
    at clojure.lang.RestFn.invoke(RestFn.java:410)
    at cljs.analyzer$forms_seq.invoke(analyzer.clj:1608)
    at cljs.analyzer$forms_seq.invoke(analyzer.clj:1606)
    at cljs.compiler$compile_file_STAR_$fn__2646.invoke(compiler.clj:892)
    at cljs.compiler$with_core_cljs.invoke(compiler.clj:870)
    at cljs.compiler$compile_file_STAR_.invoke(compiler.clj:879)
    at cljs.compiler$compile_file.invoke(compiler.clj:971)
    at cljs.compiler$compile_root.invoke(compiler.clj:1007)
    at cljs.closure$compile_dir.invoke(closure.clj:353)
    at cljs.closure$eval2994$fn__2995.invoke(closure.clj:393)
    at cljs.closure$eval2929$fn__2930$G__2920__2937.invoke(closure.clj:303)
    at cljs.closure$eval2981$fn__2982.invoke(closure.clj:407)
    at cljs.closure$eval2929$fn__2930$G__2920__2937.invoke(closure.clj:303)
    at adzerk.boot_cljs.impl.CljsSourcePaths$fn__3187.invoke(impl.clj:16)
    at clojure.core$map$fn__4245.invoke(core.clj:2559)
    at clojure.lang.LazySeq.sval(LazySeq.java:40)
    at clojure.lang.LazySeq.seq(LazySeq.java:49)
    at clojure.lang.Cons.next(Cons.java:39)
    at clojure.lang.RT.boundedLength(RT.java:1654)
    at clojure.lang.RestFn.applyTo(RestFn.java:130)
    at clojure.core$apply.invoke(core.clj:624)
    at clojure.core$mapcat.doInvoke(core.clj:2586)
    at clojure.lang.RestFn.invoke(RestFn.java:423)
    at adzerk.boot_cljs.impl.CljsSourcePaths._compile(impl.clj:16)
    at cljs.closure$build.invoke(closure.clj:977)
    at cljs.closure$build.invoke(closure.clj:942)
    at adzerk.boot_cljs.impl$compile_cljs$fn__3206.invoke(impl.clj:33)
    at adzerk.boot_cljs.impl$compile_cljs.invoke(impl.clj:31)
    at clojure.lang.Var.invoke(Var.java:383)
    at clojure.lang.AFn.applyToHelper(AFn.java:156)
    at clojure.lang.Var.applyTo(Var.java:700)
    at clojure.core$apply.invoke(core.clj:624)
    at boot.pod$eval_fn_call.invoke(pod.clj:177)
    at boot.pod$call_in_STAR_.invoke(pod.clj:184)
    at clojure.lang.Var.invoke(Var.java:379)
    at org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.invoke(ClojureRuntimeShimImpl.java:88)
    at org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.invoke(ClojureRuntimeShimImpl.java:81)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:93)
    at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:28)
    at boot.pod$call_in_STAR_.invoke(pod.clj:187)
    at adzerk.boot_cljs$eval92$fn__93$fn__96$fn__97.invoke(boot_cljs.clj:123)
    at adzerk.boot_cljs_repl$eval176$fn__177$fn__182$fn__183.invoke(boot_cljs_repl.clj:107)
    at boot.task.built_in$fn__1176$fn__1177$fn__1190$fn__1191.invoke(built_in.clj:218)
    at boot.task.built_in$fn__1176$fn__1177$fn__1184$fn__1185.invoke(built_in.clj:215)
    at adzerk.boot_reload$eval224$fn__225$fn__234$fn__235.invoke(boot_reload.clj:61)
    at adzerk.boot_reload$eval224$fn__225$fn__229$fn__230.invoke(boot_reload.clj:59)
    at boot.task.built_in$fn__1003$fn__1004$fn__1026$fn__1027.invoke(built_in.clj:91)
    at boot.task.built_in$fn__1125$fn__1126$fn__1129$fn__1130$fn__1148$fn__1149.invoke(built_in.clj:167)
    at boot.task.built_in$fn__1125$fn__1126$fn__1129$fn__1130$fn__1148.invoke(built_in.clj:167)
    at boot.task.built_in$fn__1125$fn__1126$fn__1129$fn__1130.invoke(built_in.clj:164)
    at pandeiro.http$eval266$fn__267$fn__272$fn__273.invoke(http.clj:30)
    at boot.core$run_tasks.invoke(core.clj:668)
    at clojure.lang.Var.invoke(Var.java:379)
    at boot.user$eval293$fn__294.invoke(boot.user6849954566524128194.clj:19)
    at clojure.core$binding_conveyor_fn$fn__4145.invoke(core.clj:1910)
    at clojure.lang.AFn.call(AFn.java:18)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

@micha micha added the blocked label Apr 5, 2015
@schmir
Copy link
Contributor

schmir commented Aug 10, 2015

@martinklepsch
Copy link
Member

I'll close this as the original issue has been resolved and also the referenced CLJS ticket has been closed. As always, feel free to reopen.

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

No branches or pull requests

4 participants