Fork me on GitHub
#boot
<
2017-05-21
>
qqq05:05:48

does boot auto listen on port 5000 for something? if so, how can I kill it

mobileink09:05:11

@richiardiandrea : something funky is definitely happening. to be more clear, task A generates a file of clojure code, and task B loads a clojure file that requires the namespace generated by task A. it looks like task B is trying to load that file before task A has completed.

mobileink09:05:45

not only that, but I emit a msg “Running task Foo” at the start of each task. all such messages are printed before either task begins. I cannot see how this could happen if boot is not doing some stuff concurrently.

mobileink09:05:19

even weirder: boot components index target - the index task is running before the components task! seems to be happening because the index task starts with (set-env! :source-paths #{"src/page"})

juhoteperi09:05:51

Probably components uses with-post-wrap (runs the code after following tasks are run) and others use with-pre-wrap: https://github.com/boot-clj/boot/wiki/Tasks#pre-and-post-tasks

juhoteperi09:05:02

Also, usually using set-env! inside tasks is not very good idea, that code is run before any task code is really run and affects all the tasks

mobileink09:05:38

actually both use this pattern:

(fn middleware [next-handler]
    (fn handler [fileset]
      (let [workspace (boot/tmp-dir!)
            target-middleware ...
            target-handler (target-middleware next-handler)]
	;; do stuff...
        (target-handler (-> fileset
                            (boot/add-resource workspace)
                            boot/commit!))))))

mobileink09:05:17

what I really need is a way to delay loading of specific files, e.g. put them in a directory that is not on the CP for task A, then add that directory to the CP for task B. (Task A uses (->> fileset boot/fileset-namespaces) and must load each in order to inspect it)

mobileink09:05:43

is there a better way to do this than set-env!?

mobileink10:05:50

a pod could do this?

qqq10:05:45

I'm using boot reload

qqq10:05:59

I have changed the reload port fro m5000 to 4000 (aws elastin beanstalk wants 5000)

qqq10:05:12

how do I tell the applicatin oto check 4000 ? it's trying 5000 right now

juhoteperi11:05:57

@qqq Boot-reload uses a random port, not 5000. Check boot reload --help

qqq11:05:05

@juhoteperi : got it resolved, thanks

qqq11:05:15

it was 5000 because I was forcing reload to yuse 5000

mobileink15:05:09

how can I add a path to :source-paths for one task, using a pod? this does not seem to work:

(let [pod-env (update-in (boot/get-env) [:dependencies] ... etc ...)
        pod-env (if (nil? source-paths)
                  pod-env
                  (update-in pod-env [:source-paths] clojure.set/union source-paths))
        pod (future (pod/make-pod pod-env))]

mobileink15:05:22

ok, so a simple (pod/add-classpath) seems to work. d’oh! I thought it was more complicated than that…