Skip to content

Commit

Permalink
Getting the CI working again.
Browse files Browse the repository at this point in the history
Raising the MSRV from 0.57 to 0.63. Lower rust versions became increasingly difficult to maintain.
  • Loading branch information
ulrichard committed Jan 5, 2024
1 parent f066e50 commit 616a72e
Show file tree
Hide file tree
Showing 7 changed files with 171 additions and 19 deletions.
14 changes: 4 additions & 10 deletions .github/workflows/cont_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
strategy:
matrix:
rust:
- 1.65.0 # STABLE
- 1.57.0 # MSRV
- 1.75.0 # STABLE
- 1.63.0 # MSRV
steps:
- name: checkout
uses: actions/checkout@v2
Expand All @@ -36,15 +36,9 @@ jobs:
- name: Update Cargo.lock
run: cargo update
- name: Pin dependencies for MSRV
if: matrix.rust == '1.57.0'
if: matrix.rust == '1.63.0'
run: |
cargo update -p log:0.4.20 --precise 0.4.18
cargo update -p tempfile --precise 3.6.0
cargo update -p webpki:0.22.4 --precise 0.22.0
cargo update -p rustls:0.20.9 --precise 0.20.8
cargo update -p sct:0.7.1 --precise 0.7.0
cargo update -p tokio:1.35.0 --precise 1.29.1
cargo update -p byteorder:1.5.0 --precise 1.4.3
cargo update -p home:0.5.9 --precise 0.5.5
- name: Build
run: cargo build
- name: Clippy
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ log = "^0.4"
rstest = "^0.11"
bdk-testutils = "^0.4"
bdk = { version = "0.28", default-features = true }
electrsd = { version = "0.21", features = ["bitcoind_22_0", "electrs_0_9_1"] }
electrsd = { version = "0.23", features = ["bitcoind_22_0", "electrs_0_9_1"] }
41 changes: 41 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
FROM rust:1.69-bookworm
ARG http_proxy
ENV http_proxy=$http_proxy
ENV https_proxy=$http_proxy
ENV HTTP_PROXY=$http_proxy
ENV HTTPS_PROXY=$http_proxy
RUN echo Acquire::http::Proxy "${http_proxy}"; > /etc/apt/apt.conf.d/70debconf

RUN apt-get update \
&& apt-get install --no-install-recommends -y \
eatmydata \
&& eatmydata apt-get -y dist-upgrade \
&& eatmydata apt-get install --no-install-recommends -y \
build-essential \
bash \
ca-certificates \
clang \
curl \
emscripten \
hunspell \
libclang-dev \
libssl-dev \
llvm \
pkg-config \
syslog-ng \
sudo \
&& eatmydata apt -y autoremove \
&& eatmydata apt clean \
&& rm -rf /var/lib/apt/lists/*

ARG UID
RUN useradd -m -u $UID satoshi
USER satoshi
WORKDIR /home/satoshi

RUN rustup component add clippy-preview \
&& rustup component add rustfmt
RUN rustup target add wasm32-unknown-unknown
RUN rustup target add wasm32-wasi
RUN rustup target add wasm32-unknown-emscripten

39 changes: 39 additions & 0 deletions Dockerfile_63
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
FROM rust:1.63-buster
ARG http_proxy
ENV http_proxy=$http_proxy
ENV https_proxy=$http_proxy
ENV HTTP_PROXY=$http_proxy
ENV HTTPS_PROXY=$http_proxy
RUN echo Acquire::http::Proxy "${http_proxy}"; > /etc/apt/apt.conf.d/70debconf

RUN apt-get update \
&& apt-get install --no-install-recommends -y \
eatmydata \
&& eatmydata apt-get -y dist-upgrade \
&& eatmydata apt-get install --no-install-recommends -y \
build-essential \
bash \
ca-certificates \
clang \
curl \
hunspell \
libclang-dev \
libssl-dev \
llvm \
pkg-config \
syslog-ng \
sudo \
&& eatmydata apt -y autoremove \
&& eatmydata apt clean \
&& rm -rf /var/lib/apt/lists/*

ARG UID
RUN useradd -m -u $UID satoshi
USER satoshi
WORKDIR /home/satoshi

RUN rustup component add clippy-preview \
&& rustup component add rustfmt
RUN rustup target add wasm32-unknown-unknown
RUN rustup target add wasm32-wasi

81 changes: 81 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
TAG := bdk-reserves
TAG_57 := bdk-reserves-57
TAG_63 := bdk-reserves-61
http_proxy ?= http://172.17.0.1:3128
DOCKER_RUN := docker run --interactive --rm \
-v ${PWD}:/home/satoshi \

build: builder
$(DOCKER_RUN) --tty ${TAG} cargo build

test: test_current test_63

test_current: builder
rm -f Cargo.lock
$(DOCKER_RUN) ${TAG} cargo test

test_57: builder_57
#rm -f Cargo.lock
#$(DOCKER_RUN) ${TAG_57} cargo update -p log:0.4.20 --precise 0.4.18
#$(DOCKER_RUN) ${TAG_57} cargo update -p tempfile --precise 3.6.0
#$(DOCKER_RUN) ${TAG_57} cargo update -p sct:0.7.1 --precise 0.7.0
$(DOCKER_RUN) ${TAG_57} cargo update -p zip:0.6.6 --precise 0.6.3 || true
$(DOCKER_RUN) ${TAG_57} cargo update -p rustls:0.21.10 --precise 0.21.1 || true
$(DOCKER_RUN) ${TAG_57} cargo update -p rustls:0.21.7 --precise 0.21.1 || true
$(DOCKER_RUN) ${TAG_57} cargo update -p rustls:0.21.4 --precise 0.21.1 || true
$(DOCKER_RUN) ${TAG_57} cargo update -p rustls:0.21.2 --precise 0.21.1 || true
$(DOCKER_RUN) ${TAG_57} cargo update -p rustls:0.20.9 --precise 0.20.8 || true
$(DOCKER_RUN) ${TAG_57} cargo update -p rustls-webpki:0.100.3 --precise 0.100.1 || true
$(DOCKER_RUN) ${TAG_57} cargo update -p rustls-webpki:0.101.4 --precise 0.101.1 || true
$(DOCKER_RUN) ${TAG_57} cargo update -p rustls-webpki:0.101.7 --precise 0.101.1 || true
$(DOCKER_RUN) ${TAG_57} cargo update -p crossbeam-utils:0.8.18 --precise 0.8.16 || true
$(DOCKER_RUN) ${TAG_57} cargo update -p tokio:1.35.1 --precise 1.29.1 || true
$(DOCKER_RUN) ${TAG_57} cargo update -p rustix:0.38.9 --precise 0.38.3 || true
$(DOCKER_RUN) ${TAG_57} cargo update -p ring:0.17.7 --precise 0.16.20 || true
$(DOCKER_RUN) ${TAG_57} cargo update -p byteorder:1.5.0 --precise 0.4.3 || true
$(DOCKER_RUN) ${TAG_57} cargo update -p webpki:0.22.4 --precise 0.22.0 || true
$(DOCKER_RUN) ${TAG_57} cargo update -p crossbeam-epoch:0.9.17 --precise 0.9.15 || true
$(DOCKER_RUN) ${TAG_57} cargo update -p byteorder:1.5.0 --precise 0.4.3 || true
$(DOCKER_RUN) ${TAG_57} cargo test

test_63: builder_63
rm -f Cargo.lock
$(DOCKER_RUN) ${TAG_63} cargo test || true
$(DOCKER_RUN) ${TAG_63} cargo update -p home:0.5.9 --precise 0.5.5 || true
$(DOCKER_RUN) ${TAG_63} cargo test

run: builder
$(DOCKER_RUN) --tty ${TAG} cargo run

wasm-unknown: builder
$(DOCKER_RUN) --tty ${TAG} cargo check --target wasm32-unknown-unknown --no-default-features

wasm-wasi: builder
$(DOCKER_RUN) --tty ${TAG} cargo check --target wasm32-wasi --no-default-features

wasm-emscripten: builder
$(DOCKER_RUN) --tty ${TAG} cargo check --target wasm32-unknown-emscripten --no-default-features

sh: builder
$(DOCKER_RUN) --tty ${TAG} sh

builder:
docker build --tag ${TAG} \
--build-arg http_proxy="${http_proxy}" \
--build-arg UID="$(shell id -u)" \
.

builder_57:
docker build --tag ${TAG_57}\
--build-arg http_proxy="${http_proxy}" \
--build-arg UID="$(shell id -u)" \
-f Dockerfile_57 \
.

builder_63:
docker build --tag ${TAG_63}\
--build-arg http_proxy="${http_proxy}" \
--build-arg UID="$(shell id -u)" \
-f Dockerfile_63 \
.

9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<a href="https://github.com/bitcoindevkit/bdk-reserves/blob/master/LICENSE"><img alt="MIT or Apache-2.0 Licensed" src="https://img.shields.io/badge/license-MIT%2FApache--2.0-blue.svg"/></a>
<a href="https://github.com/bitcoindevkit/bdk-reserves/actions?query=workflow%3ACI"><img alt="CI Status" src="https://github.com/ulrichard/bdk-reserves/workflows/CI/badge.svg"></a>
<a href="https://docs.rs/bdk-reserves"><img alt="API Docs" src="https://img.shields.io/badge/docs.rs-bdk_reserves-green"/></a>
<a href="https://blog.rust-lang.org/2021/12/02/Rust-1.57.0.html"><img alt="Rustc Version 1.57.0+" src="https://img.shields.io/badge/rustc-1.57.0%2B-lightgrey.svg"/></a>
<a href="https://blog.rust-lang.org/2022/08/11/Rust-1.63.0.html"><img alt="Rustc Version 1.63.0+" src="https://img.shields.io/badge/rustc-1.63.0%2B-lightgrey.svg"/></a>
<a href="https://discord.gg/d7NkDKm"><img alt="Chat on Discord" src="https://img.shields.io/discord/753336465005608961?logo=discord"></a>
</p>

Expand Down Expand Up @@ -50,15 +50,12 @@ at your option.

## Minimum Supported Rust Version (MSRV)

This library should always compile with Rust **1.57.0**.
This library should always compile with Rust **1.63.0**.

To build with the MSRV you will need to pin the below dependencies:

```shell
# log versions at 0.4.19+ have MSRV 1.60.0
cargo update -p log:0.4.19 --precise 0.4.18
# tempfile versions at 3.7.0+ have MSRV 1.63.0
cargo update -p tempfile --precise 3.6.0
cargo update -p home:0.5.9 --precise 0.5.5
```

## Contribution
Expand Down
4 changes: 2 additions & 2 deletions tests/regtestenv.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use bdk::blockchain::{electrum::ElectrumBlockchain, Blockchain};
use bdk::database::memory::MemoryDatabase;
use bdk::electrum_client::Client;
use bdk::electrum_client::ElectrumApi;
use bdk::wallet::{AddressIndex, SyncOptions, Wallet};
use bdk::SignOptions;
use electrsd::bitcoind::bitcoincore_rpc::{bitcoin::Address, RpcApi};
use electrsd::bitcoind::BitcoinD;
use electrsd::electrum_client::ElectrumApi;
use electrsd::ElectrsD;
use std::str::FromStr;
use std::time::Duration;
Expand Down Expand Up @@ -50,7 +50,7 @@ impl RegTestEnv {
let foreign_addr = Address::from_str(MY_FOREIGN_ADDR).unwrap();

// generate to the first receiving address of the test wallet
self.generate_to_address(10, &addr2);
self.generate_to_address(10, &addr2.address);
// make the newly mined coins spendable
self.generate_to_address(100, &foreign_addr);

Expand Down

0 comments on commit 616a72e

Please sign in to comment.