Skip to content

feat(cli): add --artifacts-path flag to override .so program location#573

Open
procdump wants to merge 2 commits intosolana-foundation:mainfrom
procdump:artifacts_path
Open

feat(cli): add --artifacts-path flag to override .so program location#573
procdump wants to merge 2 commits intosolana-foundation:mainfrom
procdump:artifacts_path

Conversation

@procdump
Copy link
Contributor

@procdump procdump commented Mar 13, 2026

Summary

cargo-build-sbf --debug emits artifacts in target/deploy/debug on purpose to prevent accidental deployments on mainnet so in that sense:

  • Add --artifacts-path CLI flag to support loading debug-compiled .so programs (e.g. surfpool start --artifacts-path ./target/deploy/debug)
  • Thread artifacts_path through framework detection, .so existence checks, in-memory template generation, and the --watch file watcher

While working on this PR I've unearthed a calculation overflow bug in txtx-addon-network-svm (details in the PR): solana-foundation/txtx#399

Allow overriding the default `target/deploy` path for .so artifacts
with `--artifacts-path`. This enables loading debug-compiled programs
during local development (e.g. `surfpool start --artifacts-path
./target/deploy/debug`). The flag conflicts with `--network` to
prevent deploying debug builds to mainnet/devnet/testnet.

Threads artifacts_path through framework detection, .so existence
checks, in-memory template generation (bin_path injection), and the
file watcher.
Allow overriding the default target/deploy path for .so program
artifacts. Deployment always targets the local surfnet regardless
of --network or --rpc-url, so no conflicts are needed.
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.

1 participant