Hello all! I have a problem when trying to cache `...
# general
c
Hello all! I have a problem when trying to cache
named_caches
in my GitLab CI pipeline. Following the Pants docs I changed its location to my build root (as GitLab CI can cache only files inside it) and configured the cache to be shared between jobs, basing on the lockfiles state. However, when a job pulls the cache and Pants tries to use it I get the following error:
Copy code
IntrinsicError: While expanding link ".named_caches/pex_root/venvs/7fd29932d86a744f8a544214470ad8d101a53805/c2ed0c93430ac21d01dc98f1671221ce556732af/bin/python": Failed to read link "/builds/<repo_name>/.named_caches/pex_root/venvs/7fd29932d86a744f8a544214470ad8d101a53805/c2ed0c93430ac21d01dc98f1671221ce556732af/bin/python3.10": Absolute symlink: "/usr/local/python/3.10.15/bin/python3.10"
Does anybody know what could be the reason? I found a question on StackOverflow with a similar error message but unfortunately nobody answered it: https://stackoverflow.com/questions/78822680/pants-build-system-failed-to-read-link-to-python-in-venv. Thanks in advance!
b
Those errors come from inside the Pants codebase: https://github.com/pantsbuild/pants/blob/8c420c90ad7ff4f189ff40e1f64c054b893694de/src/rust/engine/fs/src/glob_matching.rs#L757 https://github.com/pantsbuild/pants/blob/8c420c90ad7ff4f189ff40e1f64c054b893694de/src/rust/engine/fs/src/lib.rs#L520 https://github.com/pantsbuild/pants/blob/8c420c90ad7ff4f189ff40e1f64c054b893694de/src/rust/engine/fs/src/lib.rs#L504-L507 That last one is the root error, because it looks like Pants doesn’t support absolute symlinks. You may have to do some work to figure out why that symlink is absolute and whether you can make it relative instead.
f
Have you added the cache directory to
pants_ignore
config? That way, Pants won't try to monitor it for changes like it would source files.