Skip to content

flaky actions: skip actions/setup-python on musl (fixes Alpine flow tests) - #3

Merged
kei-nan merged 1 commit into
mainfrom
jk-flaky-setup-python-musl
Jul 14, 2026
Merged

flaky actions: skip actions/setup-python on musl (fixes Alpine flow tests)#3
kei-nan merged 1 commit into
mainfrom
jk-flaky-setup-python-musl

Conversation

@kei-nan

@kei-nan kei-nan commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Problem

flaky-filter and flaky-record-results run actions/setup-python@v6 unconditionally. actions/setup-python only publishes glibc CPython builds, so on musl hosts (e.g. Alpine) the interpreter it installs can't run — and worse, it exports LD_LIBRARY_PATH / pythonLocation into $GITHUB_ENV, which then corrupts the musl python the caller's job actually uses (RediSearch runs its flow tests against a uv musl 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.23 jobs (periodic + nightly validation, both x86_64 and aarch64) it produced:

  • python3 -m pip install redis/.../.venv/bin/python3: No module named pip
  • the subsequent flow-test step → deps/readies/mk/main:49: *** Cannot find python3 interpreter while building RedisJSON → make pytest exit 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, or ldd --version reporting musl) and skip setup-python on musl, falling back to the ambient python3 the caller already provides (on RediSearch that's the musl uv venv, which has pip + redis). glibc/macOS behaviour is unchanged — setup-python still runs there.

Scope

Audited all 7 setup-python usages 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 the flaky-mark/flaky-unmark/link-check/spellcheck reusable workflows (own jobs, ubuntu-slim, no container:) run on glibc and are unaffected.

Rollout

Consumers pin @v1 (a moving tag). After merge, advance v1 (and cut v1.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-filter and flaky-record-results always ran actions/setup-python, which only ships glibc CPython and writes LD_LIBRARY_PATH / pythonLocation into $GITHUB_ENV, breaking the caller’s musl python3 (e.g. a uv venv).

Both composites now run detect_libc.sh after checking out redisearch-ci-common, set steps.libc.outputs.musl, and gate setup-python with if: steps.libc.outputs.musl != 'true' so musl hosts use ambient python3 for pip install redis and flaky_db.py. glibc/macOS behavior is unchanged.

The new scripts/ci_common/detect_libc.sh treats Alpine (/etc/alpine-release) or ldd --version reporting musl as musl=true and 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.

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
kei-nan force-pushed the jk-flaky-setup-python-musl branch from d788e83 to 2a52cc4 Compare July 14, 2026 09:21
@kei-nan
kei-nan merged commit 47d2968 into main Jul 14, 2026
3 checks passed
@kei-nan kei-nan self-assigned this Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant