https://pantsbuild.org/ logo
#general
Title
# general
p

powerful-florist-1807

05/20/2021, 7:55 AM
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

happy-kitchen-89482

05/20/2021, 2:18 PM
I don't think it is known, thanks for reporting. Does this reproduces in any consistent way that we can use to debug?
p

powerful-florist-1807

05/20/2021, 4:25 PM
No it doesn't repro consistently.
h

happy-kitchen-89482

05/20/2021, 5:00 PM
And this happens when you run
./pants package
on a
pex_binary
target, for example?
p

powerful-florist-1807

05/20/2021, 5:18 PM
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

hundreds-father-404

05/20/2021, 10:17 PM
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

powerful-florist-1807

05/20/2021, 10:23 PM
I am use pex a first-class citizen virtual env
h

hundreds-father-404

05/20/2021, 10:24 PM
I don't totally follow - do you have something like
import pex
in your project's code?
p

powerful-florist-1807

05/20/2021, 10:28 PM
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
3 Views