I am seeing warning message from PEx when using pa...
# general
r
I am seeing warning message from PEx when using pants in our CI/CD platform on AWS using codebuild. Please see the ๐Ÿงต for details
In the CI part, I always run
./pants --version
Copy code
[Container] 2022/01/16 12:15:24 Running command ./pants --version
Bootstrapping Pants using /root/.pyenv/shims/python3.9
Creating the virtualenv PEX.
Downloading the Pex PEX.
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100   640  100   640    0     0   4155      0 --:--:-- --:--:-- --:--:--  4155
100 3529k  100 3529k    0     0  6022k      0 --:--:-- --:--:-- --:--:-- 6022k
SHA256 fingerprint of <https://github.com/pantsbuild/pex/releases/download/v2.1.42/pex|https://github.com/pantsbuild/pex/releases/download/v2.1.42/pex> verified.
/root/.pex/unzipped_pexes/478cc1fa371ca40aa3e7dafee735ca438d4a243f/.deps/pex-2.1.42-py2.py3-none-any.whl/pex/tools/commands/venv.py:141: PEXWarning: Encountered collision building venv at /root/.pex/venvs/short/dc38d0c9 from /root/.pex/pip.pex/46820cb5af0dcf9295a4e7f30184cc0e9fa063dc:
1. /root/.pex/venvs/03b607396193156de8491b3e2ea46ca910e84d78/832e95f85413646e8b7b056ab4e60414f83d7397.47eb3dc96e434261accfbb50af53fcc5/lib/python3.9/site-packages/constraints.txt was provided by:
    /root/.pex/pip.pex/46820cb5af0dcf9295a4e7f30184cc0e9fa063dc/.deps/setuptools/constraints.txt
    /root/.pex/pip.pex/46820cb5af0dcf9295a4e7f30184cc0e9fa063dc/.deps/wheel/constraints.txt
 pex_warnings.warn(message)
h
Do things work other than seeing this warning?
This is Pex warning us that two different requirements embedded in the Pex provide the same file, when flattening the Pex into a Venv.
But in this case that file is just
constraints.txt
, which is not even needed at runtime AFAIK and probably didn't need to be packaged into the dist to begin with
So the warning should be harmless. Would be nice to squelch it though.
cc @enough-analyst-54434 in case I'm misunderstanding something
r
Yeah other than this warning, everything else works.
e
r
I'm actually running pants 2.9.0
e
Ah, right. This is happening in the setup (pants) script: https://github.com/pantsbuild/setup/blob/3ef18abce129b5c07556973b8e19aba4d13336c2/pants#L37 I'll file and fix that.
Tracked in https://github.com/pantsbuild/setup/issues/112. This led to unearthing https://github.com/pantsbuild/setup/issues/111 which is more of the ~same @happy-kitchen-89482 has been fighting. I'll have fixes up for both shortly.
p
FYI, you probably want to cache the
~/.cache/pants/setup
folder so pants doesn't need get downloaded and bootstrapped on every CI run. https://www.pantsbuild.org/docs/using-pants-in-ci#directories-to-cache
๐Ÿ‘ 1
r
Yeah i need to figure out how to integrate the caching in our AWS CI/CD pipeline. It's all bit new for me.
e
Alright @refined-addition-53644 the latest
pants
script can be re-curled and checked in as outlined in https://www.pantsbuild.org/docs/installation and your warnings in CI/CD should go away. Thanks for the report.
๐Ÿ™Œ 1