@@ -8,38 +8,60 @@ HOST_PLATFORM="$(rustc --version --verbose | grep "host:" | awk '{ print $2 }')"
8
8
# which we do here.
9
9
# Further crates which appear only as dev-dependencies are pinned further down.
10
10
function PIN_RELEASE_DEPS {
11
- # Tokio MSRV on versions 1.17 through 1.26 is rustc 1.49. Above 1.26 MSRV is 1.56.
12
- [ " $RUSTC_MINOR_VERSION " -lt 49 ] && cargo update -p tokio --precise " 1.14.1" --verbose
13
- [[ " $RUSTC_MINOR_VERSION " -gt 48 && " $RUSTC_MINOR_VERSION " -lt 56 ]] && cargo update -p tokio --precise " 1.25.1" --verbose
14
-
15
- # Sadly the log crate is always a dependency of tokio until 1.20, and has no reasonable MSRV guarantees
16
- [ " $RUSTC_MINOR_VERSION " -lt 49 ] && cargo update -p log --precise " 0.4.18" --verbose
17
-
18
- # The serde_json crate switched to Rust edition 2021 starting with v1.0.101, i.e., has MSRV of 1.56
19
- [ " $RUSTC_MINOR_VERSION " -lt 56 ] && cargo update -p serde_json --precise " 1.0.100" --verbose
20
-
21
11
return 0 # Don't fail the script if our rustc is higher than the last check
22
12
}
23
13
24
- PIN_RELEASE_DEPS # pin the release dependencies in our main workspace
25
-
26
- # The addr2line v0.20 crate (a dependency of `backtrace` starting with 0.3.68) relies on 1.55+
27
- [ " $RUSTC_MINOR_VERSION " -lt 55 ] && cargo update -p backtrace --precise " 0.3.67" --verbose
28
-
29
- # The quote crate switched to Rust edition 2021 starting with v1.0.31, i.e., has MSRV of 1.56
30
- [ " $RUSTC_MINOR_VERSION " -lt 56 ] && cargo update -p quote --precise " 1.0.30" --verbose
14
+ # The tests of `lightning-transaction-sync` require `electrs` and `bitcoind`
15
+ # binaries. Here, we download the binaries, validate them, and export their
16
+ # location via `ELECTRS_EXE`/`BITCOIND_EXE` which will be used by the
17
+ # `electrsd`/`bitcoind` crates in our tests.
18
+ function DOWNLOAD_ELECTRS_AND_BITCOIND {
19
+ ELECTRS_DL_ENDPOINT=" https://github.com/RCasatta/electrsd/releases/download/electrs_releases"
20
+ ELECTRS_VERSION=" esplora_a33e97e1a1fc63fa9c20a116bb92579bbf43b254"
21
+ BITCOIND_DL_ENDPOINT=" https://bitcoincore.org/bin/"
22
+ BITCOIND_VERSION=" 25.1"
23
+ if [[ " $HOST_PLATFORM " == * linux* ]]; then
24
+ ELECTRS_DL_FILE_NAME=electrs_linux_" $ELECTRS_VERSION " .zip
25
+ ELECTRS_DL_HASH=" 865e26a96e8df77df01d96f2f569dcf9622fc87a8d99a9b8fe30861a4db9ddf1"
26
+ BITCOIND_DL_FILE_NAME=bitcoin-" $BITCOIND_VERSION " -x86_64-linux-gnu.tar.gz
27
+ BITCOIND_DL_HASH=" a978c407b497a727f0444156e397b50491ce862d1f906fef9b521415b3611c8b"
28
+ elif [[ " $HOST_PLATFORM " == * darwin* ]]; then
29
+ ELECTRS_DL_FILE_NAME=electrs_macos_" $ELECTRS_VERSION " .zip
30
+ ELECTRS_DL_HASH=" 2d5ff149e8a2482d3658e9b386830dfc40c8fbd7c175ca7cbac58240a9505bcd"
31
+ BITCOIND_DL_FILE_NAME=bitcoin-" $BITCOIND_VERSION " -x86_64-apple-darwin.tar.gz
32
+ BITCOIND_DL_HASH=" 1acfde0ec3128381b83e3e5f54d1c7907871d324549129592144dd12a821eff1"
33
+ else
34
+ echo -e " \n\nUnsupported platform. Exiting.."
35
+ exit 1
36
+ fi
37
+
38
+ DL_TMP_DIR=$( mktemp -d)
39
+ trap ' rm -rf -- "$DL_TMP_DIR"' EXIT
40
+
41
+ pushd " $DL_TMP_DIR "
42
+ ELECTRS_DL_URL=" $ELECTRS_DL_ENDPOINT " /" $ELECTRS_DL_FILE_NAME "
43
+ curl -L -o " $ELECTRS_DL_FILE_NAME " " $ELECTRS_DL_URL "
44
+ echo " $ELECTRS_DL_HASH $ELECTRS_DL_FILE_NAME " | shasum -a 256 -c
45
+ unzip " $ELECTRS_DL_FILE_NAME "
46
+ export ELECTRS_EXE=" $DL_TMP_DIR " /electrs
47
+ chmod +x " $ELECTRS_EXE "
48
+
49
+ BITCOIND_DL_URL=" $BITCOIND_DL_ENDPOINT " /bitcoin-core-" $BITCOIND_VERSION " /" $BITCOIND_DL_FILE_NAME "
50
+ curl -L -o " $BITCOIND_DL_FILE_NAME " " $BITCOIND_DL_URL "
51
+ echo " $BITCOIND_DL_HASH $BITCOIND_DL_FILE_NAME " | shasum -a 256 -c
52
+ tar xzf " $BITCOIND_DL_FILE_NAME "
53
+ export BITCOIND_EXE=" $DL_TMP_DIR " /bitcoin-" $BITCOIND_VERSION " /bin/bitcoind
54
+ chmod +x " $BITCOIND_EXE "
55
+ popd
56
+ }
31
57
32
- # The syn crate depends on too-new proc-macro2 starting with v2.0.33, i.e., has MSRV of 1.56
33
- if [ " $RUSTC_MINOR_VERSION " -lt 56 ]; then
34
- SYN_2_DEP=$( grep -o ' "syn 2.*' Cargo.lock | tr -d ' ",' | tr ' ' ' :' )
35
- cargo update -p " $SYN_2_DEP " --precise " 2.0.32" --verbose
36
- fi
58
+ PIN_RELEASE_DEPS # pin the release dependencies in our main workspace
37
59
38
- # The proc-macro2 crate switched to Rust edition 2021 starting with v1.0.66, i.e., has MSRV of 1.56
39
- [ " $RUSTC_MINOR_VERSION " -lt 56 ] && cargo update -p proc-macro2 --precise " 1.0.65 " --verbose
60
+ # Starting with version 1.10.0, the `regex` crate has an MSRV of rustc 1.65.0.
61
+ [ " $RUSTC_MINOR_VERSION " -lt 65 ] && cargo update -p regex --precise " 1.9.6 " --verbose
40
62
41
- # The memchr crate switched to an MSRV of 1.60 starting with v2.6.0
42
- [ " $RUSTC_MINOR_VERSION " -lt 60 ] && cargo update -p memchr --precise " 2.5.0 " --verbose
63
+ # The addr2line v0.21 crate (a dependency of `backtrace` starting with 0.3.69) relies on rustc 1.65
64
+ [ " $RUSTC_MINOR_VERSION " -lt 65 ] && cargo update -p backtrace --precise " 0.3.68 " --verbose
43
65
44
66
export RUST_BACKTRACE=1
45
67
@@ -59,17 +81,26 @@ cargo test --verbose --color always --features rpc-client,rest-client,tokio
59
81
cargo check --verbose --color always --features rpc-client,rest-client,tokio
60
82
popd
61
83
62
- if [[ $RUSTC_MINOR_VERSION -gt 67 && " $HOST_PLATFORM " != * windows* ]]; then
84
+ if [[ " $HOST_PLATFORM " != * windows* ]]; then
63
85
echo -e " \n\nBuilding and testing Transaction Sync Clients with features"
64
86
pushd lightning-transaction-sync
65
- cargo test --verbose --color always --features esplora-blocking
66
- cargo check --verbose --color always --features esplora-blocking
67
- cargo test --verbose --color always --features esplora-async
68
- cargo check --verbose --color always --features esplora-async
69
- cargo test --verbose --color always --features esplora-async-https
70
- cargo check --verbose --color always --features esplora-async-https
71
- cargo test --verbose --color always --features electrum
72
- cargo check --verbose --color always --features electrum
87
+
88
+ # reqwest 0.11.21 had a regression that broke its 1.63.0 MSRV
89
+ [ " $RUSTC_MINOR_VERSION " -lt 65 ] && cargo update -p reqwest --precise " 0.11.20" --verbose
90
+ # Starting with version 1.10.0, the `regex` crate has an MSRV of rustc 1.65.0.
91
+ [ " $RUSTC_MINOR_VERSION " -lt 65 ] && cargo update -p regex --precise " 1.9.6" --verbose
92
+
93
+ DOWNLOAD_ELECTRS_AND_BITCOIND
94
+
95
+ RUSTFLAGS=" --cfg no_download" cargo test --verbose --color always --features esplora-blocking
96
+ RUSTFLAGS=" --cfg no_download" cargo check --verbose --color always --features esplora-blocking
97
+ RUSTFLAGS=" --cfg no_download" cargo test --verbose --color always --features esplora-async
98
+ RUSTFLAGS=" --cfg no_download" cargo check --verbose --color always --features esplora-async
99
+ RUSTFLAGS=" --cfg no_download" cargo test --verbose --color always --features esplora-async-https
100
+ RUSTFLAGS=" --cfg no_download" cargo check --verbose --color always --features esplora-async-https
101
+ RUSTFLAGS=" --cfg no_download" cargo test --verbose --color always --features electrum
102
+ RUSTFLAGS=" --cfg no_download" cargo check --verbose --color always --features electrum
103
+
73
104
popd
74
105
fi
75
106
@@ -78,20 +109,16 @@ pushd lightning-background-processor
78
109
cargo test --verbose --color always --features futures
79
110
popd
80
111
81
- if [ " $RUSTC_MINOR_VERSION " -gt 55 ]; then
82
- echo -e " \n\nTest Custom Message Macros"
83
- pushd lightning-custom-message
84
- cargo test --verbose --color always
85
- [ " $CI_MINIMIZE_DISK_USAGE " != " " ] && cargo clean
86
- popd
87
- fi
112
+ echo -e " \n\nTest Custom Message Macros"
113
+ pushd lightning-custom-message
114
+ cargo test --verbose --color always
115
+ [ " $CI_MINIMIZE_DISK_USAGE " != " " ] && cargo clean
116
+ popd
88
117
89
- if [ " $RUSTC_MINOR_VERSION " -gt 51 ]; then # Current `object` MSRV, subject to change
90
- echo -e " \n\nTest backtrace-debug builds"
91
- pushd lightning
92
- cargo test --verbose --color always --features backtrace
93
- popd
94
- fi
118
+ echo -e " \n\nTest backtrace-debug builds"
119
+ pushd lightning
120
+ cargo test --verbose --color always --features backtrace
121
+ popd
95
122
96
123
echo -e " \n\nBuilding with all Log-Limiting features"
97
124
pushd lightning
@@ -102,13 +129,14 @@ popd
102
129
103
130
echo -e " \n\nTesting no-std flags in various combinations"
104
131
for DIR in lightning lightning-invoice lightning-rapid-gossip-sync; do
105
- [ " $RUSTC_MINOR_VERSION " -gt 50 ] && cargo test -p $DIR --verbose --color always --no-default-features --features no-std
132
+ cargo test -p $DIR --verbose --color always --no-default-features --features no-std
106
133
# check if there is a conflict between no-std and the default std feature
107
- [ " $RUSTC_MINOR_VERSION " -gt 50 ] && cargo test -p $DIR --verbose --color always --features no-std
134
+ cargo test -p $DIR --verbose --color always --features no-std
108
135
done
136
+
109
137
for DIR in lightning lightning-invoice lightning-rapid-gossip-sync; do
110
138
# check if there is a conflict between no-std and the c_bindings cfg
111
- [ " $RUSTC_MINOR_VERSION " -gt 50 ] && RUSTFLAGS=" --cfg=c_bindings" cargo test -p $DIR --verbose --color always --no-default-features --features=no-std
139
+ RUSTFLAGS=" --cfg=c_bindings" cargo test -p $DIR --verbose --color always --no-default-features --features=no-std
112
140
done
113
141
RUSTFLAGS=" --cfg=c_bindings" cargo test --verbose --color always
114
142
@@ -125,16 +153,7 @@ popd
125
153
echo -e " \n\nTesting no-std build on a downstream no-std crate"
126
154
# check no-std compatibility across dependencies
127
155
pushd no-std-check
128
- if [[ $RUSTC_MINOR_VERSION -gt 67 ]]; then
129
- # lightning-transaction-sync's MSRV is 1.67
130
- cargo check --verbose --color always --features lightning-transaction-sync
131
- else
132
- # The memchr crate switched to an MSRV of 1.60 starting with v2.6.0
133
- # This is currently only a release dependency via core2, which we intend to work with
134
- # rust-bitcoin to remove soon.
135
- [ " $RUSTC_MINOR_VERSION " -lt 60 ] && cargo update -p memchr --precise " 2.5.0" --verbose
136
- cargo check --verbose --color always
137
- fi
156
+ cargo check --verbose --color always --features lightning-transaction-sync
138
157
[ " $CI_MINIMIZE_DISK_USAGE " != " " ] && cargo clean
139
158
popd
140
159
0 commit comments