Closed srwi closed 1 month ago
Can someone explain how this worked in 22.04?
I do see in my previous passing runs there was a message Defaulting to user installation because normal site-packages is not writeable
. But I don't understand how the exact installed python version factors into that logic...
As I understand it, github actions shipped a change that the default Python is now a system Python, hence not allowing installation into its environment anymore. Does using @actions/setup-python
with an explicit Python version work for you? Otherwise you need to create a venv (e.g. virtualenv .venv
or python -m venv venv
). --break-system-packages
is not an option, since we specifically don't want to corrupt the system wide /usr/bin/python3
that is also used by the operating system.
As I understand it, github actions shipped a change that the default Python is now a system Python
So it's not purely the ubuntu version and which python version it ships with? The breakage definitely tracks with the ubuntu-24.04 image and can indeed be worked around by downgrading from -latest to -22.04.
They seem to have made that change with the ubuntu-24.04 image, this breaking python change is apparently also the reason the rollout is now on hold: https://github.com/actions/runner-images/issues/10636
We encountered this on a macos-latest runner today. Action logs here. We definitely have the latest version of Maturin-action:
Download action repository 'PyO3/maturin-action@v1' (SHA:ea5bac0f1ccd0ab11c805e2b804bfcb65dac2eab)
We're definitely not using the --user
flag:
Install maturin
Installing 'maturin' from tag 'v1.7.4'
/usr/bin/tar xz -C /Users/runner/work/_temp/cc8a46b9-5ec9-44bd-82c0-107ab367408a -f /Users/runner/work/_temp/d785f0a3-c0bf-4f99-b894-0a2aa5d56550
Installed 'maturin' to /Users/runner/work/_temp/cc8a46b9-5ec9-44bd-82c0-107ab367408a/maturin
/Users/runner/work/_temp/cc8a46b9-5ec9-44bd-82c0-107ab367408a/maturin --version
maturin 1.7.4
/opt/homebrew/bin/python3 -m pip install cffi
Notice: A new release of pip is available: 24.2 -> 24.3.1
Notice: To update, run: python3.13 -m pip install --upgrade pip
error: externally-managed-environment
× This environment is externally managed
AFAICT, Maturin Action only uses --user
for docker builds. Maybe it should also use --user
for host builds? I don't have any other explanation for why we would encounter this error. This is what the GHA job looks like:
macos:
needs: release-plz-release
if: ${{ needs.release-plz-release.outputs.releases_created == 'true' }}
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/cleanup
- uses: ./.github/actions/setup-rust
- uses: spiraldb/actions/.github/actions/setup-uv@0.2.0
- name: rust-toolchain
shell: bash
run: echo "version=$(cat rust-toolchain.toml | grep channel | awk -F'\"' '{print $2}')" >> $GITHUB_OUTPUT
- name: Build wheels - x86_64
uses: PyO3/maturin-action@v1
with:
rust-toolchain: ${{ steps.rust-toolchain.version }}
working-directory: pyvortex
target: x86_64
args: --release --interpreter python3.10 --sdist
Recently I started getting the following error when attempting to build the source distribution:
It looks like the cause is the update of the
ubuntu-latest
runner image toubuntu-24.04
which now ships with python 3.12. One possible fix would be to add--break-system-packages
when installing the packages, though creating a virtual environment would probably be the cleaner solution.In the meantime the problem can be worked around by using the
ubuntu-22.04
image explicitly.Sources: