refined-addition-53644
11/17/2022, 4:09 PMERROR [deps 4/4] RUN PEX_TOOLS=1 /usr/local/bin/python3.9 ./infra_plan_batch_job.pex venv --scope=deps --compile ./infra_plan_batch_job
------
> [deps 4/4] RUN PEX_TOOLS=1 /usr/local/bin/python3.9 ./infra_plan_batch_job.pex venv --scope=deps --compile ./infra_plan_batch_job:
#19 33.66 received exit code 1 during execution of `['/usr/local/bin/python3.9', '-s', '-E', '-m', 'compileall', './infra_plan_batch_job']` while trying to execute `['/usr/local/bin/python3.9', '-s', '-E', '-m', 'compileall', './infra_plan_batch_job']`
------
executor failed running [/bin/sh -c PEX_TOOLS=1 /usr/local/bin/python3.9 ./infra_plan_batch_job.pex venv --scope=deps --compile ./infra_plan_batch_job]: exit code: 1
It’s inspired from this
https://pex.readthedocs.io/en/latest/recipes.html#pex-app-in-a-container./pants package src/package-a/package_a:pex_package_a
mkdir pex-deps-compiled
PEX_TOOLS=1 /usr/local/bin/python3.9 dist/src.package-a.package_a/pex_package_a.pex venv --scope=deps --compile ./pex-deps-compiled
enough-analyst-54434
12/01/2022, 3:58 PM$ pex-deps-compiled/bin/python -mcompileall pex-deps-compiled 2>&1 | grep -C5 SyntaxError
Compiling 'pex-deps-compiled/lib/python3.9/site-packages/aenum/__init__.py'...
Compiling 'pex-deps-compiled/lib/python3.9/site-packages/aenum/_py2.py'...
*** File "pex-deps-compiled/lib/python3.9/site-packages/aenum/_py2.py", line 5
raise exc, None, tb
^
SyntaxError: invalid syntax
Compiling 'pex-deps-compiled/lib/python3.9/site-packages/aenum/_py3.py'...
Listing 'pex-deps-compiled/lib/python3.9/site-packages/aenum/doc'...
Compiling 'pex-deps-compiled/lib/python3.9/site-packages/aenum/test.py'...
Compiling 'pex-deps-compiled/lib/python3.9/site-packages/aenum/test_v3.py'...
So, yeah. That suggests the `--compile`option probably ought to both emit stderr on failure but also probably not fail. That aenum/_py2.py
file is presumably only loaded by `aenum`when running under Python 2 already.refined-addition-53644
12/01/2022, 4:06 PMenough-analyst-54434
12/01/2022, 4:10 PMrefined-addition-53644
12/01/2022, 4:13 PMpex_binary
with these options
layout = "packed",
execution_mode = "venv",
I thought this leads to unzipped PEX, right?enough-analyst-54434
12/01/2022, 4:15 PMpacked.pex/
.bootstrap # <- normally a zip directory with lots of files in it, now a zip file
.deps/
dependency1.whl # <- normally a zip directory with lots of files in it, now a zip file
...
PEX-INFO
__main__.py
<your loose code>
refined-addition-53644
12/01/2022, 4:15 PMenough-analyst-54434
12/01/2022, 4:18 PM--layout
) or else raw venvs in Pants' LMDB if it had no performance impact. That would be much simpler.