-
Notifications
You must be signed in to change notification settings - Fork 195
Cache dependencies for clojure projects using Tools.deps.alpha in addition to Leiningen and boot #485
Comments
Are there any known workarounds for the time being? |
The only one I can think off is maintaining a project.clj as well, but that's a bit of a pain |
Actually just looked at the code and seems like it doesn't actually matter what's in the project.clj file, just that it exists. I'll test with an empty project.clj to make sure tomorrow but if that works then it will be easy to check for project.clj or deps.edn as they will both be cached in the same way. I will make a PR when I get around to it if that's the case. |
I think that will work well for most cases. Our build currently eats up ~2.5 mins of downloading deps on every build haha. The one exception is that deps.edn allows for Git deps which are stored in |
A completely empty ( |
I believe this would be fixed by #553. |
@kennyjwilli Good suggestion. 👍 I've added caching of |
Nevermind, it's been merged, there was just an issue in my build script 😂 I reckon this issue can be closed! :) |
@bbarrell this issue shouldn't be closed. It isn't fixed. As I believe you discovered, Netlify does install the However, 485 was opened to address a different problem—build times of Clojure projects are unnecessarily slow, because (Note... what follows is addressed to Netlify, not you.) Because of this and other bugs, it can be hard to build Clojure projects on Netlify. Netlify isn't paying attention to these issues, nor have they offered guidance or workarounds. It's a shame because I would really like Netlify to be an easy place to deploy Clojure projects. As you can see below, I and several other people have tried reporting issues, creating PRs, or looking for other solutions, but we've gotten very little response. By my accounting there are two important outstanding bugs related to Clojure:
I tried to write a "build plugin"—Netlify's mechanism for extending the build process—to work around the caching issue, but was never able to get Anyway, if you've gotten your project to build @bbarrell, nice! It is possible. Cross your fingers that it keeps working! |
This speeds up builds that use the [Clojure CLI][clojure-cli] by avoiding network calls to download dependencies. When a repo has a `deps.edn` file, we assume it is a Clojure repo. We cache its dependencies by caching the following files: * `.m2` As a JVM language, most Clojure dependencies are stored in the global `.m2` directory. * `.gitlibs` The Clojure CLI can also download dependencies directly from git repositories rather than from a package manager. It caches these downloads in the `.gitlibs` directory. * `.cpcache` Clojure uses the `.cpcache` directory to avoid unnecessarily re-calculating the JVM classpath. Caching this directory won't prevent downloads, but does improve build time slightly. Fixes netlify#485. [clojure-cli]: https://clojure.org/reference/deps_and_cli
Fixes netlify#485. This speeds up builds that use the [Clojure CLI][clojure-cli] by avoiding network calls to download dependencies. When a repo has a `deps.edn` file, we assume it is a Clojure repo. We cache its dependencies by caching the following files: * `.m2` As a JVM language, most Clojure dependencies are stored in the global `.m2` directory. * `.gitlibs` The Clojure CLI can also download dependencies directly from git repositories rather than from a package manager. It caches these downloads in the `.gitlibs` directory. * `.cpcache` Clojure uses the `.cpcache` directory to avoid unnecessarily re-calculating the JVM classpath. Caching this directory won't prevent downloads, but does improve build time slightly. [clojure-cli]: https://clojure.org/reference/deps_and_cli
The caching fix in #553 was closed because it wasn't for #484 has also been closed, for the same reason. It could technically be re-opened against |
Currently Netlify will only cache dependencies in Clojure projects if there is a valid
project.clj
orbuild.boot
file, which are used by the Leiningen and Boot build tools.However Clojure now has an official API for dependency management and uses a
deps.edn
file rather than theproject.clj
orbuild.boot
files used in older build tools.It makes sense to add support for
deps.edn
files as this is the official way to manage dependencies in Clojure now.Relevant PR https://github.com/netlify/build-image/pull/117/files
The text was updated successfully, but these errors were encountered: