From f546ace19f2f33b0cd2ddc038ca3b70a096a7271 Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Wed, 28 Oct 2026 09:38:06 -0700 Subject: [PATCH] fix: build release binaries with Python 3.10 Linux and Alpine release builds still pinned CPython 3.9, which uv rejects now that requires-python is >=3.10. Those assets never uploaded, so the publish step that feeds cli.codecov.io never ran. Build on python:3.10-bullseye (glibc 2.31, same floor as ubuntu 20.04) and Alpine 3.16 (oldest Alpine with Python 3.10), and force uv to use that system interpreter. Co-authored-by: Cursor --- .github/workflows/build_assets.yml | 10 ++++++---- scripts/build_alpine.sh | 8 +++++--- scripts/build_linux.sh | 12 +++++++----- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build_assets.yml b/.github/workflows/build_assets.yml index 409257bd..751129ca 100644 --- a/.github/workflows/build_assets.yml +++ b/.github/workflows/build_assets.yml @@ -78,19 +78,19 @@ jobs: strategy: matrix: include: - - distro: "alpine:3.14" # alpine 3.14 needed for musl 1.2.2/python 3.9 compatibility + - distro: "alpine:3.16" # oldest Alpine with Python 3.10 (musl 1.2.3) arch: arm64 distro_name: alpine runs-on: ubuntu-24.04-arm - - distro: "alpine:3.14" + - distro: "alpine:3.16" arch: x86_64 distro_name: alpine runs-on: ubuntu-24.04 - - distro: "ubuntu:20.04" # ubuntu 20.04 needed for glibc 2.31/python 3.9 compatibility + - distro: "python:3.10-bullseye" # Python 3.10 on glibc 2.31, same floor as ubuntu 20.04 arch: arm64 distro_name: linux runs-on: ubuntu-24.04-arm - - distro: "ubuntu:20.04" + - distro: "python:3.10-bullseye" arch: x86_64 distro_name: linux runs-on: ubuntu-24.04 @@ -100,8 +100,10 @@ jobs: - name: Run in Docker run: | + # python:* images set ENTRYPOINT to python3, which would swallow the build script. docker run \ --rm \ + --entrypoint /bin/sh \ -v $(pwd):/${{ github.workspace }} \ -w ${{ github.workspace }} \ --platform linux/${{ matrix.arch }} \ diff --git a/scripts/build_alpine.sh b/scripts/build_alpine.sh index b71fc81d..32a85e46 100755 --- a/scripts/build_alpine.sh +++ b/scripts/build_alpine.sh @@ -1,10 +1,12 @@ #!/bin/sh set -eux -apk add build-base python3 py3-pip curl +apk add build-base python3 python3-dev py3-pip curl python3 -m pip install --upgrade pip python3 -m pip install uv --only-binary uv -# Need to build with python 3.9 to support systems with libpython >= 3.9 -uv python pin 3.9 +# Alpine 3.16 python3 is 3.10 on musl 1.2.3. A uv-managed interpreter +# would bundle a different libc into the PyInstaller binary. +export UV_PYTHON_PREFERENCE=only-system +export UV_PYTHON=3.10 uv sync --no-binary-package pyyaml --no-binary-package ijson uv run pyinstaller -F codecov_cli/main.py mv ./dist/main ./dist/codecovcli_$1 diff --git a/scripts/build_linux.sh b/scripts/build_linux.sh index 84923aec..e3e73f53 100755 --- a/scripts/build_linux.sh +++ b/scripts/build_linux.sh @@ -1,11 +1,13 @@ #!/bin/sh set -eux apt update -DEBIAN_FRONTEND=noninteractive apt install -y tzdata -apt install -y python3.9 python3.9-dev python3-pip -python3.9 -m pip install uv --only-binary uv -# Need to build with python 3.9 to support systems with libpython >= 3.9 -uv python pin 3.9 +DEBIAN_FRONTEND=noninteractive apt install -y build-essential +python3 -m pip install --upgrade pip +python3 -m pip install uv --only-binary uv +# Image CPython is 3.10 on glibc 2.31. A uv-managed interpreter would +# bundle a different libc into the PyInstaller binary. +export UV_PYTHON_PREFERENCE=only-system +export UV_PYTHON=3.10 uv sync --no-binary-package pyyaml --no-binary-package ijson uv run pyinstaller -F codecov_cli/main.py mv ./dist/main ./dist/codecovcli_$1