Skip to content

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

Closed
MarkFeder wants to merge 1 commit into
solana-foundation:mainfrom
MarkFeder:chore-fix-pinocchio-native-deploy-paths
Closed

MarkFeder wants to merge 1 commit into
solana-foundation:mainfrom
MarkFeder:chore-fix-pinocchio-native-deploy-paths

Conversation

@MarkFeder

@MarkFeder MarkFeder commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Linked issue

Fixes #787

What and why

The deploy npm script and cicd.sh in the native and Pinocchio examples run:

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. token_2022_transfer_fee_pinocchio_program.so, transfer_tokens_program.so), so the documented deploy step fails with "No such file".

This switches both to a glob, which resolves to the one artifact in each single-program example (75 files):

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

Left unchanged:

  • basics/transfer-sol/asm builds with sbpf, which uses a different output layout and artifact name; it needs its own fix.
  • basics/cross-program-invocation builds more than one .so, and solana program deploy takes a single path. Its cicd.sh already deploys each program explicitly.

This came out of a review comment on #701, where the same template line was flagged; fixing it repo-wide keeps the examples consistent.

Testing

CI doesn't run deploy (it builds into ./tests/fixtures via build-and-test), so this doesn't affect CI. Verified locally that pnpm build emits the crate-named .so and the glob resolves to it, and prettier --check passes. After rebasing onto current main, no newer example still uses the old path.

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 and write this description; I reviewed the changes.

@MarkFeder
MarkFeder requested a review from dev-jodee as a code owner August 26, 2026 21:01
@greptile-apps

greptile-apps Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; no actionable issues remain.

Summary

Replaces the hardcoded program.so deploy path with *.so across 75 files in single-program examples.

  • Example deploy commands now find the program file built in each folder.

Reviews (3) · Last reviewed commit: "chore: fix deploy artifact path in examp..." · Reviewed by Greptile

@MarkFeder

Copy link
Copy Markdown
Contributor Author

@amilz could you take a look at this one when you get a chance?

No open review threads left on it, so it is ready for maintainer review. It is one of 23 open Pinocchio ports I have up — they are independent and self-contained, so they can be reviewed and merged in any order: https://github.com/solana-developers/program-examples/pulls/MarkFeder

@MarkFeder

Copy link
Copy Markdown
Contributor Author

@dev-jodee friendly ping, could you review this when you get a chance? CI is green and it's mergeable. Thanks!

@MarkFeder

Copy link
Copy Markdown
Contributor Author

@dev-jodee gentle ping: this has been open since Aug 26 with no review. It's still green and mergeable, and I'm happy to rebase or change anything. These 3 are also what's blocking me from reopening the closed ports under the 3-PR limit. Thanks!

The `build`/`deploy` npm scripts and cicd.sh deploy `program.so`, but
`cargo build-sbf --sbf-out-dir=./program/target/so` emits an artifact named
after the crate (e.g. `token_2022_transfer_fee_pinocchio_program.so`), so the
documented `solana program deploy` step fails to find the file.

Use a `*.so` glob so the deploy step resolves the built artifact regardless of
its crate-derived name, across the single-program native and pinocchio
examples. CI is unaffected (it builds to ./tests/fixtures and never runs
deploy).

Excluded:
- The asm example (basics/transfer-sol/asm): it uses the sbpf toolchain with a
  different output layout and artifact name; it needs a separate fix.
- Multi-program examples (basics/cross-program-invocation): their build emits
  more than one .so, so a single glob would pass multiple paths to
  `solana program deploy`, which takes one. Left unchanged.
@MarkFeder
MarkFeder force-pushed the chore-fix-pinocchio-native-deploy-paths branch from 11ef181 to c446ff3 Compare November 4, 2026 18:21
@github-actions github-actions Bot added the needs-issue PR does not reference an issue a maintainer has accepted label Nov 4, 2026
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Hi @MarkFeder,

Thanks for the pull request. We ask that every change references an issue a maintainer has accepted, and there isn't one linked here.

These examples are a teaching resource and each one has to stay small enough to read in one sitting, so whether a new example or framework flavor belongs here is worth settling before anyone writes it. Agreeing on the approach in an issue first means nobody writes code that can't be merged. See CONTRIBUTING.md for the full workflow.

Please open an issue describing the change, or comment on the existing one. Once a maintainer has labelled it accepted, put Fixes #<issue> in this description and reopen this pull request; the check runs again and clears itself. Typos, broken links and comment-only fixes are exempt: write Linked issue: trivial instead.

@MarkFeder

Copy link
Copy Markdown
Contributor Author

Superseded by #794 (the bot closed this one and GitHub won't let me reopen it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-issue PR does not reference an issue a maintainer has accepted

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

1 participant