we have seen a recent occurrence of the "pexrc is ...
# pex
w
we have seen a recent occurrence of the "pexrc is used from pants" issue
having thought more about it, it feels like it is a fairly straightforward hermeticity violation. pants should disable pexrc when using pex, period (and add explicit settings for the kinds of things you'd put in pexrc)
๐Ÿ‘ 1
h
I agree. I donโ€™t think many users use Pexrc
e
Already attempting to be done fwiw:
Copy code
$ git grep RCFILES
src/python/pants/backend/python/rules/hermetic_pex.py:            PEX_IGNORE_RCFILES="true",
src/python/pants/backend/python/tasks/python_execution_task_base.py:        "PEX_IGNORE_RCFILES": "1",
๐Ÿ‘ 1
w
hm. the recent occurrence i saw was in a v2 rule somewhere... @red-balloon-89377 also repro'd
Copy code
./v2 --changed-since=master fmt
Failed to execute PEX file. Needed macosx_10_14_x86_64-cp-37-cp37m compatible dependencies for:
 1: docformatter==1.3.1
    But this pex only contains:
      docformatter-1.3.1-py2-none-any.whl
 2: untokenize==0.1.1
    But this pex only contains:
      untokenize-0.1.1-py2-none-any.whl
)
... the error implies that it is a runtime error, which looks like it should have been affected by the line in
hermetic_pex.py
afaict
e
How did you get from that failure to pexrc?
w
moving aside
/etc/pexrc
resolves the issue
e
OK, and what does pexrc contain?
w
Copy code
$ cat /etc/pexrc
PEX_PYTHON_PATH=/my/custom/python/2.7/bin/python2.7:/my/custom/python/3.6/bin/python3.6:/my/custom/python/3.7/bin/python3.7
PEX_PYTHON=/my/custom/python/2.7/bin/python2.7
e
OK - ty. I'll dig a bit.
w
thanks... i know that this is really on us. but we hadn't seen a repro of this issue for a while, and it only recently started recurring. got lazy.
e
Oh - ok - above is easy. ~All problems in pex require separating runtime from buildtime clearly in your mind (personal reminder). We ignore rcfiles at runtime but not at buildtime. I'll encode this in an issue after I check over where we might miss this in v1 too.
๐Ÿ‘– 2
w
Awesome.
Thanks a ton!
e
You're welcome. It does look you tried to point this out in the past but the case is a but muddled / details a bit lacking: https://github.com/pantsbuild/pants/issues/7816 I'll likely run with that issue and add details there.