Fork me on GitHub
#tools-deps
<
2022-06-09
>
Drew Verlee21:06:16

Has anyone written an experience report covering a switch from boot to deps and tools build? I know it will be quite specific but it still might help. I read sean corfield's blog post where he mentions the change. It was useful, I'm just looking for more.

seancorfield22:06:12

Happy to discuss that change in more detail. I don't think many Boot users existed, let alone have made the switch (compared to the larger Clojure community).

seancorfield22:06:59

I think an important first step for anyone contemplating such a migration is to externalize their dependencies. Long before t.d.a was a thing, we'd decided to put our dependencies into EDN files, which our Boot tasks read in. We found that easier than digging around inside build.boot files, and it also allowed for us to have a single build.boot file and pick up different dependencies from different subprojects, based on the arguments passed in. @U0DJ4T5U1

Drew Verlee22:06:04

Thanks sean. The first step i have is to pull the dependencies from boot into a deps.edn file, so it's good to hear that's where other people went as well.

Drew Verlee22:06:19

@U04V70XH6 Like i said yesterday, my first step is to move the dependencies from boot into a deps.edn file. I went ahead and did that. I take it you, like i just did, wrote some clojure functions to convert between the two formats (deps->boot & boot->edn)? Are those lying around anywhere? Those or any other helpful pieces of functionality you used along the way to convert would be much appreciated.

Drew Verlee22:06:28

Though i'm guessing from there it will be better to just convert to boot file to deps manually... to much past that point will be different and it's not that big 🙂.

seancorfield22:06:11

The only code you need in your build.boot file is to read the new deps.edn, parse it as EDN, lift the dependencies out and tell Boot about them.

seancorfield22:06:47

I can't remember how you do that with Boot (it's been 3 1/2 years) but ISTR it's pretty straightforward to just add deps programmatically?

seancorfield22:06:55

It doesn't need to round-trip. You create the deps.edn files once from whatever you had in Boot (this was a one-off, manual process for us), and then your Boot script uses those while you gradually rewrite the rest to deps.edn aliases and build.clj etc.

seancorfield22:06:41

I guess we might still have this somewhere in our repo's history but there have been thousands of commits since then 🙂

Drew Verlee22:06:21

Yeah. I just did the one off boot to deps transfer using clojure. I'm glad to hear there weren't any hiccups when you did it.

seancorfield22:06:00

It'll depend on how complex your build script is and whether you do fancy stuff with dependencies and paths etc... Ours was fairly complex, and I think it took me a couple of days, over the year-end holiday, to get it converted and all working properly for my team mates to come back to in early January 🙂

seancorfield22:06:24

I did our lein to boot migration the same way -- when everyone else was out of the office for a few days.

👀 1