In the docs online, the following is stated for CI...
# general
i
In the docs online, the following is stated for CI:
Copy code
Directories 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?
h
Hey Connor! It depends if you’re using the v1 or v2 Python backend You’ll always want to cache
$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 v2
i
We are still using the v1 backend
There is also a plugins directory in the cache, is that something that should also be preserved or would that be rebuilt from the info in
setup
?
h
You'll benefit from preserving that, IIRC
Generally caching the
.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).
h
There is also a plugins directory
Ah yes, that’s good to cache too if y’all are using plugins. You can leave off the
lmdb_store
folder.
h
As for setup state, then caching
$HOME/.cache/pants
, possibly without
lmdb_store
is a good idea.
i
Ok, I will keep those those around then. @happy-kitchen-89482 We currently keep the
.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.
h
This is a custom plugin?
i
It is indeed
h
Ah, then it might be doing something unexpected I guess, wrt where it stores things. In v1 that was very possible. In v2, not.
Hard to know without seeing its source code.
i
Ok, the issue is slightly different than what I originally thought. I'll open a ticket.