Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: does it make sense to merge lein and tools.deps images? #224

Open
alexander-yakushev opened this issue Apr 19, 2024 · 6 comments

Comments

@alexander-yakushev
Copy link
Contributor

Given that the image size is absolutely dominated by JDK (~300 Mb uncompressed), would it be reasonable to ship both Leiningen (~15 Mb uncompressed) and tools.deps (around the same but also needs Git installed) in the single image, kinda like what is done for latest? There are a couple of projects that use both on CI and such projects could benefit from such a change. Are there any drawbacks apart from increased image size?

@cap10morgan
Copy link
Collaborator

Hmm... I could see that making sense; especially if we stop shipping the boot variants soon (which I think we should). The full version tags would get a bit unwieldy... E.g. clojure:temurin-21-lein-2.11.0-tools-deps-1.11.2.1435. But we could also push tags that only specify their lein version or their tools-deps version (but they would all still include both tools) for those who only use one or the other.

What a mess we've got in our tooling these days. Sigh. 😉

What do you think, @Quantisan?

@cap10morgan
Copy link
Collaborator

Posted it to the #docker channel in Clojurians Slack to see what folks think in there: https://clojurians.slack.com/archives/C0PME9N9X/p1713539776559319

@alexander-yakushev
Copy link
Contributor Author

But we could also push tags that only specify their lein version or their tools-deps version (but they would all still include both tools) for those who only use one or the other.

I like this idea!

Regarding boot: it makes sense dropping it since the old images will still exists, and whoever keeps using it can always build their own images.

@Quantisan
Copy link
Owner

Quantisan commented Apr 22, 2024

tl;dr; I don't see any problem.

Speaking out loud my initial worry that turns out to be moot. My first concern would be potential conflict for dependencies. But this is about building an image and not using them in the same JDK project. i.e. like most people, I have both tools installed on my machine too. And it's fine. So I guess it's ok in an image too.

For the record, I had a look at the dependencies.

https://github.com/clojure/tools.deps/blob/master/deps.edn

versus

https://github.com/technomancy/leiningen/blob/github/project.clj -> https://github.com/technomancy/leiningen/blob/github/leiningen-core/project.clj ->
https://github.com/clj-commons/pomegranate/blob/master/deps.edn

I see these dependency conflicts:

-org.clojure/data.xml: Lein uses version 0.2.0-alpha6, while the Deps project uses version 0.2.0-alpha9
-org.apache.maven/maven-resolver-provider: Lein is on 3.8.7, while Deps is at 3.8.8

  • a bunch of overlaps related to org.apache.maven.resolver/*
  • Deps excludes com.google.guava/guava from org.apache.maven/maven-core, but Lein doesn't manage this dependency

Again, this only matters if you use both in your Clojure project.

@alexander-yakushev
Copy link
Contributor Author

Another issue: tools-deps and Leiningen have different CMDs (lein repl and clj) and different entrypoints. If the images are merged into one, then we'll have to settle on a single entrypoint, and that would be compatibility-breaking.

The possible solution is to still have both in all images, but have -lein variants with Leiningen entrypoints and -tools-deps (and default) variants with tools.deps entrypoints.

@cap10morgan
Copy link
Collaborator

Another issue: tools-deps and Leiningen have different CMDs (lein repl and clj) and different entrypoints. If the images are merged into one, then we'll have to settle on a single entrypoint, and that would be compatibility-breaking.

The possible solution is to still have both in all images, but have -lein variants with Leiningen entrypoints and -tools-deps (and default) variants with tools.deps entrypoints.

Yeah I think we should vary it based on the tag we're building. And for tags that include both (incl. latest), let's use the tools.deps entrypoint (as the first party option).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants