Skip to content

v2.3: Remove conditional feature as it is not supported (backport of #6577)#6607

Closed
mergify[bot] wants to merge 2 commits intov2.3from
mergify/bp/v2.3/pr-6577
Closed

v2.3: Remove conditional feature as it is not supported (backport of #6577)#6607
mergify[bot] wants to merge 2 commits intov2.3from
mergify/bp/v2.3/pr-6577

Conversation

@mergify
Copy link
Copy Markdown

@mergify mergify Bot commented Jun 16, 2025

Problem

Adding dependencies based on configuration values is currently not supported. Cargo generates an error when trying to build this crate (see #6440 (comment))

https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#platform-specific-dependencies

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.

Summary of Changes

Remove condition and add feature directly to dependency.

Fixes #


This is an automatic backport of pull request #6577 done by [Mergify](https://mergify.com).

* remove condition as it is not supported

* remove useless whitespace to fix sort

(cherry picked from commit 51c33c2)

# Conflicts:
#	svm/Cargo.toml
@mergify mergify Bot requested a review from a team as a code owner June 16, 2025 18:56
@mergify mergify Bot added the conflicts label Jun 16, 2025
@mergify
Copy link
Copy Markdown
Author

mergify Bot commented Jun 16, 2025

Cherry-pick of 51c33c2 has failed:

On branch mergify/bp/v2.3/pr-6577
Your branch is up to date with 'origin/v2.3'.

You are currently cherry-picking commit 51c33c2f3.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   svm/Cargo.toml

no changes added to commit (use "git add" and/or "git commit -a")

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.8%. Comparing base (3e1c3a2) to head (f1bd7bc).

Additional details and impacted files
@@            Coverage Diff            @@
##             v2.3    #6607     +/-   ##
=========================================
- Coverage    82.8%    82.8%   -0.1%     
=========================================
  Files         848      848             
  Lines      379542   379542             
=========================================
- Hits       314575   314524     -51     
- Misses      64967    65018     +51     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread svm/Cargo.toml
solana-sysvar-id = { workspace = true }
solana-timings = { workspace = true }
solana-transaction-context = { workspace = true }
solana-transaction-context = { workspace = true, features = ["debug-signature"] }
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

the dependency should be redeclared with the feature flag in [dev-dependencies], not added to prod [dependencies]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Crate publishing fails if the feature is not added to [dependencies]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

something else is wrong then. this should never be used in prod

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

p sure this should be gated by the cargo feature, not debug_assertions.

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

don't see any other usage of the tx-ctx symbols behind that feature

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

honestly deleting the Signature bs might be the way to go? don't see it touched anywhere

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@Lichtso @LucasSte is this debug signature stuff dead code? can't find it used otherwise in monorepo or sdk

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

https://github.com/anza-xyz/agave/blob/master/transaction-context/src/lib.rs#L180C5-L186C26

sure. saw that. was more concerned that it's not actually read anywhere in the codebase other than implicitly through PartialEq, but don't actually see an instance of (a sanely named instantiation of) TransactionContext equality comparison in a debug_assert

But yes, can be deleted if it causes too much trouble with dependencies.

@mircea-c
Copy link
Copy Markdown

Closing this as the code has been removed by #6647

@mircea-c mircea-c closed this Jun 20, 2025
@yihau yihau deleted the mergify/bp/v2.3/pr-6577 branch December 5, 2025 12:00
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