From 190cfad2490c83da849ee11341d685e57b09472e Mon Sep 17 00:00:00 2001 From: spacedevin Date: Thu, 27 Aug 2026 16:22:27 -0700 Subject: [PATCH] fix(ci): drop the dry-run package dir before the cargo cache is saved MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Rust crate job has been posting four `##[error]` annotations on green runs: ENOENT: opendir '…/crate/target/package/deckfile-0.1.0/tests/trybuild' ENOENT: opendir '…/crate/target/package/deckfile-0.1.0/tests/target' They come from `Post Cache cargo`, not from any build step. `cargo publish --dry-run` leaves an extracted copy of the crate under `target/package/`, and that copy has a `tests/` directory (holding `conformance.rs`). rust-cache prunes `target/` before saving it, sees `tests/`, and goes looking for the trybuild layout — `tests/target` and `tests/trybuild` — which this crate has never had. It only surfaces on a cache MISS, because rust-cache skips the prune entirely on a hit. That is why it looks sporadic: it appeared on #14, not on #15, and again on #16, each time a change to the emitted crate moved the cache key. Nothing should be caching the output of a dry-run publish, so remove it once the check has served its purpose. The check itself is unchanged. Worth fixing rather than muting: a green run that reports four errors teaches everyone to skim past annotations, which is when a real one gets missed. --- .github/workflows/ci.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e13dc56..0ae705a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -87,9 +87,22 @@ jobs: run: cargo test # A crate that cannot be packaged cannot be released; catch that on the PR, not at publish. + # + # The dry run leaves an extracted copy of the crate at `target/package/deckfile-/`. + # rust-cache's post step prunes `target/` before saving it, walks into that copy, and dies on + # the trybuild layout it expects but this crate does not have: + # + # ENOENT: opendir '…/crate/target/package/deckfile-0.1.0/tests/trybuild' + # + # Four `##[error]` annotations on an otherwise green run. It only shows up on a cache MISS, + # since rust-cache skips the prune entirely on a hit — which is why it appears sporadically, + # whenever a change to the emitted crate moves the cache key. Nothing should be caching the + # output of a dry-run publish, so drop it before the post step can find it. - name: Packaging check working-directory: crate - run: cargo publish --dry-run --allow-dirty + run: | + cargo publish --dry-run --allow-dirty + rm -rf target/package release_check: name: Release check (semantic-release dry-run)