This repository was archived by the owner on Mar 11, 2025. It is now read-only.
program-error: Add option to specify solana_program crate #7112
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.
Problem
There are going to be a lot of issues with people seeing errors on
spl_program_error derivation. When a build pulls in two version of
solana_program, the macro uses
::solana_program
, which now becomesambiguous.
Summary of changes
I'm not sure if this is a good idea, but this PR gives the ability
to specify which version of
solana_program
to use when deriving thevarious traits on your error type.
Borsh has this same functionality, and it's saved us when pulling in
multiple versions of borsh in the SDK.
Note: this PR defaults to
solana_program
instead of::solana_program
, which might cause downstream issues.