Hi there, it seems pants has stability issues. For...
# general
p
Hi there, it seems pants has stability issues. For example, when I build a PEX file I sometimes see errors such as " "/Users/mingshiwang/.cache/pants/named_caches/pex_root/unzipped_pexes/478cc1fa371ca40aa3e7dafee735ca438d4a243f/.deps/pex-2.1.42-py2.py3-none-any.whl/pex/pex_info.py", line 10, in <module> from pex import pex_warnings, variables ImportError: cannot import name variables". But when I rerun the command the error goes away. Is this a known issue?
h
I don't think it is known, thanks for reporting. Does this reproduces in any consistent way that we can use to debug?
p
No it doesn't repro consistently.
h
And this happens when you run
./pants package
on a
pex_binary
target, for example?
p
Yes, it repros when I run ./pack package .... I currently don't have a repo but let me send you the example cmd and full error log again if I have them.
🙌 1
I found it very helpful to 1. always clean up the virtual env (build-support/.venv) when generating the constraints file, and 2. run "./pants tailor". I no longer see the error when doing steps 1 & 2 before building a new PEX file.
👀 1
h
That's fishy,
build-support/.venv
should be irrelevant to this Same with
./pants tailor
- we would expect that to fix errors like missing modules, but not this. Oh to double check something - are you using Pex as 3rd party library in your project? I want to confirm this is from Pants's internal usage of Pex, rather than your own direct usage of Pex
p
I am use pex a first-class citizen virtual env
h
I don't totally follow - do you have something like
import pex
in your project's code?
p
Not like importing pex files. We use pants to build PEX files bundled with the necessary dependencies for people to test their code locally. One example is to test airflow dags locally.
Of course, we use pants for building and publishing packages as well