spl: fix metadata feature failing to build standalone#4742
Open
plutohan wants to merge 1 commit into
Open
Conversation
|
@plutohan is attempting to deploy a commit to the OtterSec Team on Vercel. A member of the Team first needs to authorize it. |
0eb6d7e to
1287232
Compare
Collaborator
|
Please use the suggested fix with |
jamie-osec
reviewed
Jun 30, 2026
Comment on lines
+25
to
+26
| "spl-token-interface", | ||
| "spl-associated-token-account-interface", |
Collaborator
There was a problem hiding this comment.
This is currently applied inconsistently in the codebase, but please use dep:<crate> syntax for new feature-dependencies as it makes them a little clearer.
Author
There was a problem hiding this comment.
Done. I switched these to dep:, and also flipped token/associated_token to dep: since using dep: for those crates drops their implicit feature, which the bare references relied on.
1287232 to
d05c987
Compare
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.
Fixes #3291.
cargo build -p anchor-spl --no-default-features --features metadatafails becausemetadata.rsusesspl_token_interface::IDandspl_associated_token_account_interface::program::ID, which are only pulled in by thetoken/associated_tokenfeatures. This enables those two (already optional) crates from themetadatafeature so it builds standalone. No code changes.Verified
--features metadatabuilds and the default build is unchanged.@acheroncrypto you suggested using the lighter
spl-associated-token-account-clientinstead. I went with the existing interface crates since it's a one-line change with no new deps, but can switch to the client crates if you'd prefer.