This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-11-22
Channels
- # beginners (122)
- # boot (217)
- # cider (14)
- # cljs-dev (74)
- # cljsrn (22)
- # clojure (101)
- # clojure-nl (4)
- # clojure-russia (22)
- # clojure-taiwan (5)
- # clojurescript (87)
- # cursive (4)
- # datavis (2)
- # editors (3)
- # hoplon (2)
- # jobs (2)
- # ldnclj (1)
- # lein-figwheel (1)
- # luminus (1)
- # off-topic (1)
- # om (105)
- # onyx (37)
- # reagent (2)
- # spacemacs (2)
hi! can I get some guidance on making an uberjar
with boot? I'm following saapas structure and doing (comp (cljs-build) (aot) (pom) (uber) (jar))
. The final jar has everything needed but in the wrong dir structure (i.e, no libs/
), when I do java -jar target/asterion-0.1.0-SNAPSHOT.jar
it can't find clojure in the classpath
@bensu: do you have clojure specified as a dependency?
@martinklepsch: yes, and I can see its jar inside my jar, but in top dir instead of under libs/
is libs/
a standard thing in uberjars? probably can’t help with anything more specific...
maybe it's not. it is in uberwars. but I do see clojure-1.7.0.jar
inside my jar yet when I run it, it can't find clojure.lang.IFn
: Exception in thread "main" java.lang.NoClassDefFoundError: clojure/lang/IFn
I was using web
to make the uberwar, but tomcat in elastic beanstalk wouldn't understand my config and return 404 for every request
is this how you pipe to serve
? (comp (cljs-build) (web) (uber) (war) (serve :port 8080))
right, the "tasks as functions" is very good abstraction but sometimes I find it hard to follow when it leaks. I'm guessing this is an instance of that.
see here https://github.com/tailrecursion/boot-jetty/blob/master/src/tailrecursion/boot_jetty.clj#L26
the expressions before the (with-pre-wrap ...)
can perform side effects and allocate resources
I'm trying to speed up my repl restart times. I've followed https://github.com/boot-clj/boot/wiki/Improving-startup-time which helps tremendously
Are there any other things that can help?
@micha: in my project, it takes 12s
with a bunch of dependencies
@micha: good call, but I've done that already --- removing CIDER cut the time in half
boot -BP repl < /dev/null
takes 10s
do you mean setting :server true
for the repl
task?
then once in there you can use the runboot stuff to start repl servers in a boot-in-boot
that's too crazy for me
other than setting better JVM settings, disabling CIDER was the biggest win so far
I looked into removing dependencies, but that didn't seem to have much of an effect
that's now confirmed: boot -BP
takes 10s, whereas boot dev-repl
takes 12s, so most of the seems to be spent inside general boot start-up
that'd be an interesting experiment, but an nREPL is important for my work flow
how long does time boot -BP repl < /dev/null
take for you?
it's not quite working since boot-jetty
pins a certain version of jetty
which seems to be incompatible to my ring dependency but the big parts are in place
barp $ time boot -BP repl < /dev/null 2>&1 > /dev/null
nREPL server started on port 51682 on host 127.0.0.1 -
real 0m4.246s
user 0m7.936s
sys 0m0.200s
that's certainly faster than here (OSX, boot 2.4.2)
I've got a macbook air 2012, maybe CPU is the bottleneck
2.5.0 has a lot of performance things involving caching, maybe there's something we can cache to make repl startup faster
which tool would you suggest for profiling?
boot -vv
doesn't print any more helpful information
boot --help
takes 4.2s, so that's probably the baseline
boot --help takes 2.29s with BOOT_JVM_OPTIONS set to the expected settings
s/expected/recommended/
the cache is pretty much empty, yeah
tree ~/.boot/cache/cache/boot/default/
/home/micha/.boot/cache/cache/boot/default/
├── 1.6.0
│ ├── 2.5.0
│ │ └── deps.cache
│ └── 2.5.0-SNAPSHOT
│ └── deps.cache
└── 1.7.0
├── 2.4.2
│ └── deps.cache
├── 2.5.0
│ └── deps.cache
└── 2.5.0-SNAPSHOT
└── deps.cache
7 directories, 5 files
no, I'm not setting any additional env vars
it's like ~/.boot/cache/cache/<local repo or default>/<clojure version>/<boot version>/deps.cache
well I always re-run the same command and only look at the second run, so it should be able to cache all it needs
yeah it only needs to cache it the first time you run that version of boot with that version of clojure
time env -i PATH=$PATH BOOT_JVM_OPTIONS="-client -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Xmx2g -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -Xverify:none" $(which boot) -BP repl < /dev/null
<- 5.98s totalbut like if somehow the jars in your maven repo are altered, boot will invalidate its cache
yeah, that's probably not the problem
well I'm happy for now, I've understood things a bit better
and see if there's some shoelace untied that we can just make into a bow and get fast perf
time java -cp lib/clojure-1.6.0.jar clojure.main < /dev/null
takes 1.5s, so we won't be able to do better than that
I do use nREPL because I connect from emacs
but there are circumstances where a bare-bones (rlwrap/jline) repl is useful as well
a bare-repl
tasks would a useful addition to boot
i think there is some room for optimizing how the repl server and client are synchronized when they start in the repl task
yes, just from looking at the stdout it seems like there's some unnecessary waiting involved
yes I'm using it
well I don't really know anything about it
quick question, if I am composing tasks and each steps generate files the fileset gets bigger on each step. Is there a way to filter the files that will make it to the final task?
so if you build from master you can speed up that process, and all the other uberjar stuff too, by orders of magnitude
when I initially read sift
I thought it was for moving things, I see now that it does much more
@micha: I've asked once about boot classpath and you replied that I have to specify it through the JVM option since boot can't really do that. But how would I know what path to give if it's boot that resolves dependencies? Woudl I have to hard-code a path in my script, or?
But if you said I can't do what lein does with it's boot classpath plugin due to how boot works (single JVM)
So I'm wondering if there's at least a way to query boot for path to a certain jar, so I don't have to do it by myself
Basically what I want is to reproduce this with boot, since it's my main build tool - https://github.com/jcrossley3/immutant-repro/blob/master/project.clj
Sure, I guess I can split that by colons and grep the one I need, sounds reasonable for nwo