Skip to content

ci: auto-heal corrupt boost conan cache on self-hosted runners - #691

Closed
frstrtr wants to merge 6 commits into
masterfrom
ci-steward/conan-cache-integrity-guard
Closed

ci: auto-heal corrupt boost conan cache on self-hosted runners#691
frstrtr wants to merge 6 commits into
masterfrom
ci-steward/conan-cache-integrity-guard

Conversation

@frstrtr

@frstrtr frstrtr commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Problem

Recurring intermittent boost/conan reds across CI + release builds. The self-hosted runners reuse ~/.conan2 across jobs; a partially-failed conan build leaves an incomplete boost package that persists and poisons later jobs. Different pieces go missing per run (same class):

Intermittent because it depends on which runner/cache state a job lands on.

Fix

New composite action .github/actions/conan-cache-guard runs before every conan install:

conan cache check-integrity "boost/*" || conan remove "boost/*" -c

check-integrity validates the cached package against its manifest, so it catches ANY missing header/lib — not just the named ones — and auto-purges so the following conan install rebuilds boost clean. No-op on a healthy/empty cache; declares its own shell: bash so it is cross-platform (Linux/mac/Windows-217). Never fails the build itself.

Wired before all conan install sites: build.yml (6), coin-matrix.yml (1), release.yml (2), codeql-analysis.yml (1) — presence/build-mode conditions mirrored.

Verification

  • VM905 (c2pool-build) cache verified currently clean: all named-missing files present (44 libs), check-integrity boost/* RC=0.
  • Manually confirmed check-integrity detects the corruption class (manifest-vs-disk mismatch) and conan remove boost/* purges cleanly.

Reviewer: @Integrator — no self-merge; awaiting operator push-approval.

frstrtr added 6 commits July 13, 2026 08:48
Add a conan-cache-guard composite action that runs
"conan cache check-integrity boost/*" before each conan install and
purges the boost package on any manifest mismatch, so the install
rebuilds it clean. Fixes the recurring intermittent boost reds (missing
asio/log headers, libboost_process/coroutine "expected but not built")
caused by a partially-failed conan build leaving an incomplete boost
package in the shared ~/.conan2 that persists and poisons later jobs.
Wired before every conan install across build.yml, coin-matrix.yml,
release.yml, codeql-analysis.yml (presence/build-mode conditions
mirrored).
…ervice PATH)

Windows self-hosted (VM217) has no bash on the service PATH, so the single
shell: bash guard step errored with 'bash: command not found'. Split the
composite action by runner.os: bash on POSIX, pwsh on Windows with the
equivalent check-integrity/remove and exit 0 to preserve the never-fails
invariant. Guard now runs on every lane including win-217.
…olicy blocks unsigned powershell bodies)

cmd has no execution-policy gate, mirroring the windows-2022 fork-fallback.
if errorlevel 1 purges the corrupt boost package; exit /b 0 keeps the step
non-failing on a healthy or empty cache.
…rupt

The per-job profile pin (sed compiler.cppstd=20) sets what conan install
REQUESTS but not what it SELECTS: an intact gnu17-built boost in the reused
self-hosted cache passes check-integrity, and Conan compatibility fallback
re-selects it instead of rebuilding a cppstd=20 boost -> ABI mismatch reddens
later jobs (boost.asio thread_pool_/partial_redirect_error, cobalt assertion).
Guard now purges boost on any cached compiler.cppstd != 20, making the
cppstd=20 pin durable at the cache layer. Mirrored on the Windows cmd leg.
…ache

The cppstd!=20 conditional purge is correct, but on a cold VM905 cache all
8 Linux runners share one ~/.conan2 and purge+rebuild boost concurrently,
racing (Reference already exists / boost headers deleted mid-build). Wrap
the whole check+purge+rebuild in an flock so exactly one job rebuilds a
clean cppstd=20 boost from source and the rest wait then cache-hit. Windows
(single VM217 runner) has no herd, leg unchanged.
@frstrtr

frstrtr commented Jul 14, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #700 (build.yml) + #702 (release.yml): per-job CONAN_HOME=${{ runner.temp }}/conan2 gives every job an isolated Conan cache, so concurrent jobs on the shared c2pool-build host no longer tear each others ~/.conan2. That removes the shared-cache race this guards decontamination step tried to police — and the guards conan-remove was itself destructive/racy against sibling jobs building in the same shared cache. No shared cache to decontaminate means no backstop needed. Closing; reopen if a torn cache recurs under the isolated-home model.

@frstrtr frstrtr closed 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