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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ jobs:
run: |
rustup target add thumbv7m-none-eabi
sudo apt-get -y install gcc-arm-none-eabi
- name: Check for unknown cfg tags
run: ci/check-cfg-flags.py
- name: shellcheck the CI script
if: "matrix.platform == 'ubuntu-latest'"
run: |
Expand Down
22 changes: 22 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,25 @@ panic = "abort"

[patch.crates-io.possiblyrandom]
path = "possiblyrandom"

[workspace.lints.rust.unexpected_cfgs]
level = "forbid"
# When adding a new cfg attribute, ensure that it is added to this list.
#
# Note that Cargo automatically declares corresponding cfgs for every feature
# defined in the member-level [features] tables as "expected".
check-cfg = [
"cfg(fuzzing)",
"cfg(secp256k1_fuzz)",
"cfg(hashes_fuzz)",
"cfg(test)",
"cfg(debug_assertions)",
"cfg(c_bindings)",
"cfg(ldk_bench)",
"cfg(taproot)",
"cfg(async_signing)",
"cfg(require_route_graph_test)",
"cfg(dual_funding)",
"cfg(splicing)",
"cfg(async_payments)",
]
170 changes: 0 additions & 170 deletions ci/check-cfg-flags.py

This file was deleted.

3 changes: 3 additions & 0 deletions lightning-background-processor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ tokio = { version = "1.35", features = [ "macros", "rt", "rt-multi-thread", "syn
lightning = { version = "0.0.123-beta", path = "../lightning", features = ["_test_utils"] }
lightning-invoice = { version = "0.31.0-beta", path = "../lightning-invoice" }
lightning-persister = { version = "0.0.123-beta", path = "../lightning-persister" }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions lightning-block-sync/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ chunked_transfer = { version = "1.4", optional = true }
[dev-dependencies]
lightning = { version = "0.0.123-beta", path = "../lightning", features = ["_test_utils"] }
tokio = { version = "1.35", features = [ "macros", "rt" ] }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions lightning-custom-message/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ rustdoc-args = ["--cfg", "docsrs"]
[dependencies]
bitcoin = "0.31.2"
lightning = { version = "0.0.123-beta", path = "../lightning" }

[lints]
workspace = true
4 changes: 4 additions & 0 deletions lightning-invoice/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.


[dependencies]
bech32 = { version = "0.9.1", default-features = false }
Expand All @@ -31,3 +32,6 @@ lightning = { version = "0.0.123-beta", path = "../lightning", default-features
hex = { package = "hex-conservative", version = "0.1.1", default-features = false }
serde_json = { version = "1"}
hashbrown = { version = "0.13", default-features = false }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions lightning-net-tokio/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ tokio = { version = "1.35", features = [ "rt", "sync", "net", "time" ] }
[dev-dependencies]
tokio = { version = "1.35", features = [ "macros", "rt", "rt-multi-thread", "sync", "net", "time" ] }
lightning = { version = "0.0.123-beta", path = "../lightning", features = ["_test_utils"] }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions lightning-persister/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ criterion = { version = "0.4", optional = true, default-features = false }
[dev-dependencies]
lightning = { version = "0.0.123-beta", path = "../lightning", features = ["_test_utils"] }
bitcoin = { version = "0.31.2", default-features = false }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions lightning-rapid-gossip-sync/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ criterion = { version = "0.4", optional = true, default-features = false }

[dev-dependencies]
lightning = { version = "0.0.123-beta", path = "../lightning", features = ["_test_utils"] }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions lightning-transaction-sync/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ electrsd = { version = "0.27.3", default-features = false, features = ["legacy",

[target.'cfg(all(not(target_os = "windows"), no_download))'.dev-dependencies]
electrsd = { version = "0.27.3", default-features = false, features = ["legacy"] }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions lightning/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,6 @@ criterion = { version = "0.4", optional = true, default-features = false }

[target.'cfg(taproot)'.dependencies]
musig2 = { git = "https://github.com/arik-so/rust-musig2", rev = "739533fc" }

[lints]
workspace = true
3 changes: 3 additions & 0 deletions possiblyrandom/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ getrandom = { version = "0.2", optional = true, default-features = false }
# Enable getrandom if we are on a platform that (likely) supports it
[target.'cfg(not(any(target_os = "unknown", target_os = "none")))'.dependencies]
getrandom = { version = "0.2", default-features = false }

[lints]
workspace = true
Loading