emezeske / lein-cljsbuild

Leiningen plugin to make ClojureScript development easy.
Other
1.1k stars 151 forks source link

goog* files silently not emitted if main JS file exists #335

Open kylecordes opened 10 years ago

kylecordes commented 10 years ago

It appears that cljsbuild (or maybe cljs underneath it?) doesn't bother to emit the goog/* tree of files, if the main JS file does not need to be built. This causes considerable frustration as nothing complains about an error until the browser can't load any goog/* files. I've found it necessary to do this:

rm resources/public/*.js

as part of building, to ensure it actually works.

Help?

junjiemars commented 10 years ago

It's works, thanks.

kylecordes commented 10 years ago

(It would also be very nice to have this bug fixed.)

swannodette commented 9 years ago

Someone needs to do the work to determine that is a problem when using ClojureScript directly. If it is an issue, ticket & patch in JIRA welcome.

adamfaulkner commented 9 years ago

I was able to fix this by updating to clojurescript "0.0-2665".

cemerick commented 9 years ago

@kylecordes can you confirm that this problem doesn't exist when using CLJS 2665?

kylecordes commented 9 years ago

I will attempt to confirm this.

kylecordes commented 9 years ago

Unfortunately, I still see the same problem, with [org.clojure/clojurescript "0.0-2665"]. If the main output JS does not need to be built, the dependency files (goog*), are not generated if they are missing. I would guess this means that the compiler only looks at the main output file, not the whole tree of output files, to determine if it needs to build.

swannodette commented 9 years ago

@kylecordes did you try with ClojureScript master? I landed a related fix a little while back - this might actually be the same issue.

kylecordes commented 9 years ago

I did not try it with latest master yet; I have done that in the past and need to dig up how to do it.

swannodette commented 9 years ago

@kylecordes, checkout master, ./script/build, note version installed into local .m2, update your project.clj

kylecordes commented 9 years ago

CLJS Commit faf6d3849e74b7f2408916a918fcc8ed43f085ac, build 2692.

I get the same result as before. If the main output JavaScript file does not need rebuild, none of the contents of the :output-dir get any attention at all. I can delete that whole directory or any subset of its contents, and performing a rebuild of the ClojureScript does not replace any missing files.

This may not be worthy of attention or fix; fixing it would require that the compiler determine the whole set of output files and understand how depend on the ClojureScript input files. Certainly it would be most tidy and most on par with mature compilers for other languages if it understood the whole dependency relationship set, but it is possible that this is not worth the computational cost of a slower no-change "compile".

swannodette commented 9 years ago

@kylecordes oh sorry I misunderstood. Yeah that issue has nothing to do with ClojureScript, cljsbuild does it's own calculation of when a rebuild should occur.

kylecordes commented 9 years ago

Very good, in the sense it means there is not a problem with ClojureScript...