Skip to content

ci(rust): pass --locked to cargo in Rust CI workflows - #4005

Merged
jayantk merged 1 commit into
mainfrom
hydra/i-seedpep/head
Aug 22, 2026
Merged

ci(rust): pass --locked to cargo in Rust CI workflows#4005
jayantk merged 1 commit into
mainfrom
hydra/i-seedpep/head

Conversation

@jayantk

@jayantk jayantk commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

What

Adds --locked to the cargo invocations in the Rust CI workflows, and regenerates the two lockfiles that turned out to be stale.

Cargo respects an existing Cargo.lock by default, so this is not a fix for an active problem — but nothing today stops a PR from bumping a Cargo.toml without regenerating its lockfile. CI silently re-resolves and goes green. With --locked it fails loudly instead, which also means the dependency set CI verifies is exactly the one committed to the repo.

Lockfile fixes

Two workspaces were already out of sync — both still pinned pythnet-sdk 2.3.1 against a manifest that now declares 3.0.0, which also drags borsh from 0.10.3 to 1.8.0:

  • target_chains/cosmwasm/Cargo.lock
  • target_chains/fuel/contracts/Cargo.lock

These are regenerated here (the cosmwasm lock also moves from lockfile format v3 to v4, which cargo writes by default from 1.78 onward; the repo pins 1.89). Since CI was already re-resolving these two on every run, the regenerated locks record what CI has effectively been building all along.

SBF caveats

cargo build-sbf and cargo test-sbf are clap-based wrappers, not passthroughs — they reject unrecognized flags rather than forwarding them:

  • cargo build-sbf takes cargo args after --, so the three Solana program builds use ... -- --locked. Verified against the pinned toolchain (Solana v3.1.10): the flag reaches the underlying cargo build.
  • cargo test-sbf has no equivalent. It rejects --locked outright, and anything after -- is re-appended after cargo test's own --, so it lands on the test binary instead of cargo. ci-remote-executor.yml's cargo test-sbf is therefore left alone, with an inline comment recording why. (ci-solana-contract.yml's cargo-test-sbf has the same limitation.)

Left out

cargo fmt does not accept --locked, so all format-check steps are untouched.

Three other cargo invocations in .github/workflows/ are outside this change and may be worth a follow-up:

  • the six publish-*.yml workflows' cargo publish--locked is accepted there, but these are release workflows, so failing a publish on a stale lockfile is a different risk trade-off than failing CI
  • ci-near-contract.yml's cargo near build reproducible-wasm — a docker-based reproducible build with its own arg handling

Dockerfiles are tracked separately.

Verification

Every changed command was run locally against the repo's pinned toolchains: clippy/build/test for cosmwasm (43 tests pass), a full build plus test compile for fuel, and clippy or the equivalent gate command for fortuna, quorum, pythnet-sdk, hermes-server, hermes-client-rust, pyth-lazer-pusher, message-buffer, remote-executor, solana, starknet-tools, and stylus-nostd. All three cargo build-sbf ... -- --locked lines were run for real, including the --features pro-compatible matrix variant.


Open in Devin Review

Cargo silently re-resolves when a Cargo.toml changes without its lockfile
being regenerated. Passing --locked makes CI fail loudly instead.

The cosmwasm and fuel lockfiles were already stale (both still pinned
pythnet-sdk 2.3.1 against a manifest that now declares 3.0.0), so they are
regenerated here.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@jayantk
jayantk requested a review from a team as a code owner August 20, 2026 19:22
@dourolabs-greenlight

Copy link
Copy Markdown

Greenlight — 🚫 Blocked — see reasons below (26bdb42)

Blocking reasons:

  • path not auto-approvable: .github/workflows/ci-cosmwasm-contract.yml (+14 more)

Open in Greenlight →

1 similar comment
@dourolabs-greenlight

Copy link
Copy Markdown

Greenlight — 🚫 Blocked — see reasons below (26bdb42)

Blocking reasons:

  • path not auto-approvable: .github/workflows/ci-cosmwasm-contract.yml (+14 more)

Open in Greenlight →

@vercel

vercel Bot commented Aug 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
api-reference Building Building Preview Aug 20, 2026 7:27pm
component-library Ready Ready Preview Aug 20, 2026 7:27pm
developer-hub Ready Ready Preview Aug 20, 2026 7:27pm
entropy-explorer Ready Ready Preview Aug 20, 2026 7:27pm
insights Error Error Aug 20, 2026 7:27pm
proposals Ready Ready Preview Aug 20, 2026 7:27pm
staking Ready Ready Preview Aug 20, 2026 7:27pm

Request Review

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Open in Devin Review

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Non-regenerated lockfiles must be in sync or --locked breaks CI

Adding --locked means every workspace whose lockfile is stale relative to its Cargo.toml will now fail CI loudly. This PR only regenerated target_chains/cosmwasm/Cargo.lock and target_chains/fuel/contracts/Cargo.lock (both bumped pythnet-sdk to 3.0.0). The remaining affected jobs — fortuna, quorum, pythnet-sdk, hermes-client-rust, starknet-tools, pyth-lazer-pusher (root Cargo.lock), hermes-server, remote-executor, message-buffer, solana, stylus — rely on their existing committed lockfiles already being in sync. The author states they ran each gate command locally, but this could not be independently verified in this review environment (cargo not installed). Reviewer should confirm CI passes green for all these jobs, since a single stale lockfile in any of these workspaces would now fail the build.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@jayantk
jayantk merged commit f50a3fa into main Aug 22, 2026
25 of 26 checks passed
@jayantk
jayantk deleted the hydra/i-seedpep/head branch August 22, 2026 01:37
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