This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-01-20
Channels
- # aatree (42)
- # admin-announcements (25)
- # alda (28)
- # aws (56)
- # beginners (67)
- # boot (248)
- # braid-chat (9)
- # cider (52)
- # cljsrn (11)
- # clojars (4)
- # clojure (341)
- # clojure-czech (5)
- # clojure-japan (3)
- # clojure-nl (2)
- # clojure-russia (57)
- # clojured (10)
- # clojurescript (35)
- # community-development (18)
- # cursive (17)
- # datascript (5)
- # datomic (39)
- # dirac (25)
- # editors (2)
- # events (3)
- # hoplon (60)
- # jobs (5)
- # ldnclj (9)
- # leiningen (5)
- # mount (20)
- # off-topic (3)
- # om (263)
- # onyx (69)
- # perun (5)
- # proton (55)
- # re-frame (7)
- # reagent (24)
- # spacemacs (6)
- # yada (16)
@jethroksy: it only manip[ulates the fileset
So what it does now is to change the file write directory and name for a specific file?
Is there a better way to re-test on changes than (deftask autotest (comp (watch) (test))
? I keep getting OutOfMemoryError
s.
Errors like this, more specifically: https://gist.github.com/Jannis/5d4810f6ec10273ac533
Hey all, I’m trying to deploy my boot managed app to heroku, but I should’ve figured it’s not a drop in replacement for lein here. I thought just having the uberjar and Procfile would be enough, but heroku rejects it:
remote: ! Push rejected, no Cedar-supported app detected
remote: HINT: This occurs when Heroku cannot detect the buildpack
remote: to use for this application automatically.
remote: See
Anyone have experience with this?sooheon: are you using a custom buildpack? maybe this one: https://github.com/upworthy/heroku-buildpack-boot
codefinger: ah I was just getting to the docs about buildpacks on heroku’s site. So the default buildpack expects lein I guess
you'll need to run heroku buildpacks:set
You'll need a Procfile
still, probably to run your uberjar. But then the boot build process is defined by that buildpack.
hm so if i have a (deftask package [] …) that created my jar for me, how should this buildpack know about it?
what command would you run locally to build the uberjar?
this one
(deftask package
"Build the package"
[]
(comp
(less :compression true)
(cljs :optimizations :advanced)
(aot)
(pom)
(uber)
(jar)))
i mean what would you run at the command line?
so probably heroku config:set BOOTBUILD_CMD="boot package"
or maybe rename your package
task to build
(which is the default for the buildpack)
ah perfect I supply it to BOOTBUILD_CMD. I guess it defaulted to build yeah saw that in the logs
@codefinger: Does it split up building and running to avoid hitting Heroku's up-and-running timeout?
@jannis: not sure I follow. you mean splitting build (create the uberjar) and running (running the uberjar)?
oh, would you expect it to build the uberjar everytime you run the app?
Heroku is a container-based system (like Docker but it uses LXC), so the build process creates an image, which is used to run your app. That's why it can launch new instances so quickly
I tried one of the older buildpacks for boot with Heroku and it didn't work because it would just run boot run-production
(or whatever command you defined) and that might take forever pulling in dependencies. Heroku has a timeout set for when the app needs to serve via the specified port and it always hit that.
so the build process creates the uberjar (and the image) and then every time you run the app, or launch a new instance (scale horizontally) it runs from that immutable image
oh yea, that's a bad idea
i think the lein buildpack used to do that a long time ago (and probably still can)
but now it's uberjars all the way down
Yeah, makes sense. I assume the build command is triggered on every push but not if you restart the app?
i'm of the opinion that you use build tools to build and app -- not run it. So lein run
, mvn jetty:exec
, boot run-production
or whatever is a bad idea IMO
s/and/an/
except in dev of course
@jannis: yes that's correct
so the image is immutable. That's why you can run heroku run rm -rf *
and not break anything
Good. I would've needed this a few months ago but I'm glad something that works is out there now
Among many things, it reduces the requirements for the host system to "is a JVM available?"
yea, it's really unique and amazing to have your only external dependency by the JVM.
s/by/be
Slack really needs support for editing the previous mesage wth s/.../...
(it actually works in Skype) 😉
especially given how i make mistakes
@sooheon: what does heroku logs
show?
@codefinger: this seems to be the relevant part
2016-01-20T01:03:50.277008+00:00 app[web.1]: Starting tomaton...
2016-01-20T01:04:16.856901+00:00 app[web.1]: System started
2016-01-20T01:04:16.835470+00:00 app[web.1]: Starting web server on
2016-01-20T01:04:35.814912+00:00 heroku[router]: at=error code=H20 desc="App boot timeout" method=GET path="/" host= request_id=3c04485a-939c-4a74-b293-64ea546c3f95 fwd="110.76.142.159" dyno= connect= service= status=503 bytes=
2016-01-20T01:04:46.633792+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2016-01-20T01:04:46.633792+00:00 heroku[web.1]: Stopping process with SIGKILL
2016-01-20T01:04:47.493600+00:00 heroku[web.1]: State changed from starting to crashed
2016-01-20T01:04:47.435510+00:00 heroku[web.1]: Process exited with status 137
2016-01-20T01:04:50.736134+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host= request_id=d728b842-6f1a-4749-932a-044a90b112e8 fwd="175.116.54.44" dyno= connect= service= status=503 bytes=
ah need to bind to 0.0.0.0 instead of localhost
yea, but in this case, it's just because it didn't bind to 0.0.0.0:$PORT at all
@codefinger: looking more carefully, the message was inaccurate. It does start the server on 0.0.0.0, it just displays localhost for convenience. Is it the port number thats the problem?
@sooheon: are you setting $PORT as the port?
or (env :port)
ah looks like that’s the problem. I can’t explicitly set that, because heroku will do it for me.
Heroku sets the $PORT var. it will be different every time your app runs
or (System/getenv "PORT")
g2g. i'll be around tomorrow if you want to ping me with questions
@jannis: regarding your out of memory error: check the wiki on increasing permgen space (JVM opts page I believe) and make sure you're using boot 2.4.2 or later. My guess is the problem will be gone after those changes.
Instead of increasing permgen space you could also upgrade to Java 8 if that's a possibility
Hi to all I've already got help about boot-cljs in #C03S1L9DN room. And now have new problem... My head is blowing up right now after trying to solve problem myself. By the way, I just started to learn clojure (particularly clojurescript). So I have website project mixed golang and cljs. In this project I have cljs source dir and public dir, where stored images, stylesheets, uploaded stuff and so on. Public directory is serving by web server. My goal is to build cljs sources into public/build directory. So in build.boot file I have (set-env! :source-paths #{"assets/cljs"} ...) and (target :dir #{"public/build"}). In assets/cljs I have file main.cljs.edn where I pass :asset-path option to cljs compiler. asset-path is "/build/main.out". And in my html page i have <script type="text/javascript" src="/build/main.js"></script>. And this configuration works. But boot-reload tries to reload files not from /build/main.out. It searches files in /main.out. If I change target dir from "public/build" to "public" and move main.cljs.edn from "assets/cljs" to "assets/cljs/build", then boot-reload works as expected. But content of my public directory erases every time cljs sources are compiled. And this behavior is unexpected by me. Have I any options to solve problem with build-reload paths, or with erasing contents of target directory? Or there is other way to make things right?
@nayzak: I’ve also had this issue. so what I do is have a static
directory that is added as an asset-path
(it’s the stuff that you have in public, I imagine) and boot copies the stuff over into the target directly. check this out https://github.com/jaredly/reepl/blob/master/build.boot
@jaredly I had an idea to ask boot to copy files in public dir, but didn't know how to do it And what about saving content, that users uploaded, between builds?
Hmm I would say have the target path be different from the serve
path — e.g.` (serve “public”)` but (target :dir #{“public/build”})
then you can put user stuff in public/uploads
or something —— but you were having reloading problems with that setup?
Hmm... asset-paths option helped me Problem with uploads could be resolved on deployment level with symlinks for example.
Question for @micha or @alandipert I think: it looks like you can specify "RELEASE"
instead of a specific version to cause Boot to pick up the latest full release (or rather Aether). However, I just published a non-SNAPSHOT release of a project to http://clojars.org and "RELEASE"
didn't work -- I had to specify an explicit release. Any insight into that?
What's odd is that if I run boot -d seancorfield/boot-new new ...
it picks up the very latest release from Clojars. I thought specifying "RELEASE"
in dependencies was the same thing...?
Anyways seancorfield/boot-new 0.2.1
is available with Boot template support, and built-in Boot templates for app
, default
(library), task
, and template
.
Probably about time to start publicizing it
OK, this is weird... sometimes I can just run boot -d seancorfield/boot-new new -t foo -n bar
but sometimes I need to specify the version (`seancorfield/boot-new:0.2.1`) depending on the template so I suspect it's something in my code 😞
Hmm, I think it's just a caching issue...
OK, wow, this is weird. The exact same Boot command sometimes succeeds and sometimes fails when it is run repeatedly in the same command window. OK, if I can figure out a pattern, I'll open a ticket. Maybe this is just a Windows thing?
@pesterhazy, @martinklepsch Thanks for your hints. I know I can suppress the warning, but I would rather Do The Right Thing. I thought, adding (target)
to my deftask would suffice, but it looks like it doesn't. Note, that I also added :dir
config to the call to target
as well as to task-options!
.
@ska, it is The Right Thing
So I have to do a second step in order to avoid a deprecation warning. Ho humm. I expect that the default will be changed in one of upcoming versions then?
@ska: exactly
Also @jaredly just opened this one https://github.com/boot-clj/boot/issues/391 - I guess silencing the warning when using target would make sense
yeah I was confused by the warning message as well initially
@martinklepsch: yep. in my tutorial I explained about the target warning and how to silence it, but I agree that the notification is not so clear to be immediately understood, because the only way you have to silence the warning it’s by adding the BOOT_EMIT_TARGET=no
to boot.properties
file in the project home directory or in the ~/.boot/boot.properties
file. That said I really like the fact that by not using the new target task, I can still do a lot of thing in a much more efficient way: in the tutorial-20 I explained how to build, install and publish an artifact without using the target task. Probably there should be a guide about use cases that really need the target task and uses cases that do not need it.
Probably something the tasks docstring could elaborate on
@martinklepsch: Thanks, I'll try increasing permgen space, although my system is already on struggling with 3-4 JVMs + 70 chrome tabs, memory-wise... 😉
@codefinger: @sooheon: Following up on our short discussion last night. The feature is there, you have to type /s/foo/bar, not s/foo/bar though
really?
@jannis: what boot/java versions were you running?
@martinklepsch: In this case: boot 2.4.2 (should switch to 2.5.x) and java-1.7.0-openjdk-1.7.0.65
Trying boot 2.5.5 and the permgen options from https://github.com/boot-clj/boot/wiki/JVM-Options now
There was an issue with pod pools fixed in 2.4.0 so 2.4.2 should be good https://github.com/boot-clj/boot/blob/master/CHANGES.md#240
with java 8 the permgen stuff has been renamed & changed significantly. most importantly there's no hard capping anymore
Looks like I'll have to try Java 8. Even with the PermGen options, I'm running out of memory.
@jannis: what have you set it to?
in the worst case one of the tasks you're using has some sort of class leak in which case you could use a profiling tool to figure it out yourself or provide a minimal case and someone else can take a look at it
@jannis: usually after those runs stuff should get garbage collected
There's not much going on apart from a Datomic database being created and deleted for every test (there are 6 tests).
each test run uses a new pod which adds to permgen. As said before an earlier problem with that has been fixed so not sure what is going on in your case
If you have JVisualVM installed you could check if the process actually reaches your permgen limit or faults because there is no more memory available on your machine
At 8GB of RAM and 8GB of swap that seems unlikely. There are 1.6GB + 7GB free memory remaining after 1-2 runs of the tests.
@micha: this is just permgen not heap — still?
@jannis: Ah ok, thought you mentioned something like you were using most of your memory
@martinklepsch: I didn't actually check before now, sorry. I just noticed my system getting really slow and made that assumption.
I'll be back later. It's survived 5 test runs with 512M of PermGen space, so perhaps that's good enough for now. Thanks!
@juhoteperi: re: https://github.com/Deraen/sass4clj/issues/8, are you thinking that compass is incompatible with sass4clj?
@pandeiro: compass-mixins mentions Libsass so it should probably work
Huh, yeah, b/c it was "working" with 0.1.1 (but only on initial compile; incremental would throw)
Hmhmh
No idea
But that should be fixed in 0.2 because I threw away custom webjars implementation
OK I'll try to find the time to create a minimal repro these days; maybe it will clear things up
Weird, I'm still having issues with Boot 2.5.5 fetching dependencies slowly / getting stuck while retrieving
I'm hesitant to open an issue b/c it seems like it is only happening when I run Boot via docker... but it's something I never hit with versions <=2.3.3
Anyhow @juhoteperi good news is 0.2.0 does work w/ compass etc; closing my issue. Thanks for the help!
docker keeps trying to get me to un-adopt it... but I'm pretty resilient (considering the alternatives)
(Even the new docker-machine thing that is replacing boot2docker relies on virtualbox)
Essentially you can't rely on being able to mount volumes from an OS X host in a container 😞
I wasn't quite sure what to do for the task
template in Boot new so I had it generate four example tasks (pre, post, pass-thru, and simple). Not sure of the value of simple. It doesn't include a fully expanded middleware example.
@seancorfield: I like that! Just having something there already makes things usually a lot easier
Happy to incorporate any and (almost) all feedback!
Don't have anything specific right now. I'm looking forward to your ideas regarding scaffolding/composable templates though
Hi! Is there a way of disabling the HUD in boot-reload
? It's the last step to get boot-react-native
error free! 😄
I'll take a look
@jellea: currently there's no way but the fix shouldn't be to hard if you open an issue I can give it a go later today (maybe 😛 )
homebrew pods?
cracked it?
"you are speaking in puzzles my friend" 😂
@jellea: boot pom jar install
I believe
not sure the HUD is a good thing to enable by default anyway
@jellea: PR certainly welcome. I guess in general we just need another option and the server should not send visual
messages anymore.
by the way, #boot
definitely has become TEH place to hang out
@pesterhazy: why not?
it seems like an optional feature that can break things and may be surprising to newbies (I didn't know about it)
especially for newbies I see big value in being more proactive about communicating compilation errors/warnings
There was another case where it broke something though so I guess I agree about that bit but I'd rather fix those issues than disabling it by default
@pandeiro: i find this "dev & prod env should be the same" rule is a bit over-hyped. in practice it might be an issue 0-2 times a year... the ~6 of us are running our clojure code directly on osx and it works just fine on amazon linuxes in production too.
how bad on a 1-10 scale is a fn signature like this? 😄
([callback])
([library callback])
why not make callback
the first argument in both cases?
(that's what i usually do unless there's some other reason not to)
@alandipert: because the library is more imortant info when reading the code
I guess I'll just do [library callback] and handle a :default
case for library
thread-last vs thread-first, i usually do the former when it's a function that operates on collections, like map/filter/reduce, and the latter when it's an operation on an object
more important info... or at least becomes less well readable as a single keyword in tailpos
anyways... 😄
in the end i'd recommend an options map and a set of multimethods for handling various scenarios. each method should return a deftype
and then the user-facing API can be protocols
😄 😄 😄 😂
I don't think that's a bad signature
@martinklepsch: IIRC the HUD also caused problems if you wiped the body content (like with mounting React directly on the body
tag). Not sure if that's something to fix though.
@jaen: ah right that was it. IMO probably not worth fixing though. easy fix for user + I believe wiping body might also kill many third party script thingies (e.g. intercom)
@onetom: yeah I agree, but then what if your company/project has N different runtimes?
@martinklepsch: not sure if there's something in the DOM you can listen on to see if DOM changed. Could be a helpful hint to say "you're changing the body
, it might trip boot-reload up".
@jaen: I'd put it in the readme under # Troubleshooting and be done with it 😄
I wondered if anyone on the boot channel were using cider with boot-cljs-repl and have cider-find-var (M-. on a symbol) jumping to the symbol definition - I just want to know if it's possible before I try to configure it - it's the one thing I really miss
@malcolmsparks: would you need to have eval'd the namespace first to be able to jump to definitions?
or is it enough to open a cljs file once the boot-cljs-repl is started and connected?
I tried to M-.
on subscribe
(re-frame.core/subscribe) and it says 'Symbol subscribe not resolved'
I'm also unable to cider-eval-buffer
on cljs file buffers without a java.lang.IllegalArgumentException: No implementation of method: :make-reader of protocol: #'
Re scoping of dependencies for a library. Only dependencies used by the library itself should be unscopped, with dependencies used for testing and the build.boot file given a scope of test, yes?
@laforge49: sounds right, yea
@laforge49: in most cases it's best for clojure to be an implicit dependency, yeah
with boot you want to specify a clojure dependency, and it should be the same as BOOT_CLOJURE_VERSION or you may see weird things
im talkin bout in your build.boot w/ your deps if you're making a library
i think leaving the clojure version specification to applications is the best default
but if that changes there could be a lot of issues, so i don't know what is the best way
not specifying a clojure dep makes it maybe easier for the consumer because you're not going to pull in your own version of clojure
i am hopeful that languages and platforms of the future will all of pod-like things
docker holds the torch
what do they do?
yeah that's sweet
man i need to do more dunaj
Re: versions of Clojure — we wrote a wrapper script for Boot itself and we "pin" versions of a number of libraries using a version.properties
file in our project. Our wrapper looks for that file, reads the Clojure version out of it, and sets BOOT_CLOJURE_VERSION
from that. Then in our build.boot
, we also read that file and we post-process the dependencies vector to override any versions that are "pinned".
We also calculate our JVM opts in that wrapper script (setting client / TieredCompilation or server as appropriate based on the environment)