This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-02-12
Channels
- # aatree (9)
- # admin-announcements (2)
- # alda (4)
- # announcements (2)
- # beginners (87)
- # boot (218)
- # braid-chat (14)
- # cbus (2)
- # cider (19)
- # cljs-dev (17)
- # cljsjs (1)
- # cljsrn (5)
- # clojure (84)
- # clojure-android (1)
- # clojure-czech (8)
- # clojure-ireland (3)
- # clojure-madison (20)
- # clojure-poland (22)
- # clojure-russia (54)
- # clojure-sanfrancisco (1)
- # clojurescript (81)
- # clojurewest (4)
- # community-development (94)
- # conf-proposals (5)
- # core-async (199)
- # css (3)
- # cursive (68)
- # datavis (2)
- # datomic (23)
- # dysphemism (138)
- # editors (7)
- # hoplon (8)
- # jobs (8)
- # jobs-discuss (7)
- # ldnclj (2)
- # liberator (6)
- # off-topic (32)
- # om (200)
- # omnext (2)
- # onyx (88)
- # proton (58)
- # re-frame (14)
- # reagent (1)
- # ring-swagger (26)
- # yada (14)
Hey guys, why is this throwing: (set-env! :dependencies #(do (boot.util/info "Hey! %s" %) %))
Won’t that return nil
?
there is a %
no? but maybe I am tired
(do 5 4)
=> 4
java.lang.RuntimeException: No reader function for tag object
...
clojure.core/read-string core.clj: 3663
boot.pod/call-in* pod.clj: 313
...
boot.pod/call-in* pod.clj: 318
boot.pod/resolve-dependencies pod.clj: 414
for set-env! :dependencies #(vec (concat % '[[com.andrewmcveigh/cljs-time "0.3.14"]]))
I don't see why...
What does boot.util/info
return?
(do (boot.util/info …) )
the correct vec of vec
it is after the update that it fails
Oh, there’s a line break I didn’t see...
where? my code?
https://www.dropbox.com/s/37mq4hqcde55giv/Screenshot%202016-02-11%2018.02.35.png?dl=0
The %))
was on the next line...
but it is weird that the following does not work either: (set-env! :dependencies #(vec (concat % '[[com.andrewmcveigh/cljs-time "0.3.14"]])))
Hmm, let me look how I do that...
thanks man, because I return legittely 😄
Not finding an example in our code … looks like we changed to merge-env!
primarily …
ah that's handy!
I don't even need to use an update function
(set-env! :dependencies #(do (boot.util/info "Hey %s" %) %))
that works just fine in a Boot REPL for me...
Maybe something else is going on in your build.boot
file?
mmm...let me try in a fresh repl then
thanks guys you are right it works in a fresh instance
so when I merge dependencies I receive a warning, but is the bigger version always winning?
Warning: version conflict detected: org.clojure/clojure version changes from 1.6.0 to 1.7.0
but isn't this always true when I do set-env!
in the top level?
for example when I mix boot-cljs
and my own version of clojurescript
The warnings don't happen when the deps are added with the same set env call
Because there might be multiple candidates but only one "wins"
Vs multiple set env calls which force both to be loaded
(deftask production-build
[]
(apply merge-env! (reduce #(into %2 %1) [] (:prj production-options)))
(comp (build :options production-options)
(sift :include #{#"\.out"} :invert true)
(target)))
here i am basically merging :dependencies
from set-env!
to my own in production-options
once you have some version of clojure loaded you will get a warning if you try to load a differnt version on top of it
so you are saying that merge-env!
is not unloading the old ones
but set-env!
can
as you can see I was trying to be smart and avoid:
(deftask production-build
[]
;; verbosity and repetition
(set-env! :dependencies #(vec (concat % (:dependencies (:prj production-options))))
:source-paths (:source-paths (:prj production-options))
:resource-paths (:resource-paths (:prj production-options)))
(comp (build :options production-options)
(sift :include #{#"\.out"} :invert true)
(target)))
still warnings are popping up
so i cannot concat safely dependencies
what I wanted to do was to have a set of "standard" dependencies, and a set of deps that change based on the task
ok thanks micha I will try but it looks like a perilous road
because now the require top level set-env!
and require
cannot be performed
I guess
and the only set-env!
I can do is inside a deftask
or I can reset-env! in my task
but no, no reset-env!
then you can dispatch on (get-env :profile)
in your build.boot, before you load dependencies
and I also need to change all the symbols because the require is not there, so defining (comp (cljs))
triggers an error...
I guess I am trying to be too smart with deps
(def deps
(case (get-env :profile)
"development" (do something)
"production" (do something else)))
(set-env! :dependencies deps ...)
...
ok will try that, let me save it, now it's time for a break
tnx a lot!
are you trying to test tasks?
@kul: so one option would be to ensure that the file requiring boot.core
isn't on the classpath or not being loaded
@kul: you could also try adding a dependency on boot/core to your set-env! call but I'm not sure if that will just work
@martinklepsch: how can i do that as i want to do boot custom-task-in-that-ns test
?
why cant we have :test-paths in that plugin! it makes no sense to scan everything for tests!
that complicates things
maybe just try specifying namespaces manually for now? maybe when @micha is up later he has some ideas, I'm out of them for now 😛
yeah, probably something worth discussion on the boot-test repo
https://github.com/adzerk-oss/boot-test/issues/5 , my comment at the end
I wrote a tiny script for a colleague (say xyz.clj), he installed boot.sh and when he runs it, it gives java.lang.ClassNotFoundException for xyz.clj
hi, I am getting this error when starting boot dev
java.io.FileNotFoundException: Could not locate cemerick/piggieback__init.class or cemerick/piggieback.clj on classpath.
@thomas: did you update boot-cljs-repl
?
I think tenzing uses an old version where the explicit depdendency on piggieback isn't required
probably best to check the boot-cljs-repl changelog to figure out when it changed
also PR to tenzing would be welcome of course
adding dependencies always helps 😛
Hi! I keep on getting Maximum call stack size exceeded
errors as soon as I run (start-repl)
to set up a browser REPL with boot 2.5.5, Clojure 1.8.0 and Java (OpenJDK) 1.8.0_71. Does this sound familiar?
Here's the backtrace: https://gist.github.com/Jannis/84cab2e4d388658b81cc
Hi folks. I have two simple tasks that copy files from source to target: https://gist.github.com/mobileink/a2f86196eb67435e9623 . The webapp task works fine; the clj-cp creates the output dir structure but does not produce the .clj files. Inserting show -f indicates that the sift filter works. I can't see why it isn't working (actually I think it used to work.) Any suggestions?
I have a dummy boot project that just has clojure as a dep. when I boot show -c
, I see a lot more stuff than I expect to see. Is there a way to avoid seeing all the jdk jars, boot, and pod stuff?
@alexmiller: not that I know of
that's a bummer
the use case being that I want to (for example) just generate the classpath defined by my deps for use by a separate process or command line
lein classpath
is closer (but has some of the same issues)
I wonder what this stack size error is about. It appears to call goog.require
recursively. That would imply a dependency loop.
@alexmiller: I guess one way/hack might could be to parse the output of boot -B show -c
and remove these paths from the output of boot show -c
@martinklepsch: thx for looking at it
@alexmiller: I'm sure @micha will have a more suitable suggestion when he's around
@dominicm: do you want to start a repl in a pod?
@martinklepsch: Yeah. It works on it's own, but when composed with a different task, it seems to lose access to boot.repl
@alexmiller: sounds like maybe boot.pod/resolve-dependencies
is what you want?
we use it in boot show -p
@alexmiller: https://github.com/boot-clj/boot/blob/master/doc/boot.pod.md#resolve-dependencies
boot.user=> (map :dep (boot.pod/resolve-dependencies '{:dependencies [[clj-time "RELEASE"]]}))
([clj-time "0.11.0"] [org.clojure/clojure "1.7.0"] [joda-time "2.8.2"])
that is def the information that I want
if it matters, I was showing boot to Rich and this is one of the questions he asked :)
cool, give him our regards!
@martinklepsch: Looks like I have to require boot.repl inside the pod, when it is composed with another task.
@dominicm: yeah, that's what I was going to suggest
(easy said afterwards haha)
on it's own as in directly within your build.boot
?
When I do boot server
and start the task https://github.com/juxt/edge/blob/master/build.boot#L50 it works (see, no boot.repl being required)
But, if I compose it with frontend (another task in the file). It stops working, until I require
boot.repl
Released java.util.concurrent.Semaphore@c333c60[Permits = 1]...
clojure.lang.ExceptionInfo: java.lang.NullPointerException
data: {:file "/tmp/boot.user8772502733766753476.clj", :line 147}
java.util.concurrent.ExecutionException: java.lang.NullPointerException
java.lang.NullPointerException:
clojure.core/comp/fn core.clj: 2438
boot.core/run-tasks core.clj: 794
boot.core/boot/fn core.clj: 804
clojure.core/binding-conveyor-fn/fn core.clj: 1916
clojure.lang.AFn.call AFn.java: 18
java.util.concurrent.FutureTask.run FutureTask.java: 266
java.util.concurrent.ThreadPoolExecutor.runWorker ThreadPoolExecutor.java: 1142
java.util.concurrent.ThreadPoolExecutor$Worker.run ThreadPoolExecutor.java: 617
java.lang.Thread.run Thread.java: 745
I'm.. stuck. Any pointers?@thomas: lein install, yes
@martinklepsch: I was calling my server task as nil.. I feel stupid.
sorry PR is for @martinklepsch 😇
@thomas: thanks for the PR, merged
now I'll just need to migrate that to boot-new
and I think there is a very good use case for not having a back end include with tenzing… there are other use cases where it would make sense to include it IMHO. ie. I need to get some additional data from my clj back end… and integrating clj and cljs is still quite a big pain point IHMO.
I don't get it. So in the beginning the web app loads fine, different namespaces are required via clojure.browser.repl/bootstrap
and the .-require
set on js/goog
therein. But eventually, it enters an infinite recursion, trying to require cljs.core
over and over again, as if cljs.core
requires itself.
It may to be a problem with boot-reload
. If I take it out of the equation, (start-repl)
is ok.
Oh, it looks like adding :scope "test"
to it (and a few other dependencies) may have solved it.
Is there any example code of using boot watch test
, which doesn't require the full startup time? I'm running one test, and it's taking 5 seconds after each time I save a file.
@taylor.sando: What machine are you on? Windows / Mac / Linux?
Linux. I've just been using clojure.test/run-all-tests from a repl for now.
@micha your piece of code works like a charm, now I am able to launch: boot -e flavor=frontend build -t prod
inspired by Android's flavors 😄
will share the code asap
with no :dependencies
warnings
@richiardiandrea: awesome!
N-E-A-T 😄
yes it's there
it is very neat to have this kind of "archetype"
(deftask build
"Build task, based on the input flavor (specified with -e
flavor=frontend|backend) AND the input type prod|devel."
[t type VAL kw "The build type, either :production or :devel."]
(apply boot.util/info "Building %1$s with %2$s build type...\n" (selection type))
(let [options (options (selection type))]
(set-env! :source-paths (:source-paths (:prj options))
:resource-paths (:resource-paths (:prj options)))
(comp (:pre-middleware options)
(build-cljs :options options)
(:post-middleware options)
(target))))
where (defmethod options [:frontend :dev] [selection] ...
`
(defmethod options [:frontend :prod] [selection]
`
very flexible
the power of a language at your disposal!
We also added an icon on our website: http://lambdax.io 😄
Can anyone point me to the state of the art for building ClojureScript for Node.js (presumably Boot rather than Lein at this point). I see several projects on GitHub claiming to be "examples" but I am really looking for a canonical one.(
Node.js is fully supported, i have a sample demo repl for replumb for instance
@johanatan depends on you task too i suppose
Let's just say the task is an express server (it isn't but it will be fine for our purposes here). Isn't one NPM module imported the same as any other NPM module?
Ah OK npm i guess is still not so supported
Wow. So leiningen is the best I can do? [Even with lein, there are multitudes of competing examples].
My experience is not vast on npm modules so i cannot be sure
@richiardiandrea: sweet website!
@alandipert: thanks! We are officially open for business 😄
we like llamas, and boot
it sounds like an amazing combo