flaky actions: skip actions/setup-python on musl (fixes Alpine flow tests) - #3
Merged
Conversation
actions/setup-python only publishes glibc CPython builds. On musl hosts (e.g. Alpine) they cannot run, and setup-python also exports LD_LIBRARY_PATH/pythonLocation into $GITHUB_ENV, corrupting the musl python (uv venv) that later steps in the caller's job rely on. This broke RediSearch's Alpine 3.23 flow tests in periodic/nightly validation (pip: 'No module named pip'; RedisJSON build: 'Cannot find python3'). Add scripts/ci_common/detect_libc.sh (fetched via the existing self- checkout, like flaky_db.py) and skip setup-python when it reports musl, falling back to the ambient python3 the caller provides. glibc/macOS behaviour is unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
kei-nan
force-pushed
the
jk-flaky-setup-python-musl
branch
from
July 14, 2026 09:21
d788e83 to
2a52cc4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
flaky-filterandflaky-record-resultsrunactions/setup-python@v6unconditionally.actions/setup-pythononly publishes glibc CPython builds, so on musl hosts (e.g. Alpine) the interpreter it installs can't run — and worse, it exportsLD_LIBRARY_PATH/pythonLocationinto$GITHUB_ENV, which then corrupts the musl python the caller's job actually uses (RediSearch runs its flow tests against auvmusl venv).Because these are composite actions, that env pollution persists to every later step in the caller's job. In RediSearch's
test-*platforms / alpine:3.23jobs (periodic + nightly validation, both x86_64 and aarch64) it produced:python3 -m pip install redis→/.../.venv/bin/python3: No module named pipdeps/readies/mk/main:49: *** Cannot find python3 interpreterwhile building RedisJSON →make pytestexit 2 → the job's "Fail flow if tests failed" gate goes red.Every glibc platform (Ubuntu, macOS, Intel, coverage, sanitize) passed; only the two Alpine jobs failed, and identically.
Fix
Detect musl (
/etc/alpine-release, orldd --versionreporting musl) and skipsetup-pythonon musl, falling back to the ambientpython3the caller already provides (on RediSearch that's the musluvvenv, which has pip +redis). glibc/macOS behaviour is unchanged —setup-pythonstill runs there.Scope
Audited all 7
setup-pythonusages in this repo. Only these two composite actions run inside the caller's job (hence can land in a musl container).ci.yml(ubuntu-latest) and theflaky-mark/flaky-unmark/link-check/spellcheckreusable workflows (own jobs,ubuntu-slim, nocontainer:) run on glibc and are unaffected.Rollout
Consumers pin
@v1(a moving tag). After merge, advancev1(and cutv1.0.2) to propagate.🤖 Generated with Claude Code
Note
Low Risk
CI-only change limited to two composite actions; glibc paths still use setup-python, with musl relying on caller-provided python3.
Overview
Fixes Alpine container jobs where
flaky-filterandflaky-record-resultsalways ranactions/setup-python, which only ships glibc CPython and writesLD_LIBRARY_PATH/pythonLocationinto$GITHUB_ENV, breaking the caller’s muslpython3(e.g. auvvenv).Both composites now run
detect_libc.shafter checking out redisearch-ci-common, setsteps.libc.outputs.musl, and gatesetup-pythonwithif: steps.libc.outputs.musl != 'true'so musl hosts use ambientpython3forpip install redisandflaky_db.py. glibc/macOS behavior is unchanged.The new
scripts/ci_common/detect_libc.shtreats Alpine (/etc/alpine-release) orldd --versionreporting musl asmusl=trueand writes that to$GITHUB_OUTPUT.Reviewed by Cursor Bugbot for commit 2a52cc4. Bugbot is set up for automated code reviews on this repo. Configure here.