Skip to content

refactor(basics): migrate inline dev-deps to workspace references - #659

Open
NikkiAung wants to merge 2 commits into
solana-foundation:mainfrom
NikkiAung:refactor/workspace-dev-deps-basics
Open

refactor(basics): migrate inline dev-deps to workspace references#659
NikkiAung wants to merge 2 commits into
solana-foundation:mainfrom
NikkiAung:refactor/workspace-dev-deps-basics

Conversation

@NikkiAung

Copy link
Copy Markdown
Contributor

Summary

Redo of #632 on top of current main (superseded by #656).

  • Replaces all inline-pinned [dev-dependencies] versions with .workspace = true across 25 native, pinocchio, and asm Cargo.toml files under basics/
  • Adds four new entries to [workspace.dependencies] for crates that were inline but missing from the workspace: solana-message, solana-signer, solana-rent, solana-transaction-error
  • Excludes cross-program-invocation/native (nested workspace, not a root workspace member) and all anchor sub-workspaces

Test plan

  • cargo metadata --no-deps resolves cleanly with zero errors
  • CI build matrix passes for all affected programs

🤖 Generated with Claude Code

Replaces inline-pinned [dev-dependencies] versions with .workspace = true
across 25 native, pinocchio, and asm Cargo.toml files under basics/.

Adds four new entries to [workspace.dependencies] to cover crates that
were pinned inline but not yet present in the workspace:
  solana-message, solana-signer, solana-rent, solana-transaction-error

Excludes cross-program-invocation/native (nested workspace, not a root
workspace member) and all anchor sub-workspaces.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@NikkiAung
NikkiAung requested a review from dev-jodee as a code owner July 31, 2026 02:39
@NikkiAung

Copy link
Copy Markdown
Contributor Author

Hi @dev-jodee, all CI checks are passing — would love to get your eyes on this when you get a chance!

@dev-jodee dev-jodee left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Removed the pnpm lock and those 2 projects don't use workspace

basics/checking-accounts/native/program/Cargo.toml and basics/checking-accounts/pinocchio/program/Cargo.toml.

Comment thread basics/counter/mpl-stack/pnpm-lock.yaml Outdated
@@ -0,0 +1,3737 @@
lockfileVersion: '9.0'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this file seems to be added by mistake, lets remove that

…ecking-accounts Cargo.tomls

- Remove basics/counter/mpl-stack/pnpm-lock.yaml (accidentally staged)
- Revert checking-accounts/native and checking-accounts/pinocchio dev-deps
  to inline pins — both use solana-sdk which is not in workspace, so they
  are excluded from the workspace dep migration

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@NikkiAung

Copy link
Copy Markdown
Contributor Author

Fixed both issues in the follow-up commit (21fb724):

  1. Accidental pnpm lock — removed basics/counter/mpl-stack/pnpm-lock.yaml (leftover from a previous session, shouldn't have been staged)
  2. checking-accounts/native + pinocchio — reverted their dev-deps back to inline pins since both use solana-sdk = "4.0.1" which isn't in the workspace, making them outliers from the migration

@greptile-apps

greptile-apps Bot commented Aug 1, 2026

Copy link
Copy Markdown

Greptile Summary

Centralizes shared Cargo dependency declarations without changing their effective constraints.

  • Adds solana-message, solana-rent, solana-signer, and solana-transaction-error to the root workspace dependency table.
  • Replaces matching inline dependency versions with workspace references across native, Pinocchio, and ASM examples under basics/.
  • Aligns the repository-layout native program’s regular dependencies with existing workspace declarations.

Confidence Score: 5/5

The PR appears safe to merge, with the changed manifests retaining equivalent dependency constraints through valid root-workspace references.

Every newly inherited dependency is declared in the root workspace, the migrated version constraints match the prior inline declarations, and no changed manifest crosses an incompatible workspace boundary.

Important Files Changed

Filename Overview
Cargo.toml Adds the shared dependency declarations required by the migrated manifests while preserving their prior version constraints.
basics/account-data/native/program/Cargo.toml Replaces inline development dependency constraints with equivalent workspace references.
basics/checking-accounts/asm/Cargo.toml Migrates development dependencies, including transaction-error, to declarations already present in the root workspace.
basics/counter/native/program/Cargo.toml Migrates the existing LiteSVM, Solana, and rent development dependencies to equivalent workspace references.
basics/repository-layout/native/program/Cargo.toml Migrates both regular and development dependencies to equivalent root workspace declarations.

Reviews (1): Last reviewed commit: "fix(#659): remove accidental pnpm lock a..." | Re-trigger Greptile

@NikkiAung

Copy link
Copy Markdown
Contributor Author

Hi @dev-jodee, both issues are addressed in 21fb724 — all CI checks are green again. Could you take another look when you get a chance? Thanks!

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