Skip to content

Commit ad462bd

Browse files
authored
Merge pull request #3528 from tnull/2025-01-introduce-secondary-msrv-1.75
Move `lightning-transaction-sync` tests to dedicated script
2 parents 7953b45 + cd5b4f7 commit ad462bd

File tree

7 files changed

+74
-50
lines changed

7 files changed

+74
-50
lines changed

.github/workflows/build.yml

+24-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
platform: [ ubuntu-latest, windows-latest, macos-latest ]
21-
toolchain: [ stable, beta, 1.63.0 ] # 1.63.0 is the MSRV for all crates.
21+
toolchain: [ stable, beta, 1.63.0 ] # 1.63.0 is the MSRV for all crates but `lightning-transaction-sync`.
2222
exclude:
2323
- platform: windows-latest
2424
toolchain: 1.63.0
@@ -44,6 +44,27 @@ jobs:
4444
- name: Set RUSTFLAGS to deny warnings
4545
if: "matrix.toolchain == '1.63.0'"
4646
run: echo "RUSTFLAGS=-D warnings" >> "$GITHUB_ENV"
47+
- name: Run CI script
48+
shell: bash # Default on Winblows is powershell
49+
run: CI_ENV=1 CI_MINIMIZE_DISK_USAGE=1 ./ci/ci-tests.sh
50+
51+
build-tx-sync:
52+
strategy:
53+
fail-fast: false
54+
matrix:
55+
platform: [ ubuntu-latest, macos-latest ]
56+
toolchain: [ stable, beta, 1.75.0 ] # 1.75.0 is the MSRV for `lightning-transaction-sync`.
57+
runs-on: ${{ matrix.platform }}
58+
steps:
59+
- name: Checkout source code
60+
uses: actions/checkout@v4
61+
- name: Install Rust ${{ matrix.toolchain }} toolchain
62+
run: |
63+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ matrix.toolchain }}
64+
rustup override set ${{ matrix.toolchain }}
65+
- name: Set RUSTFLAGS to deny warnings
66+
if: "matrix.toolchain == '1.75.0'"
67+
run: echo "RUSTFLAGS=-D warnings" >> "$GITHUB_ENV"
4768
- name: Enable caching for bitcoind
4869
id: cache-bitcoind
4970
uses: actions/cache@v4
@@ -57,7 +78,7 @@ jobs:
5778
path: bin/electrs-${{ runner.os }}-${{ runner.arch }}
5879
key: electrs-${{ runner.os }}-${{ runner.arch }}
5980
- name: Download bitcoind/electrs
60-
if: "matrix.platform != 'windows-latest' && (steps.cache-bitcoind.outputs.cache-hit != 'true' || steps.cache-electrs.outputs.cache-hit != 'true')"
81+
if: "steps.cache-bitcoind.outputs.cache-hit != 'true' || steps.cache-electrs.outputs.cache-hit != 'true'"
6182
run: |
6283
source ./contrib/download_bitcoind_electrs.sh
6384
mkdir bin
@@ -69,7 +90,7 @@ jobs:
6990
echo "ELECTRS_EXE=$( pwd )/bin/electrs-${{ runner.os }}-${{ runner.arch }}" >> "$GITHUB_ENV"
7091
- name: Run CI script
7192
shell: bash # Default on Winblows is powershell
72-
run: CI_ENV=1 CI_MINIMIZE_DISK_USAGE=1 ./ci/ci-tests.sh
93+
run: CI_ENV=1 CI_MINIMIZE_DISK_USAGE=1 ./ci/ci-tx-sync-tests.sh
7394

7495
coverage:
7596
strategy:

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ members = [
1313
"lightning-background-processor",
1414
"lightning-rapid-gossip-sync",
1515
"lightning-custom-message",
16-
"lightning-transaction-sync",
1716
"lightning-macros",
1817
"lightning-dns-resolver",
1918
"lightning-liquidity",
2019
"possiblyrandom",
2120
]
2221

2322
exclude = [
23+
"lightning-transaction-sync",
2424
"no-std-check",
2525
"msrv-no-dev-deps-check",
2626
"bench",

ci/ci-tests.sh

+2-39
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
set -eox pipefail
33

44
RUSTC_MINOR_VERSION=$(rustc --version | awk '{ split($2,a,"."); print a[2] }')
5-
HOST_PLATFORM="$(rustc --version --verbose | grep "host:" | awk '{ print $2 }')"
65

76
# Some crates require pinning to meet our MSRV even for our downstream users,
87
# which we do here.
@@ -11,19 +10,6 @@ function PIN_RELEASE_DEPS {
1110
# Starting with version 1.39.0, the `tokio` crate has an MSRV of rustc 1.70.0
1211
[ "$RUSTC_MINOR_VERSION" -lt 70 ] && cargo update -p tokio --precise "1.38.1" --verbose
1312

14-
# Starting with version 0.7.12, the `tokio-util` crate has an MSRV of rustc 1.70.0
15-
[ "$RUSTC_MINOR_VERSION" -lt 70 ] && cargo update -p tokio-util --precise "0.7.11" --verbose
16-
17-
# url 2.5.3 switched to idna 1.0.3 and ICU4X, which requires rustc 1.67 or newer.
18-
# Here we opt to keep using unicode-rs by pinning idna_adapter as described here: https://docs.rs/crate/idna_adapter/1.2.0
19-
[ "$RUSTC_MINOR_VERSION" -lt 67 ] && cargo update -p idna_adapter --precise "1.1.0" --verbose
20-
21-
# indexmap 2.6.0 upgraded to hashbrown 0.15, which unfortunately bumped their MSRV to rustc 1.65 with the 0.15.1 release (and 2.7.0 was released since).
22-
[ "$RUSTC_MINOR_VERSION" -lt 65 ] && cargo update -p [email protected] --precise "2.5.0" --verbose
23-
24-
# Starting with version 0.23.20, the `rustls` crate has an MSRV of rustc 1.71.0
25-
[ "$RUSTC_MINOR_VERSION" -lt 71 ] && cargo update -p [email protected] --precise "0.23.19" --verbose
26-
2713
return 0 # Don't fail the script if our rustc is higher than the last check
2814
}
2915

@@ -35,15 +21,12 @@ PIN_RELEASE_DEPS # pin the release dependencies in our main workspace
3521
# The addr2line v0.21 crate (a dependency of `backtrace` starting with 0.3.69) relies on rustc 1.65
3622
[ "$RUSTC_MINOR_VERSION" -lt 65 ] && cargo update -p backtrace --precise "0.3.68" --verbose
3723

38-
# Starting with version 0.5.9 (there is no .6-.8), the `home` crate has an MSRV of rustc 1.70.0.
39-
[ "$RUSTC_MINOR_VERSION" -lt 70 ] && cargo update -p home --precise "0.5.5" --verbose
40-
4124
# proptest 1.3.0 requires rustc 1.64.0
4225
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p proptest --precise "1.2.0" --verbose
4326

4427
export RUST_BACKTRACE=1
4528

46-
echo -e "\n\nChecking the full workspace."
29+
echo -e "\n\nChecking the workspace, except lightning-transaction-sync."
4730
cargo check --verbose --color always
4831

4932
# When the workspace members change, make sure to update the list here as well
@@ -58,7 +41,6 @@ WORKSPACE_MEMBERS=(
5841
lightning-background-processor
5942
lightning-rapid-gossip-sync
6043
lightning-custom-message
61-
lightning-transaction-sync
6244
lightning-macros
6345
lightning-dns-resolver
6446
lightning-liquidity
@@ -83,25 +65,6 @@ cargo check -p lightning-block-sync --verbose --color always --features rpc-clie
8365
cargo test -p lightning-block-sync --verbose --color always --features rpc-client,rest-client,tokio
8466
cargo check -p lightning-block-sync --verbose --color always --features rpc-client,rest-client,tokio
8567

86-
if [[ "$HOST_PLATFORM" != *windows* ]]; then
87-
echo -e "\n\nChecking Transaction Sync Clients with features."
88-
cargo check -p lightning-transaction-sync --verbose --color always --features esplora-blocking
89-
cargo check -p lightning-transaction-sync --verbose --color always --features esplora-async
90-
cargo check -p lightning-transaction-sync --verbose --color always --features esplora-async-https
91-
cargo check -p lightning-transaction-sync --verbose --color always --features electrum
92-
93-
if [ -z "$CI_ENV" ] && [[ -z "$BITCOIND_EXE" || -z "$ELECTRS_EXE" ]]; then
94-
echo -e "\n\nSkipping testing Transaction Sync Clients due to BITCOIND_EXE or ELECTRS_EXE being unset."
95-
cargo check -p lightning-transaction-sync --tests
96-
else
97-
echo -e "\n\nTesting Transaction Sync Clients with features."
98-
cargo test -p lightning-transaction-sync --verbose --color always --features esplora-blocking
99-
cargo test -p lightning-transaction-sync --verbose --color always --features esplora-async
100-
cargo test -p lightning-transaction-sync --verbose --color always --features esplora-async-https
101-
cargo test -p lightning-transaction-sync --verbose --color always --features electrum
102-
fi
103-
fi
104-
10568
echo -e "\n\nTest futures builds"
10669
cargo test -p lightning-background-processor --verbose --color always --features futures
10770
cargo test -p lightning-background-processor --verbose --color always --features futures --no-default-features
@@ -145,7 +108,7 @@ cargo test -p lightning-invoice --verbose --color always --no-default-features -
145108
echo -e "\n\nTesting no_std build on a downstream no-std crate"
146109
# check no-std compatibility across dependencies
147110
pushd no-std-check
148-
cargo check --verbose --color always --features lightning-transaction-sync
111+
cargo check --verbose --color always
149112
[ "$CI_MINIMIZE_DISK_USAGE" != "" ] && cargo clean
150113
popd
151114

ci/ci-tx-sync-tests.sh

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash
2+
set -eox pipefail
3+
4+
RUSTC_MINOR_VERSION=$(rustc --version | awk '{ split($2,a,"."); print a[2] }')
5+
6+
pushd lightning-transaction-sync
7+
8+
# Some crates require pinning to meet our MSRV even for our downstream users,
9+
# which we do here.
10+
# Further crates which appear only as dev-dependencies are pinned further down.
11+
function PIN_RELEASE_DEPS {
12+
return 0 # Don't fail the script if our rustc is higher than the last check
13+
}
14+
15+
PIN_RELEASE_DEPS # pin the release dependencies
16+
17+
# Starting with version 0.5.11, the `home` crate has an MSRV of rustc 1.81.0.
18+
[ "$RUSTC_MINOR_VERSION" -lt 81 ] && cargo update -p home --precise "0.5.9" --verbose
19+
20+
export RUST_BACKTRACE=1
21+
22+
echo -e "\n\nChecking Transaction Sync Clients with features."
23+
cargo check --verbose --color always --features esplora-blocking
24+
cargo check --verbose --color always --features esplora-async
25+
cargo check --verbose --color always --features esplora-async-https
26+
cargo check --verbose --color always --features electrum
27+
28+
if [ -z "$CI_ENV" ] && [[ -z "$BITCOIND_EXE" || -z "$ELECTRS_EXE" ]]; then
29+
echo -e "\n\nSkipping testing Transaction Sync Clients due to BITCOIND_EXE or ELECTRS_EXE being unset."
30+
cargo check --tests
31+
else
32+
echo -e "\n\nTesting Transaction Sync Clients with features."
33+
cargo test --verbose --color always --features esplora-blocking
34+
cargo test --verbose --color always --features esplora-async
35+
cargo test --verbose --color always --features esplora-async-https
36+
cargo test --verbose --color always --features electrum
37+
fi
38+
39+
popd

lightning-transaction-sync/Cargo.toml

+8-2
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,11 @@ tokio = { version = "1.35.0", features = ["macros"] }
3737
[target.'cfg(not(target_os = "windows"))'.dev-dependencies]
3838
electrsd = { version = "0.28.0", default-features = false, features = ["legacy"] }
3939

40-
[lints]
41-
workspace = true
40+
[lints.rust.unexpected_cfgs]
41+
level = "forbid"
42+
# When adding a new cfg attribute, ensure that it is added to this list.
43+
#
44+
# Note that Cargo automatically declares corresponding cfgs for every feature
45+
# defined in the member-level [features] tables as "expected".
46+
check-cfg = [
47+
]

msrv-no-dev-deps-check/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ edition = "2021"
66
[dependencies]
77
lightning = { path = "../lightning" }
88
lightning-block-sync = { path = "../lightning-block-sync", features = [ "rest-client", "rpc-client" ] }
9-
lightning-transaction-sync = { path = "../lightning-transaction-sync", features = [ "esplora-async-https", "electrum" ] }
109
lightning-invoice = { path = "../lightning-invoice" }
1110
lightning-net-tokio = { path = "../lightning-net-tokio" }
1211
lightning-persister = { path = "../lightning-persister" }

no-std-check/Cargo.toml

-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,3 @@ lightning = { path = "../lightning", default-features = false }
1111
lightning-invoice = { path = "../lightning-invoice", default-features = false }
1212
lightning-rapid-gossip-sync = { path = "../lightning-rapid-gossip-sync", default-features = false }
1313
lightning-background-processor = { path = "../lightning-background-processor", features = ["futures"], default-features = false }
14-
15-
# Obviously lightning-transaction-sync doesn't support no-std, but it should build
16-
# even if lightning is built with no-std.
17-
lightning-transaction-sync = { path = "../lightning-transaction-sync", optional = true }

0 commit comments

Comments
 (0)