fast-xylophone-56613
07/04/2025, 10:25 AM[ERROR] 1 Exception encountered:
Engine traceback:
in `package` goal
ProcessExecutionFailure: Process 'Building 1 requirement for pant.pex from the python.lock resolve: mysqlclient<3.0,>=2.2' failed with exit code 1.
stdout:
stderr:
No pre-built wheel was available for mysqlclient 2.2.7.
Successfully built the wheel mysqlclient-2.2.7-cp311-cp311-linux_aarch64.whl from the sdist mysqlclient-2.2.7.tar.gz but it is not compatible with the requested foreign target complete platform cp312-cp312-manylinux_2_39_aarch64.
You'll need to build a wheel from mysqlclient-2.2.7.tar.gz on the foreign target platform and make it available to Pex via a `--find-links` repo or a custom `--index`.
So you can see that Pants is compiling this against Python 3.11 instead of 3.12. This is on Ubuntu 24.04, where the system Python version is 3.12. It seems that Pants itself is running on a 3.11 venv and it is incorrectly using this as the basis for building the mysqlclient wheel instead of the system python.
Is there any way to workaround this? Or will we just have to wait until Pants gets a Python upgrade?happy-kitchen-89482
07/07/2025, 1:11 AMfast-xylophone-56613
07/07/2025, 8:45 AMinterpreter_constraints = ['>=3.12,<3.13']
fast-xylophone-56613
07/07/2025, 8:46 AMwhich python3
points to /usr/bin/python3
, and python3 --version
confirms that this is v3.12.3fast-xylophone-56613
07/07/2025, 8:47 AMsearch_path
so it will be using the default, which according to the docs should be ["python", "python3"]
. There is no python
bin on my PATHfast-xylophone-56613
07/07/2025, 8:54 AMfast-xylophone-56613
07/07/2025, 8:54 AMfast-xylophone-56613
07/07/2025, 8:55 AMcurved-manchester-66006
07/07/2025, 2:13 PMfast-xylophone-56613
07/07/2025, 2:37 PM--resolve-local-platforms
? That's not a CLI option is it?fast-xylophone-56613
07/07/2025, 2:39 PMpants package
?curved-manchester-66006
07/07/2025, 3:29 PMOr is the takeaway here that we should build the mysqlclient wheel outside of Pants first as a separate process, then copy it in for pants package?Yeah; as a practical matter if you support multiple os/arch (say you have programmers who use macs and you deploy on linux) it is usually much easier -- admittedly with some annoying startup overhead -- to pre-build the wheels you need than to configure everyone's workstation to be able to cross-compile
fast-xylophone-56613
07/07/2025, 3:30 PMfast-xylophone-56613
07/07/2025, 3:32 PMfast-xylophone-56613
07/07/2025, 3:32 PMhappy-kitchen-89482
07/07/2025, 4:04 PMfast-xylophone-56613
07/07/2025, 4:06 PMhappy-kitchen-89482
07/07/2025, 4:07 PMhappy-kitchen-89482
07/07/2025, 4:07 PMfast-xylophone-56613
07/07/2025, 4:08 PMfast-xylophone-56613
07/07/2025, 4:09 PMhappy-kitchen-89482
07/07/2025, 4:14 PM--resolve-local-platforms
to extra_build_args
on your pex_binary
target?fast-xylophone-56613
07/07/2025, 4:20 PMhappy-kitchen-89482
07/07/2025, 11:39 PM