high-yak-85899
09/29/2022, 11:56 PM.cache/pants/setup
. https://www.pantsbuild.org/docs/using-pants-in-ci recommends a simple script for nuking cache directories when too large. It recommends pants/setup
as one of the directories to monitor. When we do that for our builds when they kick off, we start seeing errors like this
/home/buildbot/.cache/pants/setup/bootstrap-Linux-x86_64/2.13.0_py38/bin/python: No such file or directory
Any recommendations on what to do?enough-analyst-54434
09/30/2022, 2:31 PM$ ls -l ~/.cache/pants/setup/bootstrap-Linux-x86_64/
total 24
lrwxrwxrwx 1 jsirois jsirois 76 Sep 19 19:32 2.12.0_py39 -> /home/jsirois/.cache/pants/setup/bootstrap-Linux-x86_64/pants.UJYLSt/install
lrwxrwxrwx 1 jsirois jsirois 76 Sep 26 10:16 2.13.0_py39 -> /home/jsirois/.cache/pants/setup/bootstrap-Linux-x86_64/pants.1tUIeV/install
drwx------ 3 jsirois jsirois 4096 Sep 26 10:16 pants.1tUIeV
drwx------ 3 jsirois jsirois 4096 Sep 19 19:32 pants.UJYLSt
drwxr-xr-x 2 jsirois jsirois 4096 Sep 19 19:32 pex-2.1.62
drwxr-xr-x 2 jsirois jsirois 4096 Sep 19 19:32 virtualenv-20.4.7
So, <Pants version>_py<Python version> -> <tmpdir>/install
If your nuking is partial, i.e. symlinks aren't nuked, the error you describe could happen.
Further, picking one of those Pants installs:
$ ls -l ~/.cache/pants/setup/bootstrap-Linux-x86_64/2.13.0_py39/bin/ | grep python
lrwxrwxrwx 1 jsirois jsirois 50 Sep 26 10:16 python -> /home/jsirois/.pyenv/versions/3.9.14/bin/python3.9
lrwxrwxrwx 1 jsirois jsirois 6 Sep 26 10:16 python3 -> python
lrwxrwxrwx 1 jsirois jsirois 6 Sep 26 10:16 python3.9 -> python
Here the python -> <underlying Python venv was created from>
.
If the underlying Python goes away, again you could see the error you posted.