fix(ci): use cargo install instead of cargo-binstall for anchor-cli#18
fix(ci): use cargo install instead of cargo-binstall for anchor-cli#18graveyieldprotocol wants to merge 1 commit into
Conversation
Symptom on every anchor-build run since PR #15: Run set -o pipefail /home/runner/work/_temp/...sh: line 2: anchor: command not found Error: Process completed with exit code 127. Root cause: cargo-binstall (cargo-bins/cargo-binstall@main) exited 0 without installing `anchor` on PATH. anchor-cli 0.32.1 has no binstall-compatible prebuilt release pattern that the action's heuristics recognise; --no-confirm promoted the silent-no-op into a clean exit rather than an error, so the next step (`anchor build`) ran with anchor missing and hit exit 127. Fix: install anchor-cli via `cargo install --locked --version 0.32.1 anchor-cli` and assert with `anchor --version`. Source compile is ~5-7 min on a cold cache but is cached by Swatinem/rust-cache@v2 already in this job, so steady-state CI time is unchanged. The explicit version check fails the install step itself on any future regression instead of deferring to the build step. No code changes. No toolchain changes. Single CI workflow edit. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Step-level CI timing on fixup #3 reveals the actual failure: Step 7 'Install Anchor CLI' completed in 0s conclusion=success Step 8 'Pin platform-tools v1.54' completed in 48s conclusion=success Step 9 'Anchor build' completed in 1s conclusion=failure `cargo binstall --no-confirm --version 0.32.1 anchor-cli` silently no-ops on anchor-cli 0.32.x — it exits 0 without installing `anchor` on PATH, then `anchor build` exits immediately (1s) because the binary doesn't exist. This is the same silent-no-op pattern I have in failure-pattern memory; I had closed PR #18 thinking cargo-binstall was working (based on PR #17's intermittent success), but it's actually flaky/broken for 0.32.x consistently. Fix: replace cargo binstall with `cargo install --locked --version 0.32.1 anchor-cli` + an `anchor --version` assertion. Source compile takes ~5-7 min on a cold cache but is cached by Swatinem/rust-cache@v2, so steady-state CI time is unchanged. The version assertion fails the install step itself on any future regression instead of deferring to the build step where the symptom is opaque (0s install + 1s build failure is harder to diagnose than a clean install-step failure). Combined with fixup #2 (platform-tools v1.54) and fixup #3 (--no-idl to skip nightly-Rust IDL generation), this should clear anchor build. Locally verified all three together produce a clean `anchor build --no-idl` in 5.67s on m5 and 5.02s on m6. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Step-level CI timing on fixup #3 reveals the actual failure: Step 7 'Install Anchor CLI' completed in 0s conclusion=success Step 8 'Pin platform-tools v1.54' completed in 48s conclusion=success Step 9 'Anchor build' completed in 1s conclusion=failure `cargo binstall --no-confirm --version 0.32.1 anchor-cli` silently no-ops on anchor-cli 0.32.x — it exits 0 without installing `anchor` on PATH, then `anchor build` exits immediately (1s) because the binary doesn't exist. This is the same silent-no-op pattern I have in failure-pattern memory; I had closed PR #18 thinking cargo-binstall was working (based on PR #17's intermittent success), but it's actually flaky/broken for 0.32.x consistently. Fix: replace cargo binstall with `cargo install --locked --version 0.32.1 anchor-cli` + an `anchor --version` assertion. Source compile takes ~5-7 min on a cold cache but is cached by Swatinem/rust-cache@v2, so steady-state CI time is unchanged. The version assertion fails the install step itself on any future regression instead of deferring to the build step where the symptom is opaque (0s install + 1s build failure is harder to diagnose than a clean install-step failure). Combined with fixup #2 (platform-tools v1.54) and fixup #3 (--no-idl to skip nightly-Rust IDL generation), this should clear anchor build. Locally verified all three together produce a clean `anchor build --no-idl` in 5.67s on m5 and 5.02s on m6. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Symptom
Every
anchor-buildrun since PR #15 has failed at theAnchor buildstep with:The
Install Anchor CLIstep (cargo-binstall) exited 0, but theanchorbinary was never on PATH for the next step.Root cause
cargo-binstall(cargo-bins/cargo-binstall@main) exited cleanly without installinganchor. Most likely: anchor-cli 0.32.1 has no binstall-compatible prebuilt release pattern that the action's heuristics recognise, and--no-confirmpromoted the silent-no-op into a clean exit code rather than an error. The pre-built path that worked under earlier Anchor versions doesn't apply to 0.32.x.We didn't catch this in PR #14's green CI either because the workflow was different at that time, or because cargo-binstall's heuristics shifted between PR #14 (when it claimed all 5 jobs green) and the post-#15 state.
Fix
Replace cargo-binstall with
cargo install --locked --version 0.32.1 anchor-cliplus an explicitanchor --versionpost-check. This:anchorbinary to~/.cargo/bin(whichdtolnay/rust-toolchainalready adds toGITHUB_PATH).Swatinem/rust-cache@v2is already in this job, so subsequent runs hit the cache. Cold runs add ~5-7 min.Single CI workflow edit. No code changes. No toolchain changes.
Test plan
anchor --versionprints0.32.1in the install stepanchor buildthen proceeds to actual BPF compile (and either passes, or fails for a real reason — in which case theanchor-build-logartifact captures it)rust-fmt,rust-clippy,ts-typecheck,terminology-lintremain green (unaffected by this change)What lands after this
Once green, PR #17 (docs error_codes.md) and the upcoming m5+m6+m7 PRs can land without CI-red gating. The locked security posture requires CodeRabbit + green CI before merge.
🤖 Generated with Claude Code