Skip to content

Remove old program feature from cargo-build-sbf#5870

Merged
LucasSte merged 2 commits intoanza-xyz:masterfrom
LucasSte:no-old
Apr 24, 2025
Merged

Remove old program feature from cargo-build-sbf#5870
LucasSte merged 2 commits intoanza-xyz:masterfrom
LucasSte:no-old

Conversation

@LucasSte
Copy link
Copy Markdown

@LucasSte LucasSte commented Apr 17, 2025

Problem

For context, cargo-build-sbf --workspace is painfully slow to run, since it compiles each Solana package separately and does not re-use intermediate build objects. Invoking cargo +solana --workspace works 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 --workspace cargo argument instead of building each package individually.

One of the barriers now is the legacy_program_feature_present boolean used to include the --features=program to 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_present check and update the Changelog.

@LucasSte LucasSte requested review from Lichtso and joncinque April 17, 2025 16:54
@LucasSte LucasSte marked this pull request as ready for review April 17, 2025 16:54
Copy link
Copy Markdown

@joncinque joncinque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me! Just a comment for the changelog, let me know what you think

Comment thread CHANGELOG.md Outdated
Co-authored-by: Jon C <me@jonc.dev>
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.0%. Comparing base (246300b) to head (f623ec6).
⚠️ Report is 3591 commits behind head on master.

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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

@joncinque joncinque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@LucasSte LucasSte merged commit f83b28b into anza-xyz:master Apr 24, 2025
30 checks passed
@LucasSte LucasSte deleted the no-old branch June 2, 2025 18:57
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
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.

3 participants