Skip to content

fix: never reuse a pip-cached arcticpy wheel across runner images #330

Closed

Description

@Jammy2211

Overview

autocti_workspace Smoke Tests are RED on main (run 42883685928), which is Heart's only release-readiness blocker. GitHub's runner image moved from ubuntu-24.04 to ubuntu-26.04 (libgsl28). The smoke workflow's pip cache then restored an arcticpy-2.6 wheel built on 24.04 against libgsl.so.27, so import arcticpy fails. arcticpy has no published wheels: its wheel is built on the runner and links the runner's GSL. A cached copy must never outlive the image it was built on.

Corrective-PR exception (AUTONOMY.md), Heart RED reason, verbatim: "autocti_workspace: Smoke Tests failure on main"

Plan

  • Make Heart's shared arcticpy install script stop reading pip's cache for the one arcticpy install, so the wheel is always rebuilt against the GSL actually on the machine (about 15 s per job; measured fresh build 12–15 s).
  • One place covers every consumer: smoke tests, CTI lib-tests, docs builds and the local smoke runner. No manual cache deletion: the stale wheel simply stops being read.
  • A regression test pins the behaviour.
  • Out of scope (filed separately): the warnings NameError at smoke-tests.yml:777 (from fe22b65, test: PR gate rejects untimed urlretrieve/urlopen in workspace scripts #326) in a continue-on-error cache-stats step. It does not cause the RED.

Tier: judge — merge mode: human /prm

Detailed implementation plan

Evidence

  • Green run 42508969926 (11-08): Image: ubuntu-24.04, Using cached arcticpy-2.6-cp312-cp312-linux_x86_64.whl.
  • Red run 42883685928 (11-10, push of 9ab5582, docs-only): Image: ubuntu-26.04; apt installs libgsl-dev libgsl28 (2.8+dfsg-6); Using cached arcticpy-2.6-...whl; ImportError: libgsl.so.27: cannot open shared object file at "Verifying arcticpy imports", both py3.12 and py3.13.
  • The smoke pip cache key pyauto-pip-${{ runner.os }}-py<ver>-e<epoch>-<hash> (+ prefix restore-key) has no image identity. Re-running restores the same wheel.
  • The PR run for feat: reusable Sphinx docs-build workflow (warning-baseline gated) #48 skipped smoke (no relevant change), so the image change first surfaced on the push.

Affected Repositories

  • PyAutoHeart (primary). Consumers via install-arcticpy@main: PyAutoCTI, autocti_workspace, autocti_workspace_test, CTI docs build.

Branch Survey

Repository Current Branch Dirty?
./PyAutoHeart main clean

No worktree claim conflicts on PyAutoHeart.

Suggested branch: feature/arcticpy-wheel-cache-libgsl

Implementation Steps

  1. .github/actions/install-arcticpy/install_arcticpy.sh (~line 139): add --no-cache-dir to pip install "arcticpy==${ARCTICPY_VERSION}" --no-build-isolation --no-deps, with a comment explaining the system-library link and this incident. numpy/cython/scipy/matplotlib keep the cache (manylinux wheels, image-independent).
  2. Regression test (tests/): assert the real script's arcticpy install line carries --no-cache-dir. heart/smoke.py already folds the script's sha256 into the local environment fingerprint, so local environments rebuild themselves.
  3. Not chosen: adding $ImageOS to the smoke pip cache key. It covers only smoke-tests.yml and drops the whole pip cache per image change; it is not needed for causality. Possible later hardening.

Validation

  • Pre-merge: arcticpy-action.yml self-test (path-filtered on the action) builds fresh and imports on the current image; heart-tests.yml green.
  • Post-merge (human /prm): re-run autocti_workspace Smoke Tests on main. The log must show "Building wheel for arcticpy" and the run goes green. Callers use @main, so the fix only takes effect after merge. Then Heart's next verdict should drop this reason. The YELLOW reasons (manifest drift, two 7-day PRs, no rehearsal) remain; release stays blocked until Heart says otherwise.

Key Files

  • .github/actions/install-arcticpy/install_arcticpy.sh: the one arcticpy recipe.
  • .github/workflows/smoke-tests.yml: the hand-rolled pip cache (~line 389) that restored the stale wheel.
  • heart/smoke.py: local runner; fingerprints the installer.

Original Prompt

Click to expand starting prompt

arcticpy install restores a pip-cached wheel built against a missing libgsl

Type: bug
Target: PyAutoHeart
Difficulty: easy
Autonomy: supervised
Priority: high
Status: formalised
Consequence: judge
Filed: 2026-11-11
Repos: @PyAutoHeart (consumers: @PyAutoCTI @autocti_workspace @autocti_workspace_test)

Evidence and reproduction

autocti_workspace Smoke Tests is RED on main
(https://github.com/PyAutoLabs/autocti_workspace/actions/runs/42883685928, push
of 9ab5582 from docs PR #48, 2026-11-10T19:17Z). Both py3.12 and py3.13 legs
fail in "Install arcticpy (CTI workspaces only — source-only C++ sdist)":

  • apt installs GSL from Ubuntu 26.04 resolute: libgsl-dev libgsl28 (2.8+dfsg-6).
  • pip install arcticpy==2.6 then reports
    Using cached arcticpy-2.6-cp312-cp312-linux_x86_64.whl.
  • The import check fails:
    ImportError: libgsl.so.27: cannot open shared object file, so the
    verify-import step fails.

The wheel in ~/.cache/pip was built on the previous runner image against
libgsl.so.27. The pip cache in .github/workflows/smoke-tests.yml is keyed
pyauto-pip-${{ runner.os }}-py<ver>-e${{ env.PYAUTO_CACHE_EPOCH }}-<hash>
with a matching prefix restore-key. Nothing in the key changes when the runner
OS image changes, so the stale locally-built wheel is reused.

The PR run (42881872398) skipped smoke because nothing relevant changed. The
11-08 push run passed on the old image. Re-running restores the same cache and
fails again. A later NameError: name 'warnings' is not defined in a cache-stats
stdin step is a follow-on failure to check, not the root cause.

This is Heart's only release-readiness blocker (Heart RED, score 55, 2026-11-11);
the 2026-11-10 nightly stopped at preflight because of it.

Repair scope

Fix it at the source in PyAutoHeart, for every consumer of the shared
install-arcticpy action and the pip caches around it: smoke-tests.yml,
lib-tests.yml, docs-build.yml and arcticpy-action.yml (PyAutoCTI,
autocti_workspace, autocti_workspace_test, CTI docs). Candidates, tested before
choosing:

  • add the runner image identity ($ImageOS / $ImageVersion, or the GSL
    soname) to the pip cache keys and restore-keys; and/or
  • have install_arcticpy.sh never reuse a cached locally-built arcticpy wheel
    (--no-cache-dir or --no-binary arcticpy for that one install), so a
    system-library change can never be masked again.

Also check and fix the warnings NameError in the follow-on step. Do not mask
the failure by skipping the import check, the CTI smoke legs or the arcticpy
install. Do not hand-delete caches as the fix. Validate by re-running
autocti_workspace Smoke Tests on main (it must rebuild the wheel against
libgsl28 and pass) and confirm the other CTI consumers stay green. Check current
claims and use start-dev before implementation. No release, merge or CI bypass.

Activity

  1. Jammy2211 commented on Nov 11, 2026

    @Jammy2211
    ContributorAuthor

    Corrective-PR exception — human authorization (recorded 2026-11-11, live in session)

    Heart RED reason, verbatim from pyauto-heart readiness at 2026-11-11T08:14Z:

    autocti_workspace: Smoke Tests failure on main

    The maintainer authorized the corrective-PR exception for this one reason and this issue ("Authorize, plan first"), then approved the plan above ("approved, go ahead").

    Permitted: commit, push, and one pending-release PR scoped to the arcticpy install fix + its regression test. Not permitted: merge, issue close, release or rehearsal; merge stays a human /prm. Sibling YELLOW reasons remain and are not claimed by this fix.

  2. Jammy2211 commented on Nov 11, 2026

    @Jammy2211
    ContributorAuthor

    Library PR Created: #331 (commit 031bfb5)

    • Fix: --no-cache-dir on the arcticpy install in install_arcticpy.sh, plus regression test test_arcticpy_build_never_reuses_a_pip_cached_wheel.
    • Tests: Heart suite 1319 passed. Control: the new test fails on the old script and passes with the fix.
    • Review: independent (separate model) CLEAN; causal and single-scope.
    • Heart at ship time: RED, reason unchanged and verbatim: "autocti_workspace: Smoke Tests failure on main".
    • Workspace impact: none (CI recipe only, no API).
    • Next: human /prm. After merge, re-run autocti_workspace Smoke Tests on main to confirm a fresh arcticpy build and a green run. The YELLOW reasons remain.
  3. Jammy2211 commented on Nov 11, 2026

    @Jammy2211
    ContributorAuthor

    Shipped: merged in #331 (merge commit 6e4be55, 2026-11-11T08:52Z).

    • PR checks on 5b11b0b, all green: Heart Tests 3.12/3.13 and the arcticpy Action Self-Test 3.12/3.13. The self-test ran on ubuntu-26.04 with libgsl28, built a fresh arcticpy-2.6 wheel and imported it, which proves the fix on the new image.
    • A first push failed the organ-code tenant firewall: the test docstring named a workspace repo. Fixed in 5b11b0b, a wording-only change.
    • Post-merge validation: autocti_workspace Smoke Tests run 42883685928 re-run on main. Heart's next verdict should drop "autocti_workspace: Smoke Tests failure on main". The YELLOW reasons remain.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions