@@ -8,38 +8,60 @@ HOST_PLATFORM="$(rustc --version --verbose | grep "host:" | awk '{ print $2 }')"
88#  which we do here.
99#  Further crates which appear only as dev-dependencies are pinned further down.
1010function  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" 
13- 	[[ " $RUSTC_MINOR_VERSION " -gt  48  &&   " $RUSTC_MINOR_VERSION " -lt  56 ]] &&  cargo update -p tokio --precise " 1.25.1" 
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" 
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" 
20- 
2111	return  0 #  Don't fail the script if our rustc is higher than the last check
2212}
2313
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" 
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" 
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 " 
25+ 		ELECTRS_DL_HASH=" 865e26a96e8df77df01d96f2f569dcf9622fc87a8d99a9b8fe30861a4db9ddf1" 
26+ 		BITCOIND_DL_FILE_NAME=bitcoin-" $BITCOIND_VERSION " 
27+ 		BITCOIND_DL_HASH=" a978c407b497a727f0444156e397b50491ce862d1f906fef9b521415b3611c8b" 
28+ 	elif  [[ " $HOST_PLATFORM " ==  * darwin*  ]];  then 
29+ 		ELECTRS_DL_FILE_NAME=electrs_macos_" $ELECTRS_VERSION " 
30+ 		ELECTRS_DL_HASH=" 2d5ff149e8a2482d3658e9b386830dfc40c8fbd7c175ca7cbac58240a9505bcd" 
31+ 		BITCOIND_DL_FILE_NAME=bitcoin-" $BITCOIND_VERSION " 
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"' 
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 " 
47+ 	chmod +x " $ELECTRS_EXE " 
48+ 
49+ 	BITCOIND_DL_URL=" $BITCOIND_DL_ENDPOINT " " $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 " " $BITCOIND_VERSION " 
54+ 	chmod +x " $BITCOIND_EXE " 
55+ 	popd 
56+ }
3157
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.*' |  tr -d ' ",' |  tr '  ' ' :' ) 
35- 	cargo update -p " $SYN_2_DEP " " 2.0.32" 
36- fi 
58+ PIN_RELEASE_DEPS #  pin the release dependencies in our main workspace
3759
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 " 
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 " 
4062
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 " 
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 " 
4365
4466export  RUST_BACKTRACE=1
4567
@@ -59,17 +81,26 @@ cargo test --verbose --color always --features rpc-client,rest-client,tokio
5981cargo check --verbose --color always --features rpc-client,rest-client,tokio
6082popd 
6183
62- if  [[ $RUSTC_MINOR_VERSION   -gt  67  &&   " $HOST_PLATFORM " !=  * windows*  ]];  then 
84+ if  [[ " $HOST_PLATFORM " !=  * windows*  ]];  then 
6385	echo  -e " \n\nBuilding and testing Transaction Sync Clients with features" 
6486	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" 
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" 
92+ 
93+ 	DOWNLOAD_ELECTRS_AND_BITCOIND
94+ 
95+ 	RUSTFLAGS=" --cfg no_download" test  --verbose --color always --features esplora-blocking
96+ 	RUSTFLAGS=" --cfg no_download" 
97+ 	RUSTFLAGS=" --cfg no_download" test  --verbose --color always --features esplora-async
98+ 	RUSTFLAGS=" --cfg no_download" 
99+ 	RUSTFLAGS=" --cfg no_download" test  --verbose --color always --features esplora-async-https
100+ 	RUSTFLAGS=" --cfg no_download" 
101+ 	RUSTFLAGS=" --cfg no_download" test  --verbose --color always --features electrum
102+ 	RUSTFLAGS=" --cfg no_download" 
103+ 
73104	popd 
74105fi 
75106
@@ -78,20 +109,16 @@ pushd lightning-background-processor
78109cargo test  --verbose --color always --features futures
79110popd 
80111
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 
88117
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 
95122
96123echo  -e " \n\nBuilding with all Log-Limiting features" 
97124pushd  lightning
@@ -102,13 +129,14 @@ popd
102129
103130echo  -e " \n\nTesting no-std flags in various combinations" 
104131for  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
106133	#  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
108135done 
136+ 
109137for  DIR  in  lightning lightning-invoice lightning-rapid-gossip-sync;  do 
110138	#  check if there is a conflict between no-std and the c_bindings cfg
111- 	[  " $RUSTC_MINOR_VERSION "   -gt  50 ]  &&   RUSTFLAGS=" --cfg=c_bindings" test  -p $DIR  --verbose --color always --no-default-features --features=no-std
139+ 	RUSTFLAGS=" --cfg=c_bindings" test  -p $DIR  --verbose --color always --no-default-features --features=no-std
112140done 
113141RUSTFLAGS=" --cfg=c_bindings" test  --verbose --color always
114142
@@ -125,16 +153,7 @@ popd
125153echo  -e " \n\nTesting no-std build on a downstream no-std crate" 
126154#  check no-std compatibility across dependencies
127155pushd  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" 
136- 	cargo check --verbose --color always
137- fi 
156+ cargo check --verbose --color always --features lightning-transaction-sync
138157[ " $CI_MINIMIZE_DISK_USAGE " !=  " " &&  cargo clean
139158popd 
140159
0 commit comments