pandeiro / boot-http

A simple HTTP serve task for the Boot build tool
62 stars 34 forks source link

Always load nrepl deps #61

Closed bhagany closed 7 years ago

bhagany commented 7 years ago

boot-http requires boot.repl-server in the worker pod, which in turn requires 3 namespaces under clojure.tools.nrepl. Because of this, boot-http needs to ensure that org.clojure/tools.nrepl is loaded in the worker pod.

This build.boot is sufficient to demonstrate the bug:

(set-env!
 :source-paths #{"src"}
 :dependencies '[[pandeiro/boot-http "0.7.6"]])

(require '[pandeiro.boot-http :refer [serve]])

Running boot serve -r public with this configuration throws a FileNotFoundException.

bhagany commented 7 years ago

I should have also mentioned, this bug was introduced here: https://github.com/pandeiro/boot-http/pull/52

RadicalZephyr commented 7 years ago

For future googlers, this exception will also occur from doing the simple serve from the README:

boot -d pandeiro/boot-http serve -d . wait

And fixing it is as simple as adding an explicit tools.nrepl dependency:

boot  -d org.clojure/tools.nrepl:0.2.11 -d pandeiro/boot-http serve -d . wait
pandeiro commented 7 years ago

Thanks @bhagany and sorry for taking a while to get to this. In the interest of putting a bandaid on this, I'll merge. But I think that, ideally, usage of serve that does not utilize nREPL would not be requiring that dependency. When I looked at the original code, that seeme to be the intent, and it seemed like it should work, but I haven't had time to properly debug it.

bhagany commented 7 years ago

No worries, and not requiring the dep if it's not used makes sense. I think all that would be needed is to delay requiring boot.repl-server here: https://github.com/pandeiro/boot-http/blob/master/src/pandeiro/boot_http.clj#L78. I can put together a PR soonish.