Skip to content

Add feature to svm deps#6440

Merged
steviez merged 9 commits intoanza-xyz:masterfrom
mircea-c:mc/svm-feature-fix
Jun 11, 2025
Merged

Add feature to svm deps#6440
steviez merged 9 commits intoanza-xyz:masterfrom
mircea-c:mc/svm-feature-fix

Conversation

@mircea-c
Copy link
Copy Markdown

@mircea-c mircea-c commented Jun 6, 2025

Problem

Publishing this crate fails because of missing features

Summary of Changes

Add debug-signature feature to the dependencies that require it.

Required to fix CI for #6332

@mircea-c mircea-c requested review from steviez and yihau June 6, 2025 07:10
@mircea-c mircea-c self-assigned this Jun 6, 2025
@mircea-c mircea-c requested a review from a team as a code owner June 6, 2025 07:10
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jun 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.8%. Comparing base (1ecf042) to head (179f112).
Report is 4 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #6440    +/-   ##
========================================
  Coverage    82.7%    82.8%            
========================================
  Files         851      851            
  Lines      380034   379954    -80     
========================================
+ Hits       314668   314748    +80     
+ Misses      65366    65206   -160     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@LucasSte
Copy link
Copy Markdown

LucasSte commented Jun 6, 2025

It looks like the feature is only necessary when we build with debug_assertions:

#[cfg(debug_assertions)]
transaction_context.set_signature(tx.signature());

Would something like this in the toml file work?

[target.'cfg(debug_assertions)'.dependencies]
solana-transaction-context = { workspace = true, features = ["debug-signature"] }

@mircea-c
Copy link
Copy Markdown
Author

mircea-c commented Jun 6, 2025

@LucasSte that works. I've added the line to the manifest.

@mircea-c mircea-c added the v2.3 label Jun 6, 2025
@mergify
Copy link
Copy Markdown

mergify Bot commented Jun 6, 2025

Backports to the beta branch are to be avoided unless absolutely necessary for fixing bugs, security issues, and perf regressions. Changes intended for backport should be structured such that a minimum effective diff can be committed separately from any refactoring, plumbing, cleanup, etc that are not strictly necessary to achieve the goal. Any of the latter should go only into master and ride the normal stabilization schedule. Exceptions include CI/metrics changes, CLI improvements and documentation updates on a case by case basis.

Comment thread svm/Cargo.toml Outdated
Comment thread svm/Cargo.toml Outdated
@mircea-c mircea-c requested review from LucasSte and steviez June 11, 2025 18:10
@mircea-c
Copy link
Copy Markdown
Author

I think this is ready to go. I've sorted the dependencies and the publish simulator passes with this change.

Comment thread svm/Cargo.toml
Copy link
Copy Markdown

@steviez steviez left a comment

Choose a reason for hiding this comment

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

Assuming CI passes, :shipit:

@steviez steviez merged commit b22b23f into anza-xyz:master Jun 11, 2025
37 checks passed
mergify Bot pushed a commit that referenced this pull request Jun 11, 2025
(cherry picked from commit b22b23f)

# Conflicts:
#	svm/Cargo.toml
steviez added a commit that referenced this pull request Jun 12, 2025
(cherry picked from commit b22b23f)

---------

Co-authored-by: Mircea Colonescu <me_mircea@hotmail.com>
Co-authored-by: steviez <steven@anza.xyz>
@mircea-c mircea-c deleted the mc/svm-feature-fix branch June 12, 2025 13:38
@steviez
Copy link
Copy Markdown

steviez commented Jun 12, 2025

I got the following warning building the tip of master:

warning: /home/sol/src/agave/svm/Cargo.toml: Found `debug_assertions` in `target.'cfg(...)'.dependencies`. This value is not supported for selecting dependencies and will not work as expected. To learn more visit https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#platform-specific-dependencies

Looking up the docs here:

Unlike in your Rust source code, you cannot use [target.'cfg(feature = "fancy-feature")'.dependencies] to add dependencies based on optional features. Use the [features] section instead:
...
The same applies to cfg(debug_assertions), cfg(test) and cfg(proc_macro). These values will not work as expected and will always have the default value returned by rustc --print=cfg. There is currently no way to add dependencies based on these configuration values.

@mircea-c
Copy link
Copy Markdown
Author

@steviez was this when trying to build? Why did CI pass 😅 ?

@steviez
Copy link
Copy Markdown

steviez commented Jun 12, 2025

@steviez was this when trying to build? Why did CI pass 😅 ?

It was just a warning, we've discussed failing for warnings previously but not actually in there right now.

If you checkout tip-of-master and just run cargo build for any crate, you should see it at the top (ie before any new crates are downloaded)

@mircea-c
Copy link
Copy Markdown
Author

K, I got the same warning when trying to build. I'll submit a new PR which reverts this change and instead adds the feature to the dep.

From that warning message and what I could find in the rust docs, that target simply does nothing.

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.

4 participants