silly-queen-7197
08/03/2023, 6:38 PMmain
branch (which works!) and broken
branch (which doesn't). The example illustrates building a pex, copying it into docker, and then transforming it into a venv with pex tools.
Since we deploy our docker images to an x86 linux environment I set DOCKER_DEFAULT_PLATFORM=linux/amd64
. If I set up a linux_x86
local linux environment with a fallback to docker this works as expected and my setup is illustrated in the main branch.
The drawback is that in this setup, the pex cli.pex
can't be ran on an M1 (or any mac). My attempt to solve this was to create a any
local environment (which accepts m1, x86 mac, and x86 linux) and then parametrize the environment field of the pex to parametrize("any", "linux_x86")
but this doesn't work. I included the logs of pants package ::
in the branch as logs.txt
. In short it says that the sqlalchemy tag cp310-cp310-manylinux_2_28_aarch64
isn't compatible with things like cp310-cp310-manylinux_2_17_x86_64
To me this is unexpected because I would have thought that the pex would be built in docker and work as it does on the main branch. I guess "implict" matching is probably the root cause but its odd that I can't overwrite it.
Even if this worked, it wouldn't be ideal as now CI has to build extra PEXs but I think this tradeoff might be ok. However it makes me think I'm approaching this problem wrong.
To reiterate what I'm trying to accomplish - I'd like to be able to create PEXs that work on any developer's machine but to also ensure we can build x86 docker images correctly (on mac docker emulation takes care of the rest)