Fork me on GitHub
#boot
<
2016-10-18
>
grounded_sage01:10:54

It does give warnings but these ones are much more helpful

cal06:10:23

I created a PR (https://github.com/boot-clj/boot/pull/507) some time ago to bring managed dependencies to boot. I would welcome feedback (here or in the PR) on whether this is a reasonable approach and on the implementation itself.

tmtwd17:10:53

what is the best way to manage multiple projects in boot? ie something similar to this https://github.com/jcrossley3/lein-modules

tmtwd17:10:17

could I create a build.boot script that uses clojure shell to go into each subdirectory and run boot install in each subdirectory or something similar?

tmtwd17:10:25

or maybe just a normal bash script?

flyboarder17:10:44

@tmtwd I think you are looking for boot-in-boot?

tmtwd17:10:54

yes, I suppose

tmtwd17:10:59

oh is that the name of somethign?

flyboarder17:10:56

that is an example of using boot to build multiple boot modules

tmtwd17:10:56

thank you

flyboarder17:10:15

np, if you have questions I’m here today 😛

flyboarder17:10:57

@tmtwd do your sub modules have an interdependency?

tmtwd17:10:05

yes certainly

flyboarder17:10:28

ok then make sure you look at the semaphore stuff in there

tmtwd17:10:01

is that to enable building modules concurrently?

tmtwd17:10:06

that would be awesome to get that

tmtwd17:10:13

to trim the build time time

flyboarder17:10:38

not exactly, it’s for making sure the deps are handled in the correct order between builds

tmtwd17:10:53

also very important

flyboarder17:10:57

so in that example project bravo depends on alpha

flyboarder17:10:09

and the compiled alpha build is dumped into resources for bravo, concurrent builds are not on the road map for boot as it stands

tmtwd17:10:48

ah yes I see

tmtwd18:10:17

can’t I just use a future and pass a task to future to get concurrent builds?

flyboarder18:10:59

i dont think so, since a task returns a middleware

anmonteiro18:10:27

Boot shows me an incomplete stack trace for exceptions

anmonteiro18:10:34

is there a way to make it show the full stack trace?

flyboarder18:10:59

@anmonteiro can you post the stack trace to pastebin or something?

anmonteiro18:10:10

clojure.lang.ExceptionInfo: java.lang.Boolean cannot be cast to java.lang.String {:from :boot-cljs}
	at adzerk.boot_cljs.util$deserialize_exception.invokeStatic(util.clj:85)
	at adzerk.boot_cljs.util$deserialize_exception.invoke(util.clj:76)
	at adzerk.boot_cljs$compile.invokeStatic(boot_cljs.clj:75)
	at adzerk.boot_cljs$compile.invoke(boot_cljs.clj:59)
	at adzerk.boot_cljs$compile_1$fn__277.invoke(boot_cljs.clj:126)
	at clojure.core$binding_conveyor_fn$fn__6766.invoke(core.clj:2020)
	at clojure.lang.AFn.call(AFn.java:18)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

anmonteiro18:10:15

small enough that it fits here

anmonteiro18:10:22

I want to see the full stacktrace

anmonteiro18:10:27

I know that’s not all 🙂

juhoteperi18:10:23

@anmonteiro Do you have minimal example case? Working fine for me

anmonteiro18:10:33

what do you mean?

anmonteiro18:10:07

@juhoteperi this is a bug in ClojureScript master, trying to track it down

flyboarder18:10:52

@tmtwd See https://github.com/boot-clj/boot/wiki/Tasks#boot-task-model you may be able to write a task that does something concurrently but I imagine the uses would be limited due to how tasks are currently constructed

juhoteperi18:10:05

Hmmmm. There is no way around this exception handling boot-cljs is doing.

juhoteperi18:10:18

But it should contain the stack trace...

tmtwd18:10:45

when there is a jar in ./resources like in https://github.com/micha/multi-module-build/blob/master/modules/bravo/src/bravo/core.clj, is it possible to require it like a normal dependency?

flyboarder18:10:57

@tmtwd sure, but then you may be better off with just running two terminals with boot both dumping to a different target dir

anmonteiro18:10:03

@juhoteperi I ended up creating a build.clj script and calling

java -cp `boot show -c` clojure.main build.clj

tmtwd18:10:21

sorry, I think my question was not quite right. Once, the alpha jar is dumped into bravo/resources, how do I require it in a bravo namespace?

tmtwd18:10:15

hm, I’m cloning the repo to get it to work, I think that’ll clear it up for me

flyboarder18:10:33

@tmtwd : @micha can probably answer that question a bit better, the jar in resources is not extracted it’s just available on the classpath, @richiardiandrea is also the resident boot-in-boot wizard

tmtwd18:10:00

ok, I just don’t understand how java works 🙂

flyboarder18:10:17

yeah im not a java expert 😛

micha18:10:52

@anmonteiro you can get full stack traces with boot -vv ...

anmonteiro18:10:59

@micha didn’t work though, I tried it

anmonteiro18:10:26

the result was I got the same stack trace without the fancy colors 😛

micha18:10:51

that's the whole thing then, i guess

micha18:10:16

nothing is removed from that stack trace

anmonteiro18:10:12

@micha no it wasn’t the whole thing

anmonteiro18:10:30

when I ran it with

java -cp `boot show -c` clojure.main build.clj
I got the whole thing indeed

micha18:10:11

but then the stack must be different

juhoteperi18:10:30

Boot-cljs modifies the exception

anmonteiro18:10:05

there’s our answer

anmonteiro18:10:27

@juhoteperi so it doesn’t seem too useful that Boot-cljs modifies the exception

anmonteiro18:10:40

in the case I pasted above it just didn’t give any useful information at all

juhoteperi18:10:49

Not sure why that happens

juhoteperi18:10:17

But the special handling is required for boot-reload

juhoteperi18:10:52

Maybe this is caused by the exception being from Clojurescript code, instead of something thrown e.g. by the reader

anmonteiro18:10:39

right, this wasn’t a reader exception

juhoteperi18:10:44

Reader exception about missing parenthesis or such gives proper stack trace

anmonteiro18:10:46

it was being thrown from cljs.closure

juhoteperi18:10:22

Do you know if there is any other way to test this except for running broken Cljs version?

anmonteiro18:10:56

@juhoteperi probably if you pass wrong configuration

anmonteiro18:10:03

it’ll throw an assertion error

anmonteiro18:10:32

@juhoteperi the thing is, in this case the message is useful because it’s an AssertionError. but the stack trace seems useless as to where the assertion failed in the code:

java.lang.AssertionError: Assert failed: :nodejs target not compatible with :whitespace optimizations
                          (not (and (= target :nodejs) (= optimizations :whitespace)))
    cljs.closure/check-node-target/invokeStatic    closure.clj: 1854
                 cljs.closure/check-node-target    closure.clj: 1853
                cljs.closure/build/invokeStatic    closure.clj: 1951
                             cljs.closure/build    closure.clj: 1933
              cljs.build.api/build/invokeStatic        api.clj:  199
                           cljs.build.api/build        api.clj:  187
adzerk.boot-cljs.impl/compile-cljs/invokeStatic       impl.clj:   89
             adzerk.boot-cljs.impl/compile-cljs       impl.clj:   66
                                            ...
                clojure.core/apply/invokeStatic       core.clj:  657
                             clojure.core/apply       core.clj:  652
                          boot.pod/eval-fn-call        pod.clj:  328
                              boot.pod/call-in*        pod.clj:  379
                                            ...
                              boot.pod/call-in*        pod.clj:  382
          adzerk.boot-cljs/compile/invokeStatic  boot_cljs.clj:   71
                       adzerk.boot-cljs/compile  boot_cljs.clj:   59
                  adzerk.boot-cljs/compile-1/fn  boot_cljs.clj:  126
            clojure.core/binding-conveyor-fn/fn       core.clj: 2020

anmonteiro18:10:08

oh I’m wrong, in this case it does show where it failed in the code

alexmiller19:10:49

Side effects include feelings of empowerment and regret for time spent on prior build tools

hiredman19:10:44

I feel like I need some kind of boot skeptic flare on my avatar

juhoteperi20:10:07

Just deployed new less4clj, sass4clj, boot-reload and boot-cljs!

domkm20:10:35

Is this issue supposed to be fixed in boot 2.6.0? https://github.com/clojure-emacs/cider/issues/1462

domkm20:10:13

I ask because I am still getting that error

arohner21:10:00

it seems like boot encourages a bunch of futures running in boot.user. Is there a library for making managing those futures more pleasant?

martinklepsch21:10:22

@arohner what are you running in those futures? I rarely have futures in build.boot. Sometimes tasks run stuff in futures but not sure if you're referring to that when speaking about futures in boot.user

arohner21:10:56

(future (boot (cljs-repl/cljs-repl-env) (cljs)))

martinklepsch21:10:15

@arohner are you doing that because watch and repl otherwise interfere?

martinklepsch21:10:57

Or do you really run single boot invocations whenever you change a file?

arohner21:10:33

I start boot with repl, and use cider to load-file

arohner21:10:49

then I want to start a CLJS repl when I want to work on CLJS code

arohner21:10:34

Is there a better way to start a CLJS repl, from boot repl?

martinklepsch21:10:15

cljs node repl or cljs browser repl?

martinklepsch21:10:07

So my workflow is usually something like boot watch reload cljs-repl cljs from the console. Then I connect via nrepl/cider/whatever and run (start-repl) which connects to the browser window running switches into a cljs repl

martinklepsch21:10:30

@arohner have you tried that approach (using https://github.com/adzerk-oss/boot-cljs-repl)?

arohner21:10:32

ah, ok. boot repl gives you a console repl, the nrepl connection is still going to be there either way

arohner21:10:04

yeah, I’m using watch cljs-repl/cljs-repl-env, which works fine

martinklepsch21:10:47

@arohner so I usually just run stuff from the terminal so the need for futures does not really arise I guess

arohner21:10:56

when running watch cljs-repl, is there a way to get the compile errors into the cider window, rather than the terminal?

martinklepsch21:10:56

at some point I needed a working terminal REPL and a watch process which probably is similar to what you're trying to achieve

martinklepsch21:10:28

Made something like this for this use case

;; ========================================================================
;; We could just run `boot dev` at the CLI but when using the `watch` task
;; you cannot also have an interactive `repl`. So we do this `reloaded.repl`
;; like workflow for starting and stopping to boot build pipeline
(def build-container-var nil)
(defn start-build! []
  (alter-var-root #'build-container-var (fn [_] (future (boot (dev :build-ids ["public/web"]))))))

(defn stop-build! []
  (alter-var-root #'build-container-var (fn [p] (future-cancel p))))
;; ========================================================================

arohner21:10:00

yeah, I’m basically doing that by hand right now, without the fns

martinklepsch21:10:23

dunno about the errors in cider, not a cider user myself