boot

:boot-clj: https://boot-clj.github.io/ — build tooling for Clojure. Dev chat in #boot-dev
mariuene 2018-05-25T12:18:27.000393Z

hey. Speaking of cache. Is there any way built into boot to clear the cache? Instead of doing rm -rf ./boot/cache/

mariuene 2018-05-26T12:49:57.000087Z

Yes. We have a package we release as a snapshot, and from what we can understand the cache is not overwritten even if the snapshot is updated in the .m2 directory. So when we try to build the project it will always look at the first version of the package it downloaded. Say if you run the project on a fresh computer, then it will use the latest Snapshot. But if you release a new version of that package in the same snapshot version, you will update to the newest version of that package inside the .m2 directory, but the .boot/cache/tmp/ or .boot/cache/cache/fileset will not be overwritten with the new version.

mariuene 2018-05-26T12:56:53.000063Z

So we have found out that if you clear the tmp and fileset you force boot to reload our package to the latest version.

martinklepsch 2018-05-26T12:56:55.000085Z

Maven only refreshes snapshots in your .m2 every 24hrs IIRC. Could that be the issue? You can check with boot show -U I think

martinklepsch 2018-05-26T12:59:08.000067Z

Do you find files related to your snapshot release in .boot/cache dirs? Have you tried more localized clearing of that cache to find out which files need to be deleted for the desired snapshot to be taken into account?

mariuene 2018-05-26T13:11:19.000078Z

Yes, but trying to navigate the cache is a bit tricky. I've found that just deleting the tmp and fileset folders are enough to force boot to read our latest snapshot. When we update a package and republish it, boot gives an update before running the project that it's downloading a new version of that package, and overwriting the old version. I have tried boot show -U but it updates every snapshot in the project have, and it's a bit too much and I would prefer if it was possible to update only one snapshot at the time. I don't know if this is noteworthy but the snapshot package we're using is mostly containing assets like css and images.

martinklepsch 2018-05-26T22:52:22.000010Z

Does boot show -U fix your problem besides the fact that it updates all Snapshots?

mariuene 2018-05-27T12:51:16.000062Z

I can try tomorrow.

mariuene 2018-05-28T09:20:45.000264Z

Boot show -U took 1h10m to run. and did not update the snapshot.

martinklepsch 2018-05-28T09:26:36.000269Z

oh, that’s long 😮

mariuene 2018-05-28T09:38:27.000353Z

it might be because i cleared my chache before, and the project has a lot of dependencies.

mariuene 2018-05-28T09:39:03.000172Z

but running again after took only 2 minutes.

borkdude 2018-05-25T17:55:22.000435Z

if I have (comp task1 ... task2) and I want to have a side effect (e.g println) happen on the dots, what to write? with-pass-thru?

dave 2018-05-25T18:05:16.000294Z

@borkdude that should work, i think i've done that before

dave 2018-05-25T18:06:49.000426Z

i bet with-pass-thru would work too. i may not have heard of with-pass-thru back when i wrote that code

borkdude 2018-05-25T18:08:16.000261Z

I think so yes. but how about an anonymous task on the dots?

borkdude 2018-05-25T18:08:35.000015Z

e.g. this works:

(deftask foo []
  (with-pass-thru [_]
    (println “foo”)))

(deftask bar []
  (with-pass-thru [_]
    (println “bar”)))

(deftask baz []
  (comp (foo) (bar)))

dave 2018-05-25T18:10:30.000705Z

i'm pretty sure you can do (comp (foo) (with-pass-thru [_] (println "bar")) (baz))

borkdude 2018-05-25T18:10:34.000629Z

oh yes

borkdude 2018-05-25T18:33:58.000244Z

I want to make a task that delegates to other tasks, so it should not check command line args, but just pass them to another task. How?

2018-05-25T18:37:31.000374Z

(deftask metatask []
  (fn [next]
    (fn [fs]
      (if some-condition ((next some-task) fs) (next fs)))))

2018-05-25T18:38:31.000470Z

or maybe ((some-task next) fs) depending on the order you want

borkdude 2018-05-25T18:39:06.000655Z

@alandipert when I pass command line args to metatask, then I get an error about unknown option this and that?

2018-05-25T18:40:13.000260Z

are you doing something like (apply metatask *opts*)?

borkdude 2018-05-25T18:42:00.000626Z

Say I have task A in build.boot and task B in some other namespace. I want to pass thru the command line options from A to B

borkdude 2018-05-25T18:42:19.000085Z

without A checking them

borkdude 2018-05-25T18:42:27.000388Z

so I don’t have to redefine the options

borkdude 2018-05-25T18:43:49.000491Z

But I may do it another way and just make the task in B a normal function

borkdude 2018-05-25T18:45:06.000398Z

so never mind 🙂

borkdude 2018-05-25T18:48:41.000294Z

well, it would be still be useful actually, so if there’s a way

2018-05-25T18:52:02.000649Z

oh, i'm not sure there's a way to do that. avoid checking

2018-05-25T18:52:27.000086Z

might be possible by manipulating the metadata on task function you make - enough metadata for boot ro recognize it as a task, but not enough for it to want to validate any options

martinklepsch 2018-05-25T19:12:27.000179Z

I don’t think there is but you also shouldn’t have to do this... could you give some context why you want to do this?