Skip to content

Add LTO flag for cargo-build-sbf#6384

Merged
LucasSte merged 3 commits intoanza-xyz:masterfrom
LucasSte:lto-build
Jun 6, 2025
Merged

Add LTO flag for cargo-build-sbf#6384
LucasSte merged 3 commits intoanza-xyz:masterfrom
LucasSte:lto-build

Conversation

@LucasSte
Copy link
Copy Markdown

@LucasSte LucasSte commented Jun 2, 2025

Problem

When anza-xyz/solana-sdk#138 is finally merged, we'll be able to use LTO with programs that include the program and the SDK onmicrates. The usage of LTO for all crates is a little shady in cargo, so I'm adding a flag to cargo-build-sbf specially to signal it.

Summary of Changes

  1. Create the --lto command line argument for cargo-build-sbf.
  2. Modify a test to use that argument.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jun 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.8%. Comparing base (54dd3ba) to head (09f7b68).
⚠️ Report is 3238 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##           master    #6384     +/-   ##
=========================================
- Coverage    82.8%    82.8%   -0.1%     
=========================================
  Files         849      849             
  Lines      378935   378935             
=========================================
- Hits       313867   313846     -21     
- Misses      65068    65089     +21     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@LucasSte LucasSte marked this pull request as ready for review June 3, 2025 13:43
Lichtso
Lichtso previously approved these changes Jun 3, 2025
Comment thread platform-tools-sdk/cargo-build-sbf/src/main.rs Outdated
febo
febo previously approved these changes Jun 3, 2025
Copy link
Copy Markdown

@febo febo left a comment

Choose a reason for hiding this comment

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

Looks good – just one tiny nit. 😊

Comment thread platform-tools-sdk/cargo-build-sbf/src/main.rs
Co-authored-by: Fernando Otero <febo@anza.xyz>
@LucasSte LucasSte dismissed stale reviews from febo and Lichtso via 47576f3 June 4, 2025 13:40
@LucasSte LucasSte requested review from Lichtso and febo June 4, 2025 13:40
illia-bobyr
illia-bobyr previously approved these changes Jun 5, 2025
Copy link
Copy Markdown

@illia-bobyr illia-bobyr left a comment

Choose a reason for hiding this comment

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

If you do not want to add a comment on the default value, I think the change is good.

@LucasSte LucasSte merged commit 3e58350 into anza-xyz:master Jun 6, 2025
47 checks passed
@LucasSte LucasSte deleted the lto-build branch June 6, 2025 20:24
mircea-c pushed a commit to mircea-c/agave that referenced this pull request Jun 12, 2025
* Add LTO flag for cargo-build-sbf

* Update platform-tools-sdk/cargo-build-sbf/src/main.rs

Co-authored-by: Fernando Otero <febo@anza.xyz>

* Update lto help descrption

---------

Co-authored-by: Fernando Otero <febo@anza.xyz>
mircea-c added a commit to mircea-c/agave that referenced this pull request Jun 12, 2025
* Add LTO flag for cargo-build-sbf

* Update platform-tools-sdk/cargo-build-sbf/src/main.rs

Co-authored-by: Fernando Otero <febo@anza.xyz>

* Update lto help descrption

---------

Co-authored-by: Fernando Otero <febo@anza.xyz>
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.

5 participants