Fork me on GitHub
#boot
<
2015-06-11
>
micha14:06:06

greetings, fellow programs!

danielsz16:06:18

@alandipert: good to see you.

meow16:06:32

So, a fresh checkout of https://github.com/adzerk-oss/boot-cljs-example followed by "boot dev" results in an error

meow16:06:36

Compiling cljs_test_node_runner.js...
Compiling boot-cljs-main.js...
java.io.IOException: Cannot run program "node": CreateProcess error=2, The system cannot find the file specified
java.io.IOException: CreateProcess error=2, The system cannot find the file specified

danielsz16:06:53

you need to have node installed

danielsz16:06:46

that's what the error says

meow16:06:49

@danielsz: Right, so is there a way to define that as a dependency and have boot install it?

meow16:06:17

@danielsz: I'm new to clojure, btw.

danielsz16:06:55

Can I suggest another project to try out which doesn't require node?

danielsz16:06:11

to try out boot I mean

meow16:06:14

of course simple_smile

meow16:06:55

@danielsz: I can also "fix" things by not using the test runner. I'm really just looking at example boot files for use with my cljs/om projects.

danielsz16:06:17

yes absolutely, fix it by not running the tests

meow16:06:30

@danielsz: I did look at your projects briefly. But that was yesterday. Will look again because boot is now making more sense to me.

danielsz16:06:14

very cool. Let me know if you need anything;

meow16:06:41

At the same time, it isn't terribly newbie-friendly to have a boot example that fails with a not-too-terribly helpful error message, doncha think? simple_smile

meow16:06:47

I keep stumbling over these little things on my way to groking boot and it's kind of frustrating and time-consuming.

meow16:06:20

Boot is great and you guys are most helpful, don't get me wrong.

danielsz16:06:20

alan and micha are aware of this, and they're incredibly busy

danielsz16:06:38

not sure what the solution is

danielsz16:06:01

everybody is welcome to repair things and make things better

danielsz16:06:37

there's already a lot of improvements in documentation, but then a gaping hole appears or reappears

meow16:06:30

Is there a way to define node as a dependency and have boot install it so that boot-cljs-test/node-runner doesn't fail?

jeluard16:06:57

In this particular case it probably makes more sense to shell out and use the node binary.

jeluard16:06:11

Boot ecosystem is still pretty new so you might expect such scenario. A github issue with suggestions is a nice way to move things forward.

jeluard16:06:05

@meow: would an improved error message solve your issue?

meow16:06:23

@jeluard: I'm not really sure. I'm working on cljs and learning boot and went looking for examples. The example I found failed when run as "boot dev". I figured someone might want to know, since the failure isn't immediately obvious, comes from another project (https://github.com/boot-cljs-test/node-runner), and, ironically enough, has to do with managing a dependency. As for my personal use, I don't really need a test runner at this point so I can work around it. I was just trying to track it down further to be helpful. If node.js has to be installed independently then a better error message would help, as would mention of that fact on the readme files for the example project and the test runner.

jeluard16:06:23

Maybe 2 different issues then: the example should not fail in this case but just skip tests execution.

meow16:06:10

Add some extra irony for the fact that the failure is in a test runner. Does anyone but me see the extreme and absurd humor in all of this?

meow16:06:33

@jeluard: The simplest solution is to remove the use of the test runner from the pipeline in the example since it isn't even talked about on the home page and isn't necessary. Of course, that's also just sweeping the problem under the rug because having automated unit testing as part of the dev pipeline would be a good thing to have and ought to work.

meow16:06:43

Here is the fix:

meow16:06:49

(deftask dev []
  (set-env! :source-paths #{"src" "test"})
  (comp (serve :dir "target/")
        (watch)
        (speak)
        (reload :on-jsload 'app.core/main)
        (cljs-repl)
        #_(cljs-test-node-runner :namespaces '[app.test])
        (cljs :source-map true :optimizations :none)
        #_(run-cljs-test)))

meow17:06:27

But as you can see, someone put those there on purpose so I would think they would want them to work. 😉

jeluard17:06:44

In the mean time could you successfully run tests after installing node?

meow17:06:17

@jeluard: I haven't installed node. Do I need to install node? Is there no way for boot to manage that dependency?

jeluard17:06:10

Not with current implementation of node-runner. Node is a complete binary so the current approach looks good to me.

meow17:06:24

@jeluard: Okay, cool. I will install node then. Thanks. simple_smile

meow17:06:40

With nodejs installed the example works. Thanks again, @jeluard and @danielsz. Much appreciated. simple_smile

jeluard17:06:45

You're welcome!