Skip to content

fix(ci): the coverage job still restores the poisoned duckdb tree - #425

Merged
athvin merged 1 commit into
mainfrom
bm/ci-duckdb-outdir
Nov 3, 2026
Merged

athvin merged 1 commit into
mainfrom
bm/ci-duckdb-outdir

Conversation

@athvin

@athvin athvin commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

#424 fixed seven of eight restoring jobs

#424 cured the compile jobs by deleting rust-cache, and that is the right fix for them. coverage is the one job that keeps rust-cache — deliberately, for the reasons written at its own call site: an instrumented cold build has no cache to fall back on, llvm-cov owns RUSTFLAGS so every unit including dependencies rebuilds, and the step already measures 22m10 warm against a 60-minute timeout. Dropping its entry trades 1.8 GiB for a timeout failure.

So it is the one place the poisoning survives, and it needs the repair rather than removal.

It has not fired yet, and that is a prediction rather than luck

coverage runs on schedule / workflow_dispatch only, and its key includes hashFiles('rust/Cargo.toml').

Breakage does not land on the run that caused it — the same property that made this look like each PR's own fault.

The mechanism, and the correction to seven comments

The # No rust-cache comments say a restored target/ carries a populated build/libduckdb-sys-*/out. That is where I sent two wrong fixes, and it is not where the sources live:

  • libduckdb-sys does not unpack into OUT_DIR. src/build_paths.rs:40 walks up from it to a tree shared across the whole target dir: target/duckdb-sources/<key>/.
  • A .complete dotfile is the sentinel. Present → early return. Absent → unpack to a fresh staging dir, then fs::rename that over <key>/.
  • Renaming onto a non-empty directory is ENOTEMPTY = Linux errno 39. fs::rename in publish() is the only syscall in that function that can return 39 — the staging dir is uniquely minted, so archive.unpack cannot — and the ? carries it to an .expect("unpacking bundled DuckDB sources") at build_bundled_cc.rs:65.

So the panic text names the wrong operation. The poisoned state is a populated <key>/ with no .complete, which is what a cache round-trip leaves behind.

The deleting fix does not depend on that distinction. The comments do: they are what someone re-adding a target-dir cache will read.

Why the repair goes after the restore

rust-cache writes the cache in its post-step, after every step this workflow can declare. Cleaning before the save is impossible, so repairing after the restore is the only place that works.

The condition tested is exactly the build script's own precondition, so an intact tree is left alone and keeps the fast path. Dropping one costs the tarball unpack (seconds), not the compile (minutes) — the C++ objects come from sccache.

Verified against the real failing state

An earlier revision of this branch applied the same step to all eight jobs and was observed fixing a genuinely poisoned restore, which is what confirms the diagnosis rather than a cold-cache coincidence:

Cache hit for: v2-rust-rust-Linux-x64-8556beb2-11e7c23f
REPAIRED target/duckdb-sources/456b4ceebba9353f/ (no .complete - would panic ENOTEMPTY)
→ fmt + clippy + docs PASSED

That distinction matters here: #422's green run was green because its entry was momentarily empty, and I reported it as confirmation. A cold cache passing is not evidence about a poisoned-cache failure.

The step echoes intact / REPAIRED / none per tree for the same reason — both earlier attempts went green having done nothing, and one of them printed the .o files it removed while the panic still happened.

🤖 Generated with Claude Code

#424 cured the seven compile jobs by deleting rust-cache. `coverage` is the
one job that keeps it — deliberately, since an instrumented cold build has no
cache to fall back on and `llvm-cov` already measures 22m10 warm against a
60-minute timeout — so it is the one place the poisoning survives.

It has not fired yet, and the reason is a dated prediction rather than luck:
#376 bumped duckdb at 01:07 today, after that day's nightly. Tonight's
scheduled run therefore gets a NEW source-tree key, unpacks cleanly, passes,
and SAVES the stripped tree. The run after that restores it and dies before a
test. As ever the breakage does not land on the run that caused it.

Also corrects the mechanism in the seven `# No rust-cache` comments. They say
a restored target carries a populated `build/libduckdb-sys-*/out`, which is
where I sent two wrong fixes: `libduckdb-sys` does not unpack into `OUT_DIR`
at all. `src/build_paths.rs:40` walks UP from it to a tree shared across the
target dir, `target/duckdb-sources/<key>/`, guarded by a `.complete` dotfile.
Absent sentinel, the script unpacks to a staging dir and `fs::rename`s it over
`<key>/` — ENOTEMPTY, Linux errno 39. `fs::rename` in `publish()` is the only
syscall in that function that can return 39, so the panic's
"unpacking bundled DuckDB sources" names the wrong operation.

The deleting fix does not depend on that distinction, but the comments explain
why rust-cache is absent, and someone re-adding a target-dir cache will read
them. The repair's own condition is the build script's precondition, so an
intact tree keeps the fast path, and it echoes per tree because both earlier
attempts went green having done nothing.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@athvin
athvin force-pushed the bm/ci-duckdb-outdir branch from e6d0334 to 00ef1d0 Compare November 3, 2026 02:37
@athvin athvin changed the title fix(ci): clear the restored libduckdb-sys OUT_DIR — the prefix bump treated the wrong layer fix(ci): the coverage job still restores the poisoned duckdb tree Nov 3, 2026
@athvin
athvin merged commit 0d6f744 into main Nov 3, 2026
34 checks passed
@athvin
athvin deleted the bm/ci-duckdb-outdir branch November 3, 2026 03:04
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.

2 participants