fix(ci): drop the dry-run package dir before the cargo cache is saved - #17
Merged
Conversation
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.
Owner
Author
|
One caveat on this PR's green run, so it isn't over-read: that run got a cache hit ( What is verified is the mechanism, locally:
So the fix deletes the input to the failure rather than suppressing the symptom. It'll be demonstrated for real on the next cache miss — the next run where the emitted crate changes, which is also the only kind of run that ever showed the problem. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Rust crate job posts four
##[error]annotations on otherwise green runs — most recently on the#16merge:Cause
They come from
Post Cache cargo, not from any build step — every job passes and the crate packages fine.cargo publish --dry-runleaves an extracted copy of the crate attarget/package/deckfile-<version>/. That copy contains atests/directory (justconformance.rs). rust-cache prunestarget/before saving it, seestests/, and goes looking for the trybuild layout —tests/targetandtests/trybuild— which this crate has never had.Reproduced locally: after
cargo publish --dry-run --allow-dirty,target/package/deckfile-0.1.0/tests/exists holding onlyconformance.rs, and both paths rust-cache wants are absent.Why it looks sporadic
rust-cache skips the prune entirely on a cache hit, so the annotations only appear on a miss:
... Cleaning …/crate/target ...Each occurrence lines up with a change to the emitted crate moving the cache key.
#16regeneratedcrate/(newWavetablemodule, newWavefacade struct, new conformance test), so it missed and the latent bug surfaced again.Fix
Remove the dry-run output once the check has served its purpose — nothing should be caching it. The check itself is unchanged.
cache-targets: falseon the rust-cache step would also silence it, but at the cost of the build cache, so this is the better trade.Worth fixing rather than muting: a green run that reports four errors teaches everyone to skim past annotations, which is exactly when a real one gets missed.