important-librarian-62877
08/05/2020, 10:43 PMDirectories to cache
In your CI's config file, we recommend caching these directories:
$HOME/.cache/pants/setup: the initial bootstrapping of Pants.
$HOME/.cache/pants/named_caches: caches of tools like pip and PEX.
$HOME/.cache/pants/lmdb_store: cached content for prior Pants runs.
version 1.26 does not appear in the list of versions on the docs. Does the above statement still hold true for 1.26?hundreds-father-404
08/05/2020, 10:46 PM$HOME/.cache/pants/setup
You can leave off $HOME/.cache/pants/named_caches
because that was an optimization we added in 1.29 iirc
The rest depends on if you’re using v1 or v2important-librarian-62877
08/05/2020, 10:46 PMsetup
?happy-kitchen-89482
08/05/2020, 10:50 PM.pants.d
directory under the repo root will capture all post-setup state for reuse in the next run, so it'll be as if you re-ran Pants from the state at the end of the previous run. You may want to periodically clean that up if it gets too large (but that's true for any CI caching).hundreds-father-404
08/05/2020, 10:51 PMThere is also a plugins directoryAh yes, that’s good to cache too if y’all are using plugins. You can leave off the
lmdb_store
folder.happy-kitchen-89482
08/05/2020, 10:51 PM$HOME/.cache/pants
, possibly without lmdb_store
is a good idea.important-librarian-62877
08/05/2020, 10:56 PM.pants.d
directory around, but I found that our tests fail to find a library that is built by a plugin when running from the cache. I was able to reproduce the issue by removing the ~/.pex
, ~/.cache
, and ~/.npm
directories, so the file is somewhere in there (I'm assuming the .cache
directory). I should also note we run our pants build in a container, so maybe the thing to do is just mount the home directory so we keep all those extra files.happy-kitchen-89482
08/05/2020, 11:41 PMimportant-librarian-62877
08/05/2020, 11:42 PMhappy-kitchen-89482
08/05/2020, 11:43 PMimportant-librarian-62877
08/06/2020, 12:38 AM