leiningen

N.B. The maintainers are on #leiningen on Libera chat IRC. Go there for direct support/bug reports.
devurandom 2019-03-06T13:58:44.034300Z

Hi! Building an uberjar, the compilation runs since about fifteen minutes already, last message was "Compiling XXX.util.spec.clj" and nothing happens thereafter, while the java process is running at 100% of one core. Is there a bug known in this context? Could it be a problem with my project.clj?

devurandom 2019-03-06T15:07:33.035Z

Result: Uberjar aborting because jar failed: No space left on device

devurandom 2019-03-06T15:09:00.035400Z

Ideas?

2019-03-06T15:09:09.035600Z

maybe check that you have enough disk space?

devurandom 2019-03-06T15:09:22.035800Z

Before starting lein uberjar I have 110GB free.

devurandom 2019-03-06T15:10:40.036300Z

And what is growing to that size is actually the uberjar.

2019-03-06T15:12:32.036900Z

not sure then. I might try removing sections of your program to try to pinpoint the issue

devurandom 2019-03-06T15:19:11.037200Z

It appears the uberjar contains itself...

devurandom 2019-03-06T15:19:44.037900Z

I just checked with zip -FF SNAPSHOT.jar.zip --out SNAPSHOT.jar.fixed.zip.

2019-03-06T15:22:14.038600Z

@devurandom yeah, sounds like some sort of circular reference

2019-03-06T15:23:00.039700Z

maybe lein deps :tree can help find the issue, not sure

2019-03-06T15:23:14.040Z

may have to do lein with-profile +uberjar deps :tree too

devurandom 2019-03-06T15:31:15.041200Z

I assume this is because :resource-paths contains target, because I build ClojureScript and CSS files into that location. I will try to build the cljs/js and css files into a different location...

devurandom 2019-03-06T15:32:18.041700Z

(And the uberjar is being build into target)

devurandom 2019-03-06T15:32:31.042Z

Yep, that seems to have fixed it.

devurandom 2019-03-06T15:35:00.043500Z

I guess I am not the first one to encounter this. How do people generally handle that? If they need the js files compiled by figwheel and some css files inside their resource dir in the Java process for fighweel's internal web server?

devurandom 2019-03-07T08:44:23.047900Z

Thanks!

devurandom 2019-03-06T15:39:44.043800Z

Found it: https://github.com/bhauman/figwheel-main/issues/134

victorb 2019-03-06T15:47:56.044Z

I usually have all frontend/ui things inside src/frontend or src/ui, when compiling the output ends up in resources/public/js, so not hitting this issue

victorb 2019-03-06T15:48:18.044200Z

resources/ only has index.html which runs the compiled JS

2019-03-06T16:10:20.044800Z

@devurandom yeah, I never put the js in target, resources/public/js/compiled or something like that

devurandom 2019-03-06T16:11:05.045500Z

There is also https://github.com/bhauman/figwheel-main/pull/138 with some discussion.

2019-03-06T16:11:08.045600Z

Then you also have to add those as clean targets to your lein project

:clean-targets ^{:protect false} [:compile-path :target-path
                                  "resources/public/js/compiled"]
something like that

2019-03-06T16:11:18.046Z

that way lein clean will remove the compiled js stuff - which you’d typically want to work

devurandom 2019-03-06T16:12:25.046400Z

@mikerod Thanks!

1👍
2019-03-06T19:36:22.047800Z

hi - does anyone know how to specify an entrypoint to lein test e.g. if I want to call mount/start before running any tests, it would be convenient to run (mount/start) and some other setup that is cross-project before testing starts. Currently I've resorted to simply calling (mount/start) in a namespace that lives in the test/ directory which does the trick but this feels suboptimal and probably will interfere with other developers' workflows