build-image icon indicating copy to clipboard operation
build-image copied to clipboard

feat(caching): Cache clojure dependencies

Open mainej opened this issue 3 years ago โ€ข 0 comments

Summary

Fixes #485.

Projects that contain a deps.edn file are compiled by the Clojure CLI. (This is analogous to a Gemfile, which signals that a project is built with ruby.)

This PR speeds up builds of these projects by caching their dependencies. The following directories are now cached:

  • .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 saves 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.

For us to review and ship your PR efficiently, please perform the following steps:

  • [x] Open a bug/issue before writing your code ๐Ÿง‘โ€๐Ÿ’ป. This ensures we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing a typo or something that`s on fire ๐Ÿ”ฅ (e.g. incident related), you can skip this step.
  • [x] Read the contribution guidelines ๐Ÿ“–. This ensures your code follows our style guide and passes our tests.
  • ~Update or add tests (if any source code was changed or added) ๐Ÿงช~
  • ~Update the included software doc (if you updated included software) ๐Ÿ“„~
  • ~Update or add documentation (if features were changed or added) ๐Ÿ“~
  • [ ] Make sure the status checks below are successful โœ…

mainej avatar Aug 26 '22 02:08 mainej