martinklepsch / boot-garden

Boot task to compile Garden stylesheets.
Eclipse Public License 1.0
37 stars 6 forks source link

Warn user if he tries to overwrite css file #13

Open malchmih opened 9 years ago

malchmih commented 9 years ago

If you set :output-to to the file, that's already there (in your resources, for example), (garden) task fails with the exception like this:

Exception in thread "Thread-7" java.io.IOException: Stream closed, compiling:(garden/compiler.cljc:752:1)
    at clojure.lang.Compiler.load(Compiler.java:7234)
    at clojure.lang.RT.loadResourceScript(RT.java:371)
    at clojure.lang.RT.loadResourceScript(RT.java:362)
    at clojure.lang.RT.load(RT.java:446)
    at clojure.lang.RT.load(RT.java:412)
    at clojure.core$load$fn__5448.invoke(core.clj:5866)
    at clojure.core$load.doInvoke(core.clj:5865)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invoke(core.clj:5671)
    at clojure.core$load_lib$fn__5397.invoke(core.clj:5711)
    at clojure.core$load_lib.doInvoke(core.clj:5710)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invoke(core.clj:632)
    at clojure.core$load_libs.doInvoke(core.clj:5749)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invoke(core.clj:632)
    at clojure.core$require.doInvoke(core.clj:5832)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at garden.core$eval236$loading__5340__auto____237.invoke(core.cljc:1)
    at garden.core$eval236.invoke(core.cljc:1)
    at clojure.lang.Compiler.eval(Compiler.java:6782)
    at clojure.lang.Compiler.eval(Compiler.java:6771)
    at clojure.lang.Compiler.load(Compiler.java:7227)
    at clojure.lang.RT.loadResourceScript(RT.java:371)
    at clojure.lang.RT.loadResourceScript(RT.java:362)
    at clojure.lang.RT.load(RT.java:446)
    at clojure.lang.RT.load(RT.java:412)
    at clojure.core$load$fn__5448.invoke(core.clj:5866)
    at clojure.core$load.doInvoke(core.clj:5865)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invoke(core.clj:5671)
    at clojure.core$load_lib$fn__5397.invoke(core.clj:5711)
    at clojure.core$load_lib.doInvoke(core.clj:5710)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invoke(core.clj:632)
    at clojure.core$load_libs.doInvoke(core.clj:5749)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invoke(core.clj:632)
    at clojure.core$require.doInvoke(core.clj:5832)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.lang.Var.invoke(Var.java:379)
    at org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.require(ClojureRuntimeShimImpl.java:57)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:93)
    at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:28)
    at boot.pod$require_in.invoke(pod.clj:229)
    at org.martinklepsch.boot_garden$eval2013$fn__2014.invoke(boot_garden.clj:20)
    at boot.pod$pod_pool$fn__1169.invoke(pod.clj:507)
    at boot.pod$lifecycle_pool$fill__1130.invoke(pod.clj:415)
    at clojure.lang.AFn.run(AFn.java:22)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: Stream closed
    at java.util.zip.InflaterInputStream.ensureOpen(InflaterInputStream.java:67)
    at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:142)
    at java.io.FilterInputStream.read(FilterInputStream.java:133)
    at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
    at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
    at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
    at java.io.InputStreamReader.read(InputStreamReader.java:184)
    at java.io.BufferedReader.fill(BufferedReader.java:161)
    at java.io.BufferedReader.read(BufferedReader.java:182)
    at java.io.LineNumberReader.read(LineNumberReader.java:126)
    at java.io.FilterReader.read(FilterReader.java:65)
    at java.io.PushbackReader.read(PushbackReader.java:90)
    at clojure.lang.LineNumberingPushbackReader.read(LineNumberingPushbackReader.java:51)
    at clojure.lang.LispReader.read1(LispReader.java:150)
    at clojure.lang.LispReader.read(LispReader.java:238)
    at clojure.lang.LispReader.read(LispReader.java:196)
    at clojure.lang.Compiler.load(Compiler.java:7222)
    ... 53 more

It'd be better to catch that case and fail with more user-friendly warning.

malchmih commented 9 years ago

Actually, the problem is more serious. I've reproduced it here: https://github.com/malchmih/boot-garden-test. Run boot dev (probably several times) and you will see the same exception. But there are no resources in the project.

martinklepsch commented 9 years ago

Do you mean multiple times as in "at once"? There have been reports of a similar issue before: https://github.com/martinklepsch/boot-garden/issues/7.

@jeluard du you still experience this every now and then?

malchmih commented 9 years ago

No, I mean successively

malchmih commented 9 years ago

Does it work for you?

jeluard commented 9 years ago

Yes I can still see it sporadically. Also it looks like it depends on other dependencies as when upgrading some of them I can se the exception more or less often. I only ever saw this issue with boot-garden so I suspect it's related to garden itself.