From 51f5bc881f051fa4c01fe086181bf25a5d3ae4b0 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Fri, 16 Aug 2024 20:32:58 +0000 Subject: [PATCH] Drop the `no-std` feature from `lightning-rapid-gossip-sync` Now that we don't have to have everything in our entire ecosystem use the same `std`/`no-std` feature combinations we should start by untangling our own features a bit. This takes another step by removing the `no-std` feature entirely from the `lightning-rapid-gossip-sync` crate and removing all feature implications on dependencies from the remaining `std` feature. --- ci/ci-tests.sh | 6 +++--- lightning-rapid-gossip-sync/Cargo.toml | 3 +-- lightning-rapid-gossip-sync/src/lib.rs | 4 ++-- no-std-check/Cargo.toml | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/ci/ci-tests.sh b/ci/ci-tests.sh index 5555667db..d41c86310 100755 --- a/ci/ci-tests.sh +++ b/ci/ci-tests.sh @@ -78,20 +78,20 @@ grep '^max_level_' lightning/Cargo.toml | awk '{ print $1 }'| while read -r FEAT done echo -e "\n\nTesting no-std builds" -for DIR in lightning-invoice; do +for DIR in lightning-invoice lightning-rapid-gossip-sync; do cargo test -p $DIR --verbose --color always --no-default-features # check if there is a conflict between no-std and the c_bindings cfg RUSTFLAGS="$RUSTFLAGS --cfg=c_bindings" cargo test -p $DIR --verbose --color always --no-default-features done echo -e "\n\nTesting no-std flags in various combinations" -for DIR in lightning lightning-rapid-gossip-sync; do +for DIR in lightning; do cargo test -p $DIR --verbose --color always --no-default-features --features no-std # check if there is a conflict between no-std and the default std feature cargo test -p $DIR --verbose --color always --features no-std done -for DIR in lightning lightning-rapid-gossip-sync; do +for DIR in lightning; do # check if there is a conflict between no-std and the c_bindings cfg RUSTFLAGS="$RUSTFLAGS --cfg=c_bindings" cargo test -p $DIR --verbose --color always --no-default-features --features=no-std done diff --git a/lightning-rapid-gossip-sync/Cargo.toml b/lightning-rapid-gossip-sync/Cargo.toml index 9d9f3d23e..425c2c97d 100644 --- a/lightning-rapid-gossip-sync/Cargo.toml +++ b/lightning-rapid-gossip-sync/Cargo.toml @@ -11,8 +11,7 @@ Utility to process gossip routing data from Rapid Gossip Sync Server. [features] default = ["std"] -no-std = ["lightning/no-std"] -std = ["lightning/std"] +std = [] [dependencies] lightning = { version = "0.0.123-beta", path = "../lightning", default-features = false } diff --git a/lightning-rapid-gossip-sync/src/lib.rs b/lightning-rapid-gossip-sync/src/lib.rs index 04b564f04..2bae65cb8 100644 --- a/lightning-rapid-gossip-sync/src/lib.rs +++ b/lightning-rapid-gossip-sync/src/lib.rs @@ -143,7 +143,7 @@ where /// /// `sync_path`: Path to the file where the gossip update data is located /// - #[cfg(all(feature = "std", not(feature = "no-std")))] + #[cfg(feature = "std")] pub fn sync_network_graph_with_file_path( &self, sync_path: &str, ) -> Result { @@ -191,7 +191,7 @@ where } } -#[cfg(all(feature = "std", not(feature = "no-std")))] +#[cfg(feature = "std")] #[cfg(test)] mod tests { use std::fs; diff --git a/no-std-check/Cargo.toml b/no-std-check/Cargo.toml index 056cb1d20..a94939eab 100644 --- a/no-std-check/Cargo.toml +++ b/no-std-check/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [features] -default = ["lightning/no-std", "lightning-rapid-gossip-sync/no-std"] +default = ["lightning/no-std"] [dependencies] lightning = { path = "../lightning", default-features = false } -- 2.39.5