This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-06-23
Channels
- # admin-announcements (2)
- # arachne (2)
- # beginners (76)
- # boot (241)
- # cider (14)
- # cljsrn (2)
- # clojars (3)
- # clojure (94)
- # clojure-android (12)
- # clojure-dev (33)
- # clojure-gamedev (1)
- # clojure-greece (3)
- # clojure-india (1)
- # clojure-nl (2)
- # clojure-quebec (3)
- # clojure-russia (21)
- # clojure-spec (38)
- # clojure-uk (72)
- # clojurescript (62)
- # cursive (20)
- # datascript (3)
- # datomic (14)
- # devcards (1)
- # dirac (14)
- # emacs (11)
- # hoplon (7)
- # jobs (2)
- # keechma (1)
- # lein-figwheel (9)
- # leiningen (9)
- # luminus (1)
- # off-topic (6)
- # om (13)
- # onyx (30)
- # planck (181)
- # proton (3)
- # re-frame (6)
- # reagent (6)
- # specter (108)
- # spirituality-ethics (7)
- # untangled (3)
Is is possible to include a license/docstring above your compiled cljs code using the cljs
task?
i’m trying to use boot as a library by calling boot.App/main
. i’m currently successfully calling boot tasks this way, but it will sometimes randomly fail with an opaque error in boot/main.clj: Pop without matching push
. i would love any help; i understand what i’m doing is unconventional but it seems like it should be achievable.
@kenny: You could try the preamble compiler option
@martinklepsch: You that did the trick, thanks!
In a combined clj+cljs boot file, how do I get the repl prompt (`:server false`) to show up? I don't see a prompt with what I have:
(deftask dev-repl []
(comp (development)
(repl)
(watch)
;; (cljs-repl)
(reload)
(build)
(run-server)))
To be clear, I want the clojure repl to show up (`repl`) in the terminal that runs boot dev-repl
:client true
? @pesterhazy
@martinklepsch: so call (repl :server true)
and later (repl :client true)
in the same boot pipeline?
do you have any task-options!
calls for the repl
task?
just invoking (repl)
should bring up a prompt
that's what it did, until I added the cljs-related tasks (brazenly stolen from tenzing)
hm. so boot development repl
works, boot development repl wait
doesn't (it doesn't give me a prompt)
right the wait
task will block forever not "finishing" the pipeline
same for boot development repl watch build
@martinklepsch: but shouldn't repl
be executed before that?
I'd expect the server to start but the prompt probably attaches after the pipeline
ah so it starts the server first, then executes everything, and then attaches the prompt to the nrepl
I think so, yeah
I not sure how watch
and repl
interact you might want to try different orders of these
boot watch repl
, unfortunately, blocks and doesn't execute the rest of the pipeline
as a workaround I'll use boot repl
in one window and boot repl -c
in another, though that's not optimal of course
@pesterhazy: fwiw, I use inf-clojure
and in this case I use boot repl -c
as "jack-in" command making the workflow pretty much cider-like (just without cider)
@martinklepsch: so you're opening two terminal windows?
by the way I wish there was a boot repl -c
-in-a-jar which starts up faster than boot repl -c
perhaps written in planck for turbo speed?
or in ocaml or something 🙂
@pesterhazy: I open a terminal window and the other "terminal-window" is opened in emacs
ah cool
yeah I still haven't gotten used to using terminals from inside emacs
@pesterhazy: well it turns into a repl immediately which you can send forms to and all that
the terminal window reference is more originating from the fact that this essentially just starts the boot repl -c
process with which it communicates via stdin/out
got it
Btw the way @pesterhazy, my lambone template does exactly that, two repls in one terminal where you can connect to. I wanted to completely separate the backed classpath from the frontend classpath, following juxt's edge. Currently you don't strictly need two repls if you have every dep (frontend and backend) on the classpath (like lein on standard boot), but I prefer this way...in any case you can check the dev-backend
task for how to write a non-blocking Repl task
@dominicm: it's tagged on github so I guess yes
Yes it is been using it for a while
Yeah a while is a month wow it feels longer lol
Looks like boot-reload 0.4.0 doesn't work with it, that's the only reason it's even come up.
@micha a question about https://github.com/adzerk-oss/boot-test/issues/26 ...is it possible that it is because there is some missing cleanup to add?
@richiardiandrea: have you tried putting visualvm or something like that on it to see what's using the memory?
it is using the pod pool, I'll try that
kk I am going to inspect the code a bit better
yep...checking...I'll report back
so basically the therad clojure-agent-send-off-pool-1
is doing something funny and growing and growing. Dumping the threads reports that it is the watch
task
triggering manual gc does not shrink the memory usage of the thread
maybe the boot.watcher
stuff? Reading...reading
yeah by dumping the thread I see that is running my tests
if I am publishing a library foo, and I list :source-paths… no other project that lists :dependencies ‘[foo] can find the namespaces on the classpath. However, if I list the foo code under :resource-paths, everything works dandy. this makes me realize I have no idea what the difference is between these two keys. can I look that up somewhere in more detail?
that link i sent has a table of which *-paths thing corresponds to which permutation of the two roles
so if I understand this correctly, by the nature of this being a library for others to consume, i need to setup the code as :resource because the code needs to be emitted, used by a packaging task, and show up as a final artifact
output files are artifacts that are produced that will be delivered to some other process
normally I work in cljs land, so to me ‘input’ is a cljs file, and output is a js file— and that makes sense. the thing i’m consuming is javascript. what’s more confusing to me is when publishing a boot-task, the thing i’m outputting is just more clojure code to be consumed elsewhere. i guess according to boot’s definition that has to be :resource-paths to mark as ‘output’.
so the difference being that a boot-cljs task probably marks the produced js as ‘output’ role, right?
so they also have the input role too, so you can further process the js with another task if you want to
trying to use boot-cp
, but it is throwing a 'conflicting dependencies' warning, how to force it to create a proper dependencies classpath file?
@fenton: hey! I think that task has been designed to throw/report conflict, it should write down a file with -w -f your-file
.
@richiardiandrea: % boot with-cp -w -f deps.out
doesnt' write a file when there is a warning. hmmm...
@micha: how to resolve deps, explicitly stating them in build.boot
doesn't seem to help?
yeah you need some chiseling 😄
lein does: lein classpath
without having to do all the exclusions stuff manually...thats handy.
(def exclusions ....)
(task-options! pom {:project 'acu
:version +version+
:url ""
:description "FIXME: write description"
:license {}}
with-cp {:file "cp"
:safe true
:dependencies frontend-deps
:exclusions exclusions})
My conf, not that bad 😉 I lauch it with boot with-cp -w
@fenton: lein classpath isn't intended to throw if there are conflicts and just resolves them similar to how boot show -c/-C
work (I see with-cp isn't either ...)
then do this: boot -BP -d org.clojars.micha/boot-cp -d ring -d hoplon with-cp -w -f foop
@micha for you, a dump of the objects after a couple of boot watch test
iterations...
I am going down the rabbit hole
there is ClojureRuntimeShimImpl
but I guess I need to checkwhere the column "retained" is max?
the classloaders probably can't be GC because something is holdig a reference to a class created by them
perhaps adding a line to eval (clojure.core/shutdown-agents)
in the pod here: https://github.com/boot-clj/boot/blob/master/boot/pod/src/boot/pod.clj#L826
I'll try
@micha no no multi, it is plain boot-test
but I have to check that I don't create unnecessary pods yes
the only pod I see it's here: https://github.com/adzerk-oss/boot-test/blob/master/src/adzerk/boot_test.clj#L87
I am going to try now 😉
clojure version 1.8.0
it looks better with shutdown-agents
I'll PR
no thank you Micha 😄
I can say the same ah ah
@micha, just to confirm the position:
(when pod
(.close pod)
+ (clojure.core/shutdown-agents)
(.. pod getClassLoader close)))
let me try
i fully qualified the name because the user could be shadowing shutdown-agents
in the pod
what was the intuition behind the shutdown-agents
btw? each pod bootstraps his own set of agents (I guess) ?
yes same seesaw pattern, good!
ok ready to roll 😉
👏 @richiardiandrea ... memory leaks, always so fun to debug 😄
lol true dat
@richiardiandrea: you mentioned that the out of memory condition happened in an agent thread pool, and i remembered that those need to be shut down manually
yeah it was executing code in a thread from an agent pool, who put it there I don't know though, maybe it is part of the pod-pool
implementation but did not check that
@kenny: yes, you can put them in different source directories and include one when building for development and the other when you're building for production
you can make a macro that emits one thing when the ENVIRONMENT env var is "dev" and something else when it's "prod"
what’s the equivalent to Lein’s :java-source-paths
in Boot?
@anmonteiro: just regular :source-paths
hrm, doesn’t seem to detect my Java class
I might be doing something wrong, atm just java.lang.ClassNotFoundException
let me try with a dummy one
I was wanting to customized the compiler options depending on dev or prod. Wouldn't the macro need to modify the file?
Also, I found this article: https://www.martinklepsch.org/posts/parameterizing-clojurescript-builds.html. Couldn't you use that method instead of macros?
@micha: yeah, doesn’t seem to find it
@kenny: compiler-options itself can also be directly passed to the task
package foo;
public class Foo {
public static final FOO = 42;
}
under src/foo/Foo.java
(import [foo Foo])
;; => java.lang.ClassNotFoundException: foo.Foo
How can I expect it to work?
sorry for the noise
Oh really? I could've sworn I tried that before and it didn't work. Have you always been able to do that?
it had to be a stupid thing
let me try to actually compile the thing
should I hook it up into the build pipeline somehow?
@kenny: there's a handy table here: https://github.com/adzerk-oss/boot-cljs/wiki/Usage#options
@micha: works as expected. My ignorance got in the way
@anmonteiro: glad it's working now 🙂
@micha: how should I pass JVM options to the javac
task?
Boot’s source says it should be a [str]
@anmonteiro: that means vector of strings
@kenny: to some degree probably yes, not sure about the contents of compiler options etc
@micha: yeah I got that, just wondering how to pass a vector at the command line
should I just -o xxx -o yyy
?
gotcha, thx
It'd be nice to create a template with options and have the options in a cljs.edn override options set in the task.
the task help thing with --help will say something like Conj NAME onto the vector of javac options to use.
or something like that