Skip to content

Conversation

@hugo-stacks
Copy link

This PR forces the use of the parser v2 when the devtools cargo feature flag is enabled.
This feature flag is also used to enable directly calling private_function.
Clarinet has been forcing parser v2 for the past ~3 years by forcing contract the epoch on contracts to be >= 2.1. But it has a few unwanted side effects.

This will eventually become unnecessary when we are able to merge #3662, but for now, the block validation is failing.

By adding this check here with the feature flag, we'll be able to remove the epoch hack in Clarinet.

brice-stacks
brice-stacks previously approved these changes Dec 16, 2025
Copy link
Contributor

@brice-stacks brice-stacks left a comment

Choose a reason for hiding this comment

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

This looks good, thanks! I just commented on one little nit about the style used for the feature-gating.

brice-stacks
brice-stacks previously approved these changes Dec 17, 2025
Copy link
Contributor

@federico-stacks federico-stacks left a comment

Choose a reason for hiding this comment

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

Heads up: I allowed the CI workflow execution, and it surfaced a Rust formatting issue.

@hugo-stacks
Copy link
Author

Thanks @federico-stacks, that should be good

Comment on lines 62 to 63
#[cfg(feature = "devtools")]
#[allow(unused_variables)]
Copy link
Author

Choose a reason for hiding this comment

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

I explicitly wanted to allow it only if feature = "devtools", so that it's more obvious that the argument can be removed when #3662 is resolved

Copy link
Contributor

Choose a reason for hiding this comment

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

or you could just mention this fact in a comment, even referencing the issue (if clippy doesn't ask for it) :)

Copy link
Author

Choose a reason for hiding this comment

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

Yeah actually my approach doesn't work, #[cfg(feature = "devtools")] is applied to the epoch_id, removing the argument totally. I just wanted it to apply to the clippy rule but that was dumb

Copy link
Contributor

@federico-stacks federico-stacks left a comment

Choose a reason for hiding this comment

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

clippy issue this time :)

You probably already know, but just in case: you can save some time by running these locally to check formatting and clippy warnings:

  • cargo fmt-stacks
  • cargo clippy-stacks

(dnd current rust version is 1.92.0)

Comment on lines 62 to 63
#[cfg(feature = "devtools")]
#[allow(unused_variables)]
Copy link
Contributor

Choose a reason for hiding this comment

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

or you could just mention this fact in a comment, even referencing the issue (if clippy doesn't ask for it) :)

@hugo-stacks
Copy link
Author

Yeah clippy was already complaining after the first commit/ And I made it worse in the second commit (completely broke it). Should be good now

@codecov
Copy link

codecov bot commented Dec 19, 2025

Codecov Report

❌ Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 57.86%. Comparing base (e156f8d) to head (aadeb35).

Files with missing lines Patch % Lines
clarity/src/vm/ast/mod.rs 87.50% 1 Missing ⚠️

❌ Your project check has failed because the head coverage (57.86%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff              @@
##           develop    #6764       +/-   ##
============================================
- Coverage    68.57%   57.86%   -10.71%     
============================================
  Files          582      582               
  Lines       361458   361452        -6     
============================================
- Hits        247879   209167    -38712     
- Misses      113579   152285    +38706     
Files with missing lines Coverage Δ
clarity/src/vm/ast/mod.rs 44.38% <87.50%> (-26.47%) ⬇️

... and 438 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e156f8d...aadeb35. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.


[features]
default = ["rusqlite"]
default = ["devtools"]
Copy link
Contributor

Choose a reason for hiding this comment

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

This change is causing problems.

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