`pex_binary()` takes a `platforms` argument, `pyth...
# general
c
pex_binary()
takes a
platforms
argument,
python_awslambda()
does not. Is there a reason for this? 🤔
h
Because this is determined by the
runtime
field, once you select that you have no more degrees of freedom wrt platforms
âž• 1
A pex can be multiplatform, a lambda cannot, in other words
c
If that was correct, then running
./pants package
in different environments would yield identical zip files, no? But that's not the case.
We now resorted to running
./pants package
in Docker containers using the AWS Lambda base image to get a Lambda.zip that works on AWS.
h
If that was correct, then running ./pants package in different environments would yield identical zip files, no?
hm it should be with
python_awslambda
...we set the
--platform
argument which tells Pex to build for just that platform, even if it's foreign to the localhost. You're seeing different behavior it sounds like?
h
Well, the issue with building lambdas on remote platforms is the availability of wheels
if you try to build a lambda on macos, and there is some native code that doesn’t have a wheel anywhere in your transitive deps, then it should fail because you can’t build that native code for the target platform
but if all wheels are available, then
./pants package
should build functionally identical lambdas on macos as on linux
What differences are you seeing?