May be more of a pex question, but any idea why if...
# general
b
May be more of a pex question, but any idea why if I try to run pex --compile locally after a pants package of a pex_binary, what I see in the venv makes sense, but when I try to run it in a
docker_image
, packages are missing?
b
@brief-engine-92399 can you tighten this all up with some real command lines and output? What is
pex --compile
? The
--compile
flag to
pex
just has it pre-compile
.pyc
files which shouldn't have anything to do with import errors or missing packages.
b
So it was a false alarm. I was pointing to a pex in a different pants dependency than the one I intended to use in the
docker_image
instructions. I was making a venv out of that one. Unsure where it got picked up though. Feels like some cache I didnt know about got used somewhere.
b
Ok. I still have no clue what you're talking about, but happy you're fixed up. If you report Pex issues I like details. Lots.
✅ 1
b
Though for context, the command I was using to test outside of pants was
Copy code
PEX_TOOLS=1 python  dist/module_path/target.pex venv --scope=deps --compile /path/to/venv
In the docker image instructions I was essentially running
Copy code
PEX_TOOLS=1 python  dist/module_path/different_target.pex venv --scope=deps --compile /path/to/venv
Even though different_target wasn't in the list of deps for the docker_image rule
b
I still have no clue. That said, re "missing packages" and local vs docker, keep mind any platform specific deps in a PEX will only extract for a matching platform. So, unless your local host == the docker platform, expect one of the two to fail.
b
But yea. This isn't a pex issue.
In this case local host == the docker platform 🙂
b
K
b
Not working on cross-platform builds today thankfully
Where's the best place to ask pex questions while I have your attention? I have a question around
--collisions-ok
b
But there is a #C087V4P1T channel here too.