From 287b562c471673e9f48b19f06708c21a2ca66836 Mon Sep 17 00:00:00 2001 From: TeTeHacko Date: Fri, 13 Nov 2026 16:49:58 +0100 Subject: [PATCH] ci: python fallback installs python3-dev when the image's python has no headers Co-Authored-By: Claude Opus 5.5 --- .github/actions/setup-build-environment/action.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/actions/setup-build-environment/action.yml b/.github/actions/setup-build-environment/action.yml index fc640f3d..dbacae21 100644 --- a/.github/actions/setup-build-environment/action.yml +++ b/.github/actions/setup-build-environment/action.yml @@ -32,6 +32,14 @@ runs: apt-get install -y -qq python3 python3-venv python3 -m venv --clear "$venv" fi + # The image's python is often newer than the wheels on PyPI (detools + # 0.53.0 has none for 3.14): pip then builds from source and needs the + # headers, which the image does not ship. + inc="$("$venv/bin/python" -c 'import sysconfig; print(sysconfig.get_paths()["include"])')" + if [ ! -e "$inc/Python.h" ]; then + apt-get update -qq + apt-get install -y -qq python3-dev + fi echo "$venv/bin" >>"$GITHUB_PATH" "$venv/bin/python" --version