I hate to beat a dead horse but I just tried out P...
# general
s
I hate to beat a dead horse but I just tried out Pants 2.19.1 and was a little bummed to see
#!/home/yjabri/.cache/nce/29319df9a6ca02e838617675b5b8dd7e5b18a393c27e74979823158b85c015d9/bindings/venvs/2.19.1/bin/python3.9 -sE
when I run
cat bin/pants
in the created
venv
which is 131 characters long meaning linux is going to cut off the
-sE
making Pants run with all my env vars which makes pantsd invalidate on any code change. This has been fixed in Pex for some time now but hasn't been incorporated into Pants Note I have
Copy code
[pex-cli]
version = "v2.1.161"
known_versions =[
    'v2.1.161|macos_arm64|5bb08a677d309889b3357cd23a3a95945a4c3438cfb00ece5291dcfe89221fcc|3675619',
    'v2.1.161|macos_x86_64|5bb08a677d309889b3357cd23a3a95945a4c3438cfb00ece5291dcfe89221fcc|3675619',
    'v2.1.161|linux_x86_64|5bb08a677d309889b3357cd23a3a95945a4c3438cfb00ece5291dcfe89221fcc|3675619',
    'v2.1.161|linux_arm64|5bb08a677d309889b3357cd23a3a95945a4c3438cfb00ece5291dcfe89221fcc|3675619',
]
In my
pants.toml
which doesn't solve the above problem* Edit - This issue appears to be caused by using an older version of pex to generate the pants.pex file that gets released. Ultimately its fixed in the 2.20 releases so this isn't a big deal. A bunch of my coworkers unfortunately have the SHEBANG cut in other places leading to
Exec format error
errors.
Fwiw the release
2.20.0rc0
fixes this as I get
Copy code
#!/bin/sh
# N.B.: This python script executes via a /bin/sh re-exec as a hack to work around a
# potential maximum shebang length of 128 bytes on this system which
# the python interpreter `exec`ed below would violate.
''''exec /home/yjabri/.cache/nce/29319df9a6ca02e838617675b5b8dd7e5b18a393c27e74979823158b85c015d9/bindings/venvs/2.20.0rc0/bin/python3.9 -sE "$0" "$@"
'''
I'll wait for 2.20. Hopefully one day I can maybe help contribute a fix rather than just complain about it 😛
Sorry if the tone of these comments are whinny / entitled. I think a fix would involve backporting the update to pex so that when
./pants package src/python/pants:pants-pex
runs during a release it creates the shebang with the new format. It seems like this isn't worth the effort given 2.20 is around the corner
h
Well, it may be worth fixing in 2.19 at least
an issue would be welcome
s
👀 1
🙏 1