Fork me on GitHub

hmmm.. actually on the second attempt trick with using future worked. but right at the beginning it throws java.lang.NullPointerException in cljs console


meh… seems I still can’t use cljs-repl anyway, so it didn’t work


can I use wait to solve that? I’m trying but keep hitting this error

Can't change/establish root binding of: *cljs-repl-env* with set


@ag says that you need to run the start-repl task before the cljs task. The order that things happen depends on code because tasks generate middleware (that can execute code before or after later tasks) but sometimes it only works in certain order.


We have a task that compiles three Java files. The task looks more or less like this:

(deftask dev []
  (comp (javac)
The output I see is this:
Compiling 3 Java source files...
followed by a REPL, like expected. I can use the three classes from the REPL without problems. Then after a while this appears randomly when I’m working in the REPL:


Any ideas where this could be coming from?


Has anyone seen public key security exceptions when downloading jars from maven central? Had a working system, had upgraded maven, then reverted. I'm not sure if that was the issue though. It would seem I don't have a certificate installed to download from maven central, but I never had installed one before when it was working. Here's the exception when trying to re-install boot after wiping out the ~/cache/.boot/ btw this is on windows 7.


@symbit: did you try maybe clearing out your m2 folder?


@flyboarder I haven't. It seems the more I unwind things the worse it gets. Will move it aside.


@micha @alandipert re: possibly integrating the virgil code so it's usable from boot. A few weeks ago I was mucking around with this, and actually made a javac* task that does exactly the integration of the current javac task with the dynamic class compiling present in virgil. Is that something that would be useful to include as a built-in? I don't have the code on github ATM, but I can put that up later at the very least as a proof of concept


I was messing around with it because my junit task wasn't able to pick up changes to the classes when run inside a watch. I was able to get it working with my new compile task. Not sure how much more would be needed for good integration with the repl


@flyboarder renaming .m2 and creating a new .m2 with a settings.xml from a colleague, gives the same Exception.


@flyboarder creating a pom.xml and running mvn verify starts downloading all deps with no issue.


@mynomoto so I am still failing to get cljs-repl in one task:

(deftask try-me []
    (serve :reload true)
    (reload :on-jsload)
Not working


even tried wrapping start-repl into with-pass-thru - nothing


tried putting it into :watch-fn of :compiler-options of cljs - did not work


I'm not sure but I thought start-repl (to start a CLJS REPL) came after you had connected to the initial (clojure) REPL


ok, I’m starting repl boot repl then (boot (try-me)) it still complains: Can't change/establish root binding of: *cljs-repl-env* with set


> cljs-repl is the task to be used in the task pipeline whereas start-repl is how you connect to the ClojureScript REPL once you're in a Clojure REPL.


So it looks like you shouldn't have start-repl inside of a boot task context at all


just run that function directly from a clojure repl


I would also try to simplify your task definition. That try-me task is doing a lot of things. Try and get it working with just starting a repl first and then add things gradually


@geoffs I am trying to find a way to start cljs repl in a single task - in one command, without human being to have to wait until cljs-compilation, and then to type (start-repl) or whatever he/she needs to type in order to get cljs-repl


ah. that, I know nothing about. You could try using the nrepl startup hooks though. I haven't had great success with running things that way in the past, but it might be closer to what you want


So, the goal is: to make cider-jack-in-clojurescript to open 2 repls: clj and cljs. Well I can do it now, It creates 2 repls, it even starts cljs compilation in cljs-repl buffer, but you still have to manually type (start-repl) when it’s done compiling… duh


I could do that with lein-figwheel, why I can’t find a way to do this with boot-cljs?


I know there was supposed to be a mechanism through which one specified forms to be evaluated when a REPL was created


Leiningen had that; I think Boot supported it, too, but perhaps it didn't work


My memory is fuzzy on this point


In lein it's called :repl-options


You put it in the project map. I thought I had an example of doing it in boot, but I'm coming up blank


Ah now I remember, I think it was :init-ns that wasn't working properly for me due to some issue involving cider and boot


So not this exact thing


@ag poking around in this namespace might help you understand how to get code to run in a repl after it's started.


You could also write a tiny custom nrepl middleware, because boot already has hooks for adding nrepl middlewares. Otherwise, right off the bat I'm not seeing the thing I think you need.


I’m wondering why :compiler-options :watch-fn in cljs didn’t work either?


so this (cljs :compiler-options {:watch-fn (fn [] (prn “done”))}) results in a error: java.lang.RuntimeException: No reader function for tag object


@geoffs that does look promising


one thing i'm not clear on is the relationship with reloading clojure namespaces and otherwise messing with the environment


me neither. I was focused more on using boot for building java projects, so I didn't really get into the intricacies of interoperating with clojure.


@ag, this is just a hunch, but if cljs is trying to pass that function into a pod, then it won't work with an anonymous function like that because they can't be printed and then read back in. maybe just defining that function in your project and just passing the name in :compiler-options would work?


oh, lemme try that


nope: same error


@geoffs i don't think the idea would be ready for a builtin just yet, but a library would be absolutely awesome


@geoffs i would definitely try it out. then after we had some experience, we could investigate rolling it into boot or adding an option to javac task


Sure, that makes sense.


Hi guys, I’m having a moment of serious confusion here;; a dependency for my project lists [cljsjs/boot-cljsjs], and internally that project uses clj-http. However, for some unrelated reason I had clj-http listed as my own dependency, albiet a different version. Now I no longer need clj-http for my own project, but if I remove that dependency, my boot task fails with a bunch of strange errors Call to clojure.core/defn- did not conform to spec:, where the root seems to be here:

clj-http.client/eval74/loading--auto--     client.clj:    1
          clj-http.client/eval74/invokeStatic     client.clj:    1
                       clj-http.client/eval74     client.clj:    1
                            boot.pod/call-in*        pod.clj:  382
cljsjs.boot-cljsjs.packaging/eval2077/fn/G/fn  packaging.clj:   88
               boot.task.built-in/fn/fn/fn/fn   built_in.clj:  493


i.e. boot-cljsjs is using clj-http, but way downstream it has to do with potemkin and finally clojure.spec which is causing the strange errors.


Is there some hidden dependency I don’t know about with cljsjs? is there an issue resolving the proper dependency? is there something wrong with my maven cache?


@lwhorton these will help you debug such issues:


boot show -d
boot show -p
boot show -e


*also I’ve been using boot show -d to list out my dependencies, but no where is clj-http listed… which makes things even more confusing


you can use the --pods option to show


to see these things inside other pods


oh neat I didn’t know about -p or -e, thanks.. ill get back to you with hopefully a resolution


if it doesn't show up in the show -d output it's probably in a pod


so you can do show -d --pods '.*'


for example


to see deps in all pods


This is so weird, its not inside root or any pod with -d -e or -p after a grep search. I wonder if what’s really happening is an error elsewhere and this is a herring.