Fork me on GitHub
#boot
<
2016-09-08
>
smw03:09:55

Hi! I have a cider / boot question

smw03:09:57

(deftask dev
  "Run a restartable system in the Repl"
  []
  (comp
   (environ :env {:http-port "3000"})
   (watch :verbose true)
   (system :sys #'dev-system :auto true) ; :files ["handler.clj" "html.clj"])
   (repl :server true)))

smw03:09:15

I have a task like this. If I ‘cider-jack-in’, I have a repl in the boot.user namespace.

smw03:09:32

That namespace has a (dev) function, which I can run.

smw03:09:01

But if I do, I’m not able to get the init/go/reset functions that would normally be injected into the namespace if I ran boot dev from the command line

smw03:09:06

What am I missing?

dominicm08:09:43

@smw Running (dev) in boot.user will start another repl, I think. That doesn't solve your problem, but probably isn't your intention either.

smw08:09:09

Yeah, I think I figured out running (boot (dev)) does something like that too. But still not solving my problem.

dominicm08:09:27

Oh, yeah. So (dev) is just returning a function you could call to start the system.

dominicm08:09:19

@smw Does system inject those functions into the namespace?

smw08:09:27

Yeah, it appears so.

smw08:09:00

I think I got it to work in cursive correctly, so I gave up on cider for the moment … solving a real problem, but I was enjoying cider, when it worked.

dominicm08:09:12

You basically want to take the (repl :server true) out of dev, if you it to run from the REPL. I'd suggest adding a flag to dev.

smw08:09:16

maybe I just ignore the injected stuff and use reloaded.repl to do it manually.

dominicm08:09:38

Then you can do (boot (dev)) as you figured out before

dominicm08:09:55

But for now, try taking it out, to test

smw08:09:28

Ahh, that’s an idea

smw08:09:40

if it didn’t have server I could do it inside the ‘main’ boot repl

smw08:09:44

I’ll give it a shot.

dominicm08:09:58

Derp. Just remembered that there's a CIDER feature for this: In Emacs do M-x customize-variable cider-boot-parameters and set it to dev

dominicm08:09:36

Of course, if you have a CIDER task as described here: https://github.com/boot-clj/boot/wiki/Cider-REPL you want to set it to cider dev

smw08:09:49

I did try that

smw08:09:32

didn’t work for me. (dir boot.user) only showed dev (and cider?)

smw08:09:50

no go, start, reset, etc

dominicm08:09:43

Cider is black magic to me. I'm happy in Vim land.

smw08:09:52

maybe system.boot is just too much magic

smw08:09:58

Thanks for the ideas!

dominicm08:09:25

If it works at your shell, CIDER should run it in the same way.

smw08:09:45

so far that doesn’t appear to be true 🙂

dominicm08:09:38

Yep, but that's more a reflection of what Cider is doing at the moment, as opposed to system.boot.

flyboarder21:09:00

Hello getting a null pointer error in my boot script?

flyboarder21:09:15

^figured it out, (sift :add-jar {’namespace “path"}) will NPE if the namespace is missing (in this case was removed)