Skip to content

Use native check-cfg lint in cargo beta #3173

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 15, 2024

Conversation

dunxen
Copy link
Contributor

@dunxen dunxen commented Jul 12, 2024

This uses the newly introduced conditional configuration checks that are now configurable withint Cargo (beta).

This allows us to get rid of our custom python script that checks for expected features and cfgs.

This does introduce a warning regarding the unknown lint in Cargo versions prior to the current beta, but since these are not rustc errors, they won't break any builds with the "-D warnings" RUSTFLAG.

Moving to this lint actually exposed the "strict" feature not being present in the lightning-invoice crate, as our python script didnt correctly parse the cfg_attr where it appeared.

Fixes #3119

This uses the newly introduced conditional configuration checks that are
now configurable withint Cargo (beta).

This allows us to get rid of our custom python script that checks for
expected features and cfgs.

This does introduce a warning regarding the unknown lint in Cargo
versions prior to the current beta, but since these are not rustc errors,
they won't break any builds with the "-D warnings" RUSTFLAG.

Moving to this lint actually exposed the "strict" feature not being
present in the lightning-invoice crate, as our python script didnt
correctly parse the cfg_attr where it appeared.
@dunxen dunxen requested a review from TheBlueMatt July 12, 2024 09:51
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.79%. Comparing base (78c0eaa) to head (99aa6e2).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3173      +/-   ##
==========================================
- Coverage   89.80%   89.79%   -0.02%     
==========================================
  Files         121      121              
  Lines      100045   100045              
  Branches   100045   100045              
==========================================
- Hits        89845    89831      -14     
- Misses       7533     7537       +4     
- Partials     2667     2677      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -18,6 +18,7 @@ rustdoc-args = ["--cfg", "docsrs"]
default = ["std"]
no-std = ["lightning/no-std"]
std = ["bitcoin/std", "lightning/std", "bech32/std"]
strict = []
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ha, it caught an issue, cool.

@TheBlueMatt TheBlueMatt merged commit ddb40bd into lightningdevkit:main Jul 15, 2024
16 of 17 checks passed
@dunxen dunxen deleted the 2024-07-cargocheckcfg branch January 20, 2025 08:32
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.

Use cargo's new built-in cfg flag list
4 participants