Skip to content

chore: fix deploy artifact path in example build scripts - #794

Merged
dev-jodee merged 1 commit into
solana-foundation:mainfrom
MarkFeder:chore-fix-pinocchio-native-deploy-paths
Nov 20, 2026
Merged

dev-jodee merged 1 commit into
solana-foundation:mainfrom
MarkFeder:chore-fix-pinocchio-native-deploy-paths

Conversation

@MarkFeder

@MarkFeder MarkFeder commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Linked issue

Fixes #787

Replaces #702, which the PR-hygiene bot closed before the issue was accepted; GitHub doesn't let the author reopen it.

What and why

The deploy npm script in the native and Pinocchio examples ran:

solana program deploy ./program/target/so/program.so

cargo build-sbf --sbf-out-dir=./program/target/so names the artifact after the crate, not program (e.g. transfer_tokens_program.so), so the documented deploy step failed with "No such file".

Each deploy now names the file the build actually writes, <crate lib name>.so, taken from cargo metadata and cross-checked against the fixture each example's tests load:

solana program deploy ./program/target/so/token_2022_transfer_fee_pinocchio_program.so

A *.so glob would be shorter, but pnpm runs package.json scripts through cmd.exe on Windows, which passes the glob through literally, so the explicit name is the form that works on every OS.

Also fixed while checking every deploy path against its crate:

  • Four token-2022 native examples deployed hello_solana_program.so (copy-paste).
  • basics/cross-program-invocation/native built into ./program/target/so and deployed program.so. It now builds into ./target/so and deploys both crate-named programs, chained with && (works in cmd.exe too).
  • basics/counter/native/README.md said pnpm deploy, which is pnpm's own workspace command, not the script; it now says pnpm run deploy.

Rebased onto #800, which removed the cicd.sh scripts, so this now only touches package.json deploy scripts and that README line.

Testing

  • A script compared every solana program deploy in native/Pinocchio package.json with <--sbf-out-dir>/<crate lib name>.so from cargo metadata: 50 single-program examples, 0 mismatches (cross-program-invocation checked by hand).
  • Before the rebase, in a Linux container: real cargo build-sbf followed by pnpm run deploy for every native/Pinocchio example, with a stand-in solana that only accepts program deploy <path> when the path is an SBF ELF the build produced. All passed; the same check fails on the old scripts.
  • On Windows, a package.json script under pnpm 10.33.0 receives ./program/target/so/*.so literally (file not found), while the explicit path and the && chain resolve.
  • prettier --check passes. CI doesn't run deploy, so it is otherwise unaffected.

AI disclosure

Check exactly one. See CONTRIBUTING.md.

  • No AI tooling was used beyond editor autocomplete.
  • AI tooling was used. Tool and extent: Claude Code helped make the edits, build the verification scripts and write this description; I reviewed the changes.

@greptile-apps

greptile-apps Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking issues were found.

Summary

Corrects deployment paths in native Rust and Pinocchio examples so the scripts name the files their builds produce.

  • Example deploy scripts now name the program files their builds create.
  • The cross-program example builds and deploys both of its programs.

No new actionable issues found.

Reviews (4) · Last reviewed commit: "chore: deploy the artifact the build wri..." · Reviewed by Greptile

Comment thread basics/account-data/native/cicd.sh Resolved
MarkFeder added a commit to MarkFeder/program-examples that referenced this pull request Nov 10, 2026
pnpm runs package.json scripts through cmd.exe on Windows, which does not expand the *.so glob. Name the file cargo build-sbf writes instead, matching solana-foundation#794.
MarkFeder added a commit to MarkFeder/program-examples that referenced this pull request Nov 10, 2026
pnpm runs package.json scripts through cmd.exe on Windows, which does not expand the *.so glob. Name the file cargo build-sbf writes instead, matching solana-foundation#794.
The deploy npm script in the native and pinocchio examples ran 'solana program deploy ./program/target/so/program.so', but cargo build-sbf names the artifact after the crate (e.g. transfer_tokens_program.so), so the documented deploy step failed with 'No such file'. Each deploy now names <crate lib name>.so. A *.so glob would be shorter, but pnpm runs package.json scripts through cmd.exe on Windows, which passes globs through literally.

Also:
- four token-2022 native examples deployed hello_solana_program.so (copy-paste)
- cross-program-invocation/native built into ./program/target/so and deployed program.so; it now builds into ./target/so and deploys both crate-named programs, chained with && (works in cmd.exe too)
- counter/native README said 'pnpm deploy', which is pnpm's workspace command, not the script
@MarkFeder
MarkFeder force-pushed the chore-fix-pinocchio-native-deploy-paths branch from 337e745 to ad2221f Compare November 18, 2026 20:20
MarkFeder added a commit to MarkFeder/program-examples that referenced this pull request Nov 18, 2026
pnpm runs package.json scripts through cmd.exe on Windows, which does not expand the *.so glob. Name the file cargo build-sbf writes instead, matching solana-foundation#794.
MarkFeder added a commit to MarkFeder/program-examples that referenced this pull request Nov 18, 2026
pnpm runs package.json scripts through cmd.exe on Windows, which does not expand the *.so glob. Name the file cargo build-sbf writes instead, matching solana-foundation#794.
@dev-jodee
dev-jodee merged commit dfccf86 into solana-foundation:main Nov 20, 2026
37 of 38 checks passed
MarkFeder added a commit to MarkFeder/program-examples that referenced this pull request Nov 20, 2026
pnpm runs package.json scripts through cmd.exe on Windows, which does not expand the *.so glob. Name the file cargo build-sbf writes instead, matching solana-foundation#794.
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.

native/pinocchio examples: deploy script points at program.so, which the build never produces

2 participants