Context
At tag v1.51.0 (commit e83996d), PyO3/maturin-action's src/index.ts line 808 contains:
if (existsSync(debugBuildDir)) {
where the intent is to purge host-built build scripts before a containerized cross-compile. The variable should be releaseBuildDir. Because debugBuildDir is checked instead of releaseBuildDir, the purge never fires for release-only builds, and stale host-built build scripts can survive into the container environment.
Additionally, the purge only covers target/*/build and misses proc-macro .so files in target/release/deps/, which are subject to the same host-vs-container ABI mismatch.
Workaround In This Repo
PR #347 worked around this by:
- Giving each
build-python Linux leg its own Swatinem/rust-cache key (key: ${{ matrix.target }}-${{ matrix.manylinux }}), so no cross-leg cache bleeding can occur.
- Skipping the dead host toolchain install on containerized Linux legs (the toolchain was installed but immediately purged incorrectly, serving no purpose).
This workaround is currently in place and the build-python jobs are green. It does not fix the upstream bug.
Why It Matters
The upstream bug is still present on maturin-action's default branch. If we ever remove our per-leg cache keys (e.g. during a future cleanup or version bump of Swatinem/rust-cache), the original failure mode returns. Separately, other repos using maturin-action in release-mode containerized builds are affected without our workaround.
Acceptance Criteria
Context
At tag
v1.51.0(commite83996d),PyO3/maturin-action'ssrc/index.tsline 808 contains:where the intent is to purge host-built build scripts before a containerized cross-compile. The variable should be
releaseBuildDir. BecausedebugBuildDiris checked instead ofreleaseBuildDir, the purge never fires for release-only builds, and stale host-built build scripts can survive into the container environment.Additionally, the purge only covers
target/*/buildand misses proc-macro.sofiles intarget/release/deps/, which are subject to the same host-vs-container ABI mismatch.Workaround In This Repo
PR #347 worked around this by:
build-pythonLinux leg its ownSwatinem/rust-cachekey (key: ${{ matrix.target }}-${{ matrix.manylinux }}), so no cross-leg cache bleeding can occur.This workaround is currently in place and the
build-pythonjobs are green. It does not fix the upstream bug.Why It Matters
The upstream bug is still present on maturin-action's default branch. If we ever remove our per-leg cache keys (e.g. during a future cleanup or version bump of
Swatinem/rust-cache), the original failure mode returns. Separately, other repos usingmaturin-actionin release-mode containerized builds are affected without our workaround.Acceptance Criteria
PyO3/maturin-actionreferencingsrc/index.ts:808, thedebugBuildDir/releaseBuildDirswap, and the missingtarget/release/deps/coverage.key:workaround inrelease.ymlcan be simplified, and updaterelease.ymlaccordingly. A simplified cache config is not strictly required — the workaround is correct and harmless — but it should be revisited to avoid misleading future maintainers.release.ymlinline comments so future maintainers understand why the per-leg keys exist.