Fork me on GitHub
#boot
<
2016-11-11
>
ag00:11:43

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

ag00:11:48

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

ag01:11:07

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

mynomoto10:11:18

@ag https://github.com/adzerk-oss/boot-cljs-repl#build 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.

borkdude11:11:42

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

(deftask dev []
  (comp (javac)
             (start-system)
             (repl))
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: https://www.dropbox.com/s/dq7u6wuiu7d1nsu/Screenshot%202016-11-11%2012.27.37.png?dl=0

borkdude11:11:04

Any ideas where this could be coming from?

symbit15:11:36

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.

flyboarder15:11:17

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

symbit15:11:01

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

geoffs16:11:14

@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

geoffs16:11:46

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

symbit16:11:12

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

symbit16:11:26

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

ag17:11:51

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

(deftask try-me []
  (comp
    (dev-env)
    (serve :reload true)
    (watch)
    (reload :on-jsload)
    (notify)
    (npm-install)
    (sassc)
    (cljs-repl)
    (start-repl)
    (cljs)
    (target)
    ))
Not working

ag17:11:38

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

ag17:11:34

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

pandeiro17:11:58

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

ag17:11:52

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

geoffs17:11:16

> 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.

geoffs17:11:07

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

geoffs17:11:19

just run that function directly from a clojure repl

geoffs17:11:25

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

ag17:11:34

@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

geoffs17:11:24

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

ag17:11:47

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

ag17:11:03

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

pandeiro17:11:55

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

pandeiro17:11:21

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

pandeiro17:11:27

My memory is fuzzy on this point

geoffs17:11:55

In lein it's called :repl-options

geoffs17:11:21

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

pandeiro17:11:39

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

pandeiro17:11:44

So not this exact thing

geoffs17:11:23

@ag poking around in this namespace might help you understand how to get code to run in a repl after it's started. https://github.com/boot-clj/boot/blob/master/boot/pod/src/boot/repl.clj

geoffs17:11:13

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.

ag17:11:15

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

ag17:11:24

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

micha17:11:09

@geoffs that does look promising

micha17:11:44

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

geoffs17:11:40

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.

geoffs17:11:49

@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?

ag17:11:13

oh, lemme try that

ag17:11:11

nope: same error

alandipert18:11:32

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

alandipert18:11:02

@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

geoffs18:11:13

Sure, that makes sense.

lwhorton21:11:00

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

lwhorton21:11:48

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.

lwhorton21:11:27

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?

micha21:11:16

@lwhorton these will help you debug such issues:

micha21:11:32

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

lwhorton21:11:48

*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

micha21:11:07

you can use the --pods option to show

micha21:11:15

to see these things inside other pods

lwhorton21:11:37

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

micha21:11:03

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

micha21:11:33

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

micha21:11:36

for example

micha21:11:41

to see deps in all pods

lwhorton21:11:28

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.