fix(makefile): grep cargo tree stdout only in dependency guards - #259
Merged
Merged
Conversation
The three dependency-graph guards captured `cargo tree` with `2>&1` and
grepped the result, so cargo's progress output on stderr was searched
alongside the tree. On a cold cache a line like
Downloaded embedded-hal-nb v1.0.0
matches `MQTT_DEPENDENCY_FORBIDDEN` (embedded-io|embedded-hal|tokio) even
though the crate is absent from the tree being checked — it is being
fetched for a later step. This failed the v2.0.0 release workflow while
the same guard passed locally on a warm cache, and would recur on any
cold runner.
Each guard now redirects stderr to a temp file instead of folding it into
stdout. The "refusing to pass vacuously" behaviour is unchanged: a
non-zero exit from cargo still fails loudly, and the captured stderr is
printed when it does.
`check-no-sim`'s tree_rand keeps `2>&1` deliberately — it greps for
cargo's "did not match any packages" message, which arrives on stderr,
and matches an exact phrase that progress lines cannot satisfy.
Verified: `make build` (guard 1) and `make test-embedded` (guards 2 and
3) both pass, and injecting a "Downloaded embedded-hal-nb" line into
stderr reproduces the CI failure under the old form while passing under
the new one.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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 v2.0.0 release workflow (run 35391165477) failed at
test-embeddedwith:None of those are dependencies of
aimdb-mountain-mqtt. Its tree isheapless → hash32 → byteorderplusstable_deref_trait, and the guard passes locally.Cause
The three dependency-graph guards captured
cargo treewith2>&1and grepped the result, so cargo's progress output on stderr was searched alongside the tree. Those three "Downloaded …" lines are crates being fetched for later steps, and they matchMQTT_DEPENDENCY_FORBIDDEN(embedded-io|embedded-hal|tokio) as plain substrings.It only fires on a cold cargo cache, which is why it passed locally and in the PR's CI job but broke the release workflow. It would recur on any cold runner.
Fix
Each guard redirects stderr to a temp file instead of folding it into stdout. The "refusing to pass vacuously" behaviour is unchanged — a non-zero exit from cargo still fails loudly, and the captured stderr is printed when it does.
check-no-sim'stree_randkeeps2>&1on purpose: it greps for cargo's"did not match any packages"message, which arrives on stderr, and matches an exact phrase that progress lines cannot satisfy.Verification
make build(guard 1,aimdb-syncno_std)✓ no_std graph is free of tokio|libcmake test-embedded(guards 2 and 3)✓ embedded MQTT graph is free of …,✓ mountain-mqtt is the codec aloneThe last two matter most: injecting a
Downloaded embedded-hal-nb v1.0.0line reproduces the failure on demand under the old form and passes under the new one, so this is a confirmed cause rather than a plausible one.Not in scope
The v2.0.0 release itself is unaffected — all 19 crates published successfully, and the tag and GitHub Release are in place. The failed job never reached its "Create GitHub Release" step.
🤖 Generated with Claude Code