Installing Python fails on new Ubuntu 24.04 images
Checklist
- I've looked through the issues and pull requests for similar reports
Describe your issue
In Spotifyd, where the old cross-rs base images were a blocker for riscv64 builds, I did now test the new images after #1779 was merged.
It depends on libpulse-dev, which depends on libglib2.0-dev, which depends on python3 on Ubuntu 24.04. Annoyingly, this python3 dependency does not exist in any stable Debian, but changelog reveals it was added and removed again between Debian Bookworm and Trixie. Hence Ubuntu 24.04 just had a bad timing freezing its package state against Debian .
The python3.12-minimal package's postinst calls the /usr/bin/python3.12 executable (to pre-compile *.pyc files), which of course cannot work for any non-native packages.
Spotifyd installs dependencies via:
[build]
pre-build = [
"dpkg --add-architecture $CROSS_DEB_ARCH",
...
"apt-get install -y libpulse-dev:$CROSS_DEB_ARCH",
]And the pre-build commands run on the host container, outside of the qemu-user or qemu-system runner, hence things fail before the actual build starts.
How can such dependency install steps be done within the runner?
And since installing DEB package dependencies is the explicit example about how to use the pre-build config vice versa, and Python is quite a common package dependency, does someone have an idea how to hack and fix this? Attempting to pre-install Python, or python3.12-minimal at least, would cause the same failures in the image builds.
- A two stage installation could hack the
postinstscript to remove the/usr/bin/python3.12calls, or temporarily replace the command with a dummy, beforedpkg --configure -a. The*.pycfiles will be missing, but any next invocation with root should compile them on demand? - Of course it can be done via
qemu-user. Since it is installed anyway on these cross images, wouldn't it make sense to setup binfmt for the target architecture OOTB?
What target(s) are you cross-compiling for?
No response
Which operating system is the host (e.g computer cross is on) running?
- macOS
- Windows
- Linux / BSD
- other OS (specify in description)
What architecture is the host?
- x86_64 / AMD64
- arm32
- arm64 (including Mac M1)
What container engine is cross using?
- docker
- podman
- other container engine (specify in description)
cross version
cross 0.2.5 (64b5bb4 2026-07-01)
Example
No response
Additional information / notes
No response
Source: cross-rs/cross