cool-easter-32542
03/15/2023, 12:55 AM--export-symlink-python-virtualenv
option in 2.15.0 and got some interesting results. I had messed up the symlinked venv so I was working on getting back to a known state. In the code block below, you can see I deleted the entire pants cache and had the symlinked export symlink to a venv that didn't exist.
~/devel/monorepo (move-dev-reqs)$ rm -rf ~/.cache/pants/
~/devel/monorepo (move-dev-reqs)$ ./pants export --export-symlink-python-virtualenv --resolve=python-default
Bootstrapping Pants using /usr/bin/python3.9
Creating the virtualenv PEX.
Downloading the Pex PEX.
SHA256 fingerprint of <https://github.com/pantsbuild/pex/releases/download/v2.1.103/pex> verified.
Installing pantsbuild.pants==2.15.0 into a virtual environment at /home/nathanael/.cache/pants/setup/bootstrap-Linux-x86_64/2.15.0_py39
New virtual environment successfully created at /home/nathanael/.cache/pants/setup/bootstrap-Linux-x86_64/2.15.0_py39.
Wrote symlink to immutable virtualenv for python-default (using Python 3.8.10) to dist/export/python/virtualenvs/python-default
~/devel/monorepo (move-dev-reqs)$ ls dist/export/python/virtualenvs/python-default/
3.8.10
~/devel/monorepo (move-dev-reqs)$ ls -lh dist/export/python/virtualenvs/python-default/3.8.10
lrwxrwxrwx 1 nathanael nathanael 138 Mar 14 18:47 dist/export/python/virtualenvs/python-default/3.8.10 -> /home/nathanael/.cache/pants/named_caches/pex_root/venvs/c978a68158a371b508ccdfb785cf9438c7adcf3b/ddab8011daaee380698ac2fb9701af18c90c03f6
~/devel/monorepo (move-dev-reqs)$ ls ~/.cache/pants/named_caches/
ls: cannot access '/home/nathanael/.cache/pants/named_caches/': No such file or directory
This is problematic since I was expecting the export to fix things. Using --no-local-cache
sets up a venv properly, but without that flag, it falls back to the non-existent directory.
Pants version
2.15.0
OS
Ubuntu 20.04
pantsbuild/pantscool-easter-32542
03/24/2023, 4:48 PM