dazzling-elephant-33766
03/08/2024, 11:22 AMpython_google_cloud_function using docker.
Previously my working setup was as follows. When building locally (on an M1 Mac), fall back to using a --platform=linux/amd64 docker image.
local_environment(
name="linux",
compatible_platforms=["linux_x86_64"],
fallback_environment="docker",
)
docker_environment(
name="docker",
platform="linux_x86_64",
image="multiply_base",
python_bootstrap_search_path=["<PATH>"],
)
docker_image(
name="multiply_base",
instructions=[
"FROM --platform=linux/amd64 python:3.11-slim",
"RUN apt update && apt install -y gcc libpq-dev",
],
)
the complete_platforms=["//:platforms"] references a file created by doing pex3 interpreter inspect --markers --tags as detailed here: https://docs.pex-tool.org/buildingpex.html#complete-platform
docker run --rm -it multiply_base /bin/bash
pip install pex
pex3 interpreter inspect --markers --tags
python_google_cloud_function(
name="cloud_function",
handler="main.py:example",
type="http",
complete_platforms=["//:platforms"],
environment="docker",
)
Previously (I’ve reverted my version bump and checked), this approach worked fine. But running the same build command on 2.19.1 now fails with
ProcessExecutionFailure: Process 'Build python_google_cloud_function artifact for functions/example:cloud_function' failed with exit code 1.
stdout:
stderr:
A distribution for psycopg2 could not be resolved for /pants-named-caches/python_build_standalone/c12164f0e9228ec20704c1aba97eb31b8e2a482d41943d541cc8e3a9e84f7349/bin/python3.9.
Found 1 distribution for psycopg2 that do not apply:
1.) The wheel tags for psycopg2 2.9.9 are cp311-cp311-linux_x86_64 which do not match the supported tags of /pants-named-caches/python_build_standalone/c12164f0e9228ec20704c1aba97eb31b8e2a482d41943d541cc8e3a9e84f7349/bin/python3.9:
cp39-cp39-manylinux_2_36_x86_64
... 767 more ..
Any ideas?broad-processor-92400
03/08/2024, 7:54 PM[pex-cli] version and known_versions options https://www.pantsbuild.org/2.19/reference/subsystems/pex-cli by downloading the latest artifacts from https://github.com/pex-tool/pex/releases to compute its length and sha256 hashdazzling-elephant-33766
03/08/2024, 8:00 PMbroad-processor-92400
03/08/2024, 8:04 PMincalculable-france-51377
04/01/2024, 3:17 PMincalculable-france-51377
04/01/2024, 3:31 PM[pex-cli]
version = "v2.3.0"
known_versions =[
"v2.3.0|macos_arm64|581f7c2d61b4c24c66ba241f2a37d8f3b552f24ed22543279860f3463ac3db35|4124506",
"v2.3.0|macos_x86_64|581f7c2d61b4c24c66ba241f2a37d8f3b552f24ed22543279860f3463ac3db35|4124506",
"v2.3.0|linux_x86_64|581f7c2d61b4c24c66ba241f2a37d8f3b552f24ed22543279860f3463ac3db35|4124506",
"v2.3.0|linux_arm64|581f7c2d61b4c24c66ba241f2a37d8f3b552f24ed22543279860f3463ac3db35|4124506"
]dazzling-elephant-33766
04/01/2024, 3:38 PMbroad-processor-92400
04/01/2024, 9:28 PM