Repository navigation
Conversation
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.
1 of 2 tasks
Contributor
[Medium impact] The PR appears safe to merge; no actionable issues remain. SummaryThe PR points deployment commands at the actual crate-named build files.
The earlier, unnumbered finding about deploying old builds is fixed: the affected scripts now stop before deployment when a build fails. No new actionable issues were found. Reviews (3) · Last reviewed commit: "chore: deploy the real artifact name so ..." · Reviewed by Greptile |
With the deploy path now a *.so glob, a failed cargo build-sbf could let the script deploy a .so left over from an earlier build. set -e ends the script at the failed build instead.
pnpm runs package.json scripts through cmd.exe on Windows, which does not expand globs, so 'solana program deploy ./program/target/so/*.so' only worked in POSIX shells. Deploy the file cargo build-sbf actually writes, <crate lib name>.so, in both package.json and cicd.sh. While checking every deploy path against its crate's artifact name: - seven native cicd.sh built without --sbf-out-dir and deployed ./program/target/deploy/program.so, which a workspace member never produces; build into ./program/target/so like the rest - four token-2022 native package.json deployed hello_solana_program.so (copy-paste) - seven pinocchio cicd.sh used the deprecated --bpf-out-dir; use --sbf-out-dir - cross-program-invocation/native deployed hand.so / lever.so and program.so; deploy the two crate-named artifacts, with pipefail since cicd.sh pipes into grep - counter/native README said 'pnpm deploy', which is pnpm's workspace command, not the script
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.
This was referenced Nov 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
deploynpm scripts andcicd.shin the native and Pinocchio examples ran:cargo build-sbf --sbf-out-dir=./program/target/sonames the artifact after the crate, notprogram(e.g.transfer_tokens_program.so), so the documented deploy step failed with "No such file".Every deploy command now names the file the build actually writes,
<crate lib name>.so, taken fromcargo metadataand cross-checked against the fixture each example's tests load:A
*.soglob would be shorter, but pnpm runspackage.jsonscripts throughcmd.exeon Windows, which passes the glob through literally, so the explicit name is the only form that works on every OS.Also fixed while checking every deploy path against its crate:
cicd.shbuilt without--sbf-out-dirand deployed./program/target/deploy/program.so, which a workspace member never produces. They now build into./program/target/solike the rest.package.jsondeployedhello_solana_program.so(copy-paste).cicd.shused the deprecated--bpf-out-dir; Anza v4'scargo build-sbfonly documents--sbf-out-dir.basics/cross-program-invocation/nativedeployedhand.so/lever.so(cicd.sh) andprogram.so(package.json). Both now deploy the two crate-named artifacts; the npm script chains them with&&, which works incmd.exetoo.cicd.shgetsset -e(andpipefailwhere it pipes intogrep), so a failed build stops before deploying.basics/counter/native/README.mdsaidpnpm deploy, which is pnpm's own workspace command, not the script; it now sayspnpm run deploy.basics/transfer-sol/asmbuilds withsbpfand is left alone.Testing
solana program deploypath in native/Pinocchiopackage.jsonandcicd.sh(96 commands) with<--sbf-out-dir>/<crate lib name>.sofromcargo metadata: 0 mismatches.cicd.sh: ranbash cicd.sh(realcargo build-sbf), thenpnpm run deploy, with a stand-insolanathat only acceptsprogram deploy <path>when the path is an SBF ELF the build produced. The same harness on currentmainfails on the broken examples, so it does catch them.package.jsonscript under pnpm 10.33.0 receives./program/target/so/*.soliterally (file not found), while the explicit path and the&&chain resolve.prettier --check .passes. CI doesn't rundeploy, so it is otherwise unaffected.AI disclosure
Check exactly one. See CONTRIBUTING.md.