Skip to content

ci: self-heal cargo caches that kill build scripts with a bare ENOENT - #38404

Open
ggevay wants to merge 1 commit into
MaterializeInc:mainfrom
ggevay:gabor/clear-corrupted-target-dir-enoent
Open

ci: self-heal cargo caches that kill build scripts with a bare ENOENT#38404
ggevay wants to merge 1 commit into
MaterializeInc:mainfrom
ggevay:gabor/clear-corrupted-target-dir-enoent

Conversation

@ggevay

@ggevay ggevay commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Motivation

On 2026-08-21 the merge-skew-cargo-check step failed org-wide for about an hour: a corrupted cached build-script binary on the single merge-skew agent died with a bare "No such file or directory", a signature bin/clear-corrupted-cargo-target-dir does not recognize, so the self-heal never fired and every PR's check stayed red until the agent was replaced by hand. See for example https://buildkite.com/materialize/test/builds/132291#01a02515-b30e-4809-b330-98cdb7fbfe9d (test-pipeline builds 132290 through 132298 all failed identically, across unrelated branches).

Description

Recognize the signature in bin/clear-corrupted-cargo-target-dir and wipe-and-retry, mirrored in run_and_detect_retryable_build_failure per the existing sync comments. Both halves of the signature are required, and the ENOENT must be the exact bare error line: "failed to run custom build command" alone is any build-script bug, which a retry cannot fix, and a build script that fails on a missing file with an error context of its own reports the ENOENT indented under "Caused by:" rather than on the bare "Error:" line, so genuine build-script bugs (which are user code, not cache corruption) do not trigger cache wipes.

A follow-up PR (kept in draft for now) adds a warning annotation on every self-healing wipe so that recurring corruption stays observable instead of manifesting only as repeatedly cold builds.

Verification

The script detects the actual incident log from build 132298 (exit 199), detects a synthetic bare-pair log, and correctly ignores both a log carrying only the "failed to run custom build command" half and a log where the ENOENT appears in a "Caused by:" detail line of a contextful build-script error. The Python side raises RustIncrementalBuildFailure for the bare pair and falls through to a plain CalledProcessError for the contextful case.

@ggevay
ggevay force-pushed the gabor/clear-corrupted-target-dir-enoent branch from ec7c9e0 to 754cb23 Compare August 21, 2026 18:07
A corrupted cached build-script binary fails with
"failed to run custom build command" plus a bare
"Error: No such file or directory (os error 2)", a signature
clear-corrupted-cargo-target-dir did not recognize, so the corruption
persisted across runs instead of being wiped and retried. On the
single-agent merge-skew queue this took the check down for every PR
until the agent was replaced by hand.

Require both halves of the signature, with the ENOENT as the exact bare
error line: the first half alone is any build-script bug, which a retry
cannot fix, and a build script that fails on a missing file with an
error context of its own reports the ENOENT in a "Caused by:" detail
line instead. Mirror the signature in
run_and_detect_retryable_build_failure, which the sync comments already
tie to the shell script.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FJqg3FMKRiGYJ4owEwVAdC
@ggevay
ggevay force-pushed the gabor/clear-corrupted-target-dir-enoent branch from 754cb23 to cffdc3b Compare August 21, 2026 18:10
@ggevay ggevay changed the title ci: self-heal the corrupted-build-script cache failure and annotate cache wipes ci: self-heal cargo caches that kill build scripts with a bare ENOENT Aug 21, 2026
@ggevay
ggevay marked this pull request as ready for review August 21, 2026 18:24
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