Fork me on GitHub
#boot
<
2018-05-25
>
mariuene12:05:27

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

martinklepsch19:05:27

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?

mariuene12:05:57

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.

mariuene12:05:53

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

martinklepsch12:05:55

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

martinklepsch12:05:08

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?

mariuene13:05:19

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.

martinklepsch22:05:22

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

mariuene12:05:16

I can try tomorrow.

mariuene09:05:45

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

martinklepsch09:05:36

oh, that’s long 😮

mariuene09:05:27

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

mariuene09:05:03

but running again after took only 2 minutes.

borkdude17:05:22

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?

dave18:05:16

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

dave18:05:49

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

borkdude18:05:16

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

borkdude18:05:35

e.g. this works:

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

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

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

dave18:05:30

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

borkdude18:05:58

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?

alandipert18:05:31

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

alandipert18:05:31

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

borkdude18:05:06

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

alandipert18:05:13

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

borkdude18:05:00

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

borkdude18:05:19

without A checking them

borkdude18:05:27

so I don’t have to redefine the options

borkdude18:05:49

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

borkdude18:05:06

so never mind 🙂

borkdude18:05:41

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

alandipert18:05:02

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

alandipert18:05:27

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