Remove old program feature from cargo-build-sbf#5870
Merged
LucasSte merged 2 commits intoanza-xyz:masterfrom Apr 24, 2025
Merged
Remove old program feature from cargo-build-sbf#5870LucasSte merged 2 commits intoanza-xyz:masterfrom
cargo-build-sbf#5870LucasSte merged 2 commits intoanza-xyz:masterfrom
Conversation
joncinque
reviewed
Apr 21, 2025
joncinque
left a comment
There was a problem hiding this comment.
Looks great to me! Just a comment for the changelog, let me know what you think
Co-authored-by: Jon C <me@jonc.dev>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5870 +/- ##
=======================================
Coverage 83.0% 83.0%
=======================================
Files 828 828
Lines 376024 376024
=======================================
+ Hits 312154 312175 +21
+ Misses 63870 63849 -21 🚀 New features to boost your workflow:
|
joncinque
added a commit
to joncinque/solana-sdk
that referenced
this pull request
Jul 25, 2025
#### Problem The `program` feature has existed since v1.3 so that people can use solana-sdk in on-chain programs. `cargo-build-sbf` even had a special case where it would enable the `program` feature when building solana-sdk, but it was removed in anza-xyz/agave#5870. This means that our current build-sbf script fails when using v2.3 of the tools. #### Summary of changes Remove the `program` feature from the sdk, and fix the build-sbf script to exclude the sdk, and then try to build without default features. Rather than adding more excludes, I also changes the build-sbf script to use `cargo hack`, which is a bit cleaner.
joncinque
added a commit
to anza-xyz/solana-sdk
that referenced
this pull request
Jul 28, 2025
* sdk!: Remove `program` feature #### Problem The `program` feature has existed since v1.3 so that people can use solana-sdk in on-chain programs. `cargo-build-sbf` even had a special case where it would enable the `program` feature when building solana-sdk, but it was removed in anza-xyz/agave#5870. This means that our current build-sbf script fails when using v2.3 of the tools. #### Summary of changes Remove the `program` feature from the sdk, and fix the build-sbf script to exclude the sdk, and then try to build without default features. Rather than adding more excludes, I also changes the build-sbf script to use `cargo hack`, which is a bit cleaner. * Exclude solana-sdk
febo
pushed a commit
to febo/solana-sdk
that referenced
this pull request
Sep 21, 2025
* sdk!: Remove `program` feature #### Problem The `program` feature has existed since v1.3 so that people can use solana-sdk in on-chain programs. `cargo-build-sbf` even had a special case where it would enable the `program` feature when building solana-sdk, but it was removed in anza-xyz/agave#5870. This means that our current build-sbf script fails when using v2.3 of the tools. #### Summary of changes Remove the `program` feature from the sdk, and fix the build-sbf script to exclude the sdk, and then try to build without default features. Rather than adding more excludes, I also changes the build-sbf script to use `cargo hack`, which is a bit cleaner. * Exclude solana-sdk
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.
Problem
For context,
cargo-build-sbf --workspaceis painfully slow to run, since it compiles each Solana package separately and does not re-use intermediate build objects. Invokingcargo +solana --workspaceworks flawlessly for the SBF target and is our choice for CI for a couple of months now. I am refactoring the tool to use the--workspacecargo argument instead of building each package individually.One of the barriers now is the
legacy_program_feature_presentboolean used to include the--features=programto cargo when building the Solana-program package from a time when it was part of Solana SDK crate. Solana-program became a separate crate in Solana v1.3 (see solana-labs#12989) in October 2020.It has been more than enough time for programs to adapt and migrate to newer Solana versions that won't need the extra argument anymore, so I deem safe to remove the feature by now.
Summary of Changes
Remove the
legacy_program_feature_presentcheck and update the Changelog.