I read the rationale, and I understand that we needed a way to bundle depencies for clj and clojure cli. But in practice, I'm seeing a lot of people move to it, away from boot or lein, and I fail to see what the end goal really is?
Any serious work will need a build tool of some sort.
If you use lein, it comes with its own dependency management and config. Same for boot (as far as I know). So in practice, if I use tools.deps, I've now doubled the number of tools I depend on. I need lein and tools.deps.
For me, it seems the benefit would be around unified dependency config format and maybe reuse of the resolver logic. Like say Lein and Boot and all tools needing to specify dependencies adopted the format of tools.deps. This would be nice, especially for source based dependencies, and dealing with transitive dependencies in such case.
So, is there any hope/work to adopt the format in Lein and Boot? Or what is the end goal otherwise?
Regards
Reading between the lines, I see a sidelining of AOT compilation.
Any serious work will need a build tool of some sort. If you use lein, it comes with its own dependency management and config. Same for boot (as far as I know). So in practice, if I use tools.deps, I've now doubled the number of tools I depend on. I need lein and tools.deps.
At World Singles Networks, we’ve just completed our shift from a complex Boot-based pipeline to just clj/deps.edn and a small shell script to make the invocation simpler. We originally started with Leiningen (back in 2011). We switched to Boot at the end of 2015 (you can read why, and details about our journey, here: http://corfield.org/blog/categories/boot/ ). We still have two small Boot tasks, related to legacy projects, that I will likely convert this week. I’ll write a lengthy blog post (or two or more) about why we made this switch and what pros and cons we encountered, but I’d sum it up as “simplicity”. We are now dependent solely on a small, focused tool that is “standard” with Clojure. For deployment, we still build uberjars (using my fork of depstar that fixes a couple of bugs, and adds “thin” JAR support). We start those JARs with java -cp path/to/the.jar clojure.main -m our.namespace which is pretty much what we were doing with Boot (we used java -jar path/to/the.jar -m our.namespace but switched to the slightly longer form just before we migrated to clj/deps.edn). We use Cognitect’s test-runner, we use Olical’s depot (to track outdated dependencies).
I’ve published JARs to Clojars using just clj -Spom, clj -A:jar (invoking depstar), and mvn deploy:deploy-file (the only thing I actually use Maven for!).
As I’ve worked on various Contrib libraries (that already have pom.xml and use Maven on the CI system), I’ve removed the “convenience” project.clj files that were originally added to make working with those projects easier (e.g., to start an nREPL server, to run tests with multiple versions of Clojure etc) and replaced them with deps.edn files – and by using aliases for different Clojure versions, I can do multi version testing like this: for v in 1.6 1.7 1.8 1.9 master; do clojure -A:test:$v; done
I’ve published my .clojure/deps.edn file on GitHub https://github.com/seancorfield/dot-clojure as an example of tooling integration with a clj-based workflow: starting nREPL servers, running Eastwood, benchmarking, testing, building JAR and uberjar files, even creating new clj-based projects.
If you’re happy with Leiningen or Boot, there’s no reason for you to switch. You can still adopt the new deps.edn format and use https://github.com/RickMoynihan/lein-tools-deps or https://github.com/seancorfield/boot-tools-deps to integrate it, if you wish.
One important caveat to consider right now is that there is no support for Windows for clj/deps.edn projects (I develop on both macOS and Windows 10 – I just use WSL with Ubuntu on the latter – and at work everything is deployed to Linux).
Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood
I guess I see the need for a dependency manager. And I love having a CLI to launch Clojure programs. And I understand it is fundamental. That said, it always felt like Lein had solved that problem long ago. Maybe it wasn't official enough. But Lein could have been bundled with Clojure and effectively solved the same problems and more.
That said, I do prefer the tools.deps abstraction. Just feels a little like reinventing the wheel.
I'll be interested to read your blog posts Sean.
At my work, I can't use tools.deps, because we have an internal dependency manager. And all dependencies are imported and vetted in it first. So I've always wanted a build tool that was decoupled from dependency management. Since tools.deps only outputs a classpath, I assume all these extra tools you mentioned using to build and run your tests and deploy somehow work only given a classpath. They might be useful to me.
Regards
I guess I see the need for a dependency manager. And I love having a CLI to launch Clojure programs. And I understand it is fundamental. That said, it always felt like Lein had solved that problem long ago. Maybe it wasn't official enough. But Lein could have been bundled with Clojure and effectively solved the same problems and more.
Thanks everyone.I guess I see the need for a dependency manager. And I love having a CLI to launch Clojure programs. And I understand it is fundamental. That said, it always felt like Lein had solved that problem long ago. Maybe it wasn't official enough. But Lein could have been bundled with Clojure and effectively solved the same problems and more.
That said, I do prefer the tools.deps abstraction. Just feels a little like reinventing the wheel.
I'll be interested to read your blog posts Sean.
At my work, I can't use tools.deps, because we have an internal dependency manager. And all dependencies are imported and vetted in it first. So I've always wanted a build tool that was decoupled from dependency management. Since tools.deps only outputs a classpath, I assume all these extra tools you mentioned using to build and run your tests and deploy somehow work only given a classpath. They might be useful to me.
Generally those tools are just Clojure programs with a clojure.main. If you can build a classpath from your dependency manager, then invoke the tool, then yes, all those tools are open to you as well (and for packaging as lein plugins or boot tasks too). There is no magic here. It's just running Clojure programs.
I know Rich hopes strongly that the Clojure community is a place where people are free and supported when attempting to creatively solve problems in new ways. Certainly Clojure itself wouldn't exist if the community wasn't willing to try something new and different. Sometimes you have to start over, with a new set of assumptions and constraints and see where it goes.
I guess I see the need for a dependency manager.
I’m curious as to how you define this tool: what exactly do you consider a “dependency manager” to be, and what are it’s specific functions/features? You talk about having an “internal dependency manager” – how do you leverage that from Clojure?
Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood
I’m curious as to how you define this tool: what exactly do you consider a “dependency manager” to be, and what are it’s specific functions/features? You talk about having an “internal dependency manager” – how do you leverage that from Clojure?