From 3623165ef4b51954f5f1c947c0f89d2bec605afd Mon Sep 17 00:00:00 2001 From: Jeb Bearer Date: Tue, 2 Apr 2024 10:17:52 -0400 Subject: [PATCH 1/5] Point at crates.io versions of dependencies --- Cargo.lock | 9 ++++++--- Cargo.toml | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b8d6f157..fc8dc0a5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3353,7 +3353,8 @@ dependencies = [ [[package]] name = "tagged-base64" version = "0.4.0" -source = "git+https://github.com/EspressoSystems/tagged-base64.git?tag=v0.4.0#eb449140f2feb597983ebaf0ee2464ed6cee322a" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b74bbf1db405a3fd2c6f8cd403bfa14727faa145925efe3012fa270b61551f1" dependencies = [ "ark-serialize", "ark-std", @@ -3368,7 +3369,8 @@ dependencies = [ [[package]] name = "tagged-base64-macros" version = "0.4.0" -source = "git+https://github.com/EspressoSystems/tagged-base64.git?tag=v0.4.0#eb449140f2feb597983ebaf0ee2464ed6cee322a" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcdea3c0150898fad2f7196a173ec3264f7fc455ba570939163c558f48ae85ac" dependencies = [ "quote", "syn 1.0.109", @@ -4040,7 +4042,8 @@ dependencies = [ [[package]] name = "vbs" version = "0.1.4" -source = "git+https://github.com/EspressoSystems/versioned-binary-serialization.git?tag=v0.1.4#50c93e6dd650484688077542c467a134a033893c" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "971bcbd6c41e4e53fa9eab95b2a8ddaf1826be2f3e86b4101efebc8c3a17fde0" dependencies = [ "anyhow", "bincode", diff --git a/Cargo.toml b/Cargo.toml index e149c584..adf422ad 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,7 +54,7 @@ signal-hook = "0.3.14" snafu = "0.8" strum = "0.26" strum_macros = "0.26" -tagged-base64 = { git = "https://github.com/EspressoSystems/tagged-base64.git", tag = "v0.4.0" } +tagged-base64 = "0.4" tide = { version = "0.16.0", default-features = false } tide-websockets = "0.4.0" toml = "0.8" @@ -64,7 +64,7 @@ tracing-futures = "0.2" tracing-log = "0.2" tracing-subscriber = { version = "0.3.18", features = ["env-filter", "json"] } url = "2.5.0" -vbs = { git = "https://github.com/EspressoSystems/versioned-binary-serialization.git", tag = "v0.1.4" } +vbs = "0.1" # Dependencies enabled by feature `testing` async-compatibility-layer = { git = "https://github.com/EspressoSystems/async-compatibility-layer.git", tag = "1.4.2", features = ["logging-utils"], optional = true } From 353723ce300b476b780e10e0a1564a8fcec5336e Mon Sep 17 00:00:00 2001 From: Jeb Bearer Date: Tue, 2 Apr 2024 10:31:06 -0400 Subject: [PATCH 2/5] Prepare for crate publishing --- .github/workflows/build.yml | 112 +++++++++++++++++++++++++--- .github/workflows/build_windows.yml | 42 ----------- 2 files changed, 100 insertions(+), 54 deletions(-) delete mode 100644 .github/workflows/build_windows.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 89bea614..a11c24a3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,34 +5,63 @@ on: branches: - main - release-* + tags: + - v*.*.* pull_request: + branches: + - main + - release-* workflow_dispatch: -env: - RUSTFLAGS: "--cfg async_executor_impl=\"async-std\" --cfg async_channel_impl=\"async-std\"" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: - build: + lint: runs-on: ubuntu-latest + env: + RUST_LOG: info steps: - uses: actions/checkout@v4 name: Checkout Repository - uses: Swatinem/rust-cache@v2 name: Enable Rust Caching - with: - cache-on-failure: true - name: Format Check run: cargo fmt -- --check - - uses: actions-rs/clippy-check@v1 - name: Clippy + - name: Clippy + uses: actions-rs-plus/clippy-check@v1 with: - token: ${{ github.token }} - args: --workspace --all-features --all-targets -- -D warnings + token: ${{ github.token }} + args: --workspace --all-features --all-targets -- -D warnings + + build: + runs-on: ubuntu-latest + env: + RUST_LOG: info + steps: + - uses: actions/checkout@v4 + name: Checkout Repository - - name: Audit - run: cargo audit --ignore RUSTSEC-2023-0065 + - uses: Swatinem/rust-cache@v2 + name: Enable Rust Caching + + - name: Build + run: cargo build --all-features --all-targets --release + + build-windows: + runs-on: windows-2022 + env: + RUST_LOG: info + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - uses: Swatinem/rust-cache@v2 + name: Enable Rust Caching - name: Build run: | @@ -44,9 +73,38 @@ jobs: cargo test --workspace --release --all-features --verbose -- --test-threads 2 timeout-minutes: 30 + test: + runs-on: ubuntu-latest + env: + RUST_LOG: info + steps: + - uses: actions/checkout@v4 + name: Checkout Repository + + - uses: Swatinem/rust-cache@v2 + name: Enable Rust Caching + + - name: Build tests + run: cargo test --workspace --release --all-features --no-run + + - name: Test + run: cargo test --workspace --release --all-features --verbose -- --test-threads 2 + timeout-minutes: 60 + + docs: + runs-on: ubuntu-latest + env: + RUST_LOG: info + steps: + - uses: actions/checkout@v4 + name: Checkout Repository + + - uses: Swatinem/rust-cache@v2 + name: Enable Rust Caching + - name: Generate Documentation run: | - cargo doc --no-deps --lib --release + cargo doc --no-deps --lib --release --all-features echo '' > target/doc/index.html - name: Deploy Documentation @@ -56,3 +114,33 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./target/doc cname: tide-disco.docs.espressosys.com + + semver-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + name: Checkout Repository + + - uses: Swatinem/rust-cache@v2 + name: Enable Rust Caching + + - name: Check semver + uses: obi1kenobi/cargo-semver-checks-action@v2 + + publish: + needs: + - build + - build-windows + - test + - lint + - docs + - semver-check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: katyo/publish-crates@v2 + with: + # Only do an actual publish if this is a push to a release tag. Otherwise, do a dry run. + dry-run: ${{ !(github.event_name == 'push' && github.ref_type == 'tag') }} + ignore-unpublished-changes: true + registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml deleted file mode 100644 index eb0e7a1c..00000000 --- a/.github/workflows/build_windows.yml +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (c) 2022 Espresso Systems (espressosys.com) -# This file is part of the Tide Disco library. -# -# This program is free software: you can redistribute it and/or modify it under the terms of the GNU -# General Public License as published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# You should have received a copy of the GNU General Public License along with this program. If not, -# see . - -name: Windows build - -on: - push: - branches: - - main - - release-* - workflow_dispatch: -env: - RUSTFLAGS: "--cfg async_executor_impl=\"async-std\" --cfg async_channel_impl=\"async-std\"" - -jobs: - windows: - runs-on: windows-2022 - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - uses: Swatinem/rust-cache@v2 - name: Enable Rust Caching - - - name: Build - run: | - cargo build --workspace --release - - - name: Test - run: | - cargo test --workspace --release --all-features --no-run - cargo test --workspace --release --all-features --verbose -- --test-threads 2 - timeout-minutes: 30 From 6ee64d757347e713e8fa8c2cd0665f24bee2098e Mon Sep 17 00:00:00 2001 From: Jeb Bearer Date: Tue, 2 Apr 2024 10:40:48 -0400 Subject: [PATCH 3/5] Add rust env vars --- .github/workflows/build.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a11c24a3..94dd17ba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,6 +22,7 @@ jobs: runs-on: ubuntu-latest env: RUST_LOG: info + RUSTFLAGS: "--cfg async_executor_impl=\"async-std\" --cfg async_channel_impl=\"async-std\"" steps: - uses: actions/checkout@v4 name: Checkout Repository @@ -42,6 +43,7 @@ jobs: runs-on: ubuntu-latest env: RUST_LOG: info + RUSTFLAGS: "--cfg async_executor_impl=\"async-std\" --cfg async_channel_impl=\"async-std\"" steps: - uses: actions/checkout@v4 name: Checkout Repository @@ -56,6 +58,7 @@ jobs: runs-on: windows-2022 env: RUST_LOG: info + RUSTFLAGS: "--cfg async_executor_impl=\"async-std\" --cfg async_channel_impl=\"async-std\"" steps: - name: Checkout Repository uses: actions/checkout@v4 @@ -77,6 +80,7 @@ jobs: runs-on: ubuntu-latest env: RUST_LOG: info + RUSTFLAGS: "--cfg async_executor_impl=\"async-std\" --cfg async_channel_impl=\"async-std\"" steps: - uses: actions/checkout@v4 name: Checkout Repository @@ -95,6 +99,7 @@ jobs: runs-on: ubuntu-latest env: RUST_LOG: info + RUSTFLAGS: "--cfg async_executor_impl=\"async-std\" --cfg async_channel_impl=\"async-std\"" steps: - uses: actions/checkout@v4 name: Checkout Repository @@ -117,6 +122,9 @@ jobs: semver-check: runs-on: ubuntu-latest + env: + RUST_LOG: info + RUSTFLAGS: "--cfg async_executor_impl=\"async-std\" --cfg async_channel_impl=\"async-std\"" steps: - uses: actions/checkout@v4 name: Checkout Repository @@ -136,6 +144,9 @@ jobs: - docs - semver-check runs-on: ubuntu-latest + env: + RUST_LOG: info + RUSTFLAGS: "--cfg async_executor_impl=\"async-std\" --cfg async_channel_impl=\"async-std\"" steps: - uses: actions/checkout@v4 - uses: katyo/publish-crates@v2 From 5abfe10cf2935a45863a8c53a7b914573172d3e4 Mon Sep 17 00:00:00 2001 From: Jeb Bearer Date: Tue, 2 Apr 2024 10:47:31 -0400 Subject: [PATCH 4/5] Temporarily disable semver checks The cargo-semver-checks action fails when the crate does not already exist on crates.io. We disable it here so we can successfully publish an initial baseline version to crates.io. We will need to reenable this action after the crate is successfully published. --- .github/workflows/build.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 94dd17ba..4daf96d8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -120,20 +120,20 @@ jobs: publish_dir: ./target/doc cname: tide-disco.docs.espressosys.com - semver-check: - runs-on: ubuntu-latest - env: - RUST_LOG: info - RUSTFLAGS: "--cfg async_executor_impl=\"async-std\" --cfg async_channel_impl=\"async-std\"" - steps: - - uses: actions/checkout@v4 - name: Checkout Repository + # semver-check: + # runs-on: ubuntu-latest + # env: + # RUST_LOG: info + # RUSTFLAGS: "--cfg async_executor_impl=\"async-std\" --cfg async_channel_impl=\"async-std\"" + # steps: + # - uses: actions/checkout@v4 + # name: Checkout Repository - - uses: Swatinem/rust-cache@v2 - name: Enable Rust Caching + # - uses: Swatinem/rust-cache@v2 + # name: Enable Rust Caching - - name: Check semver - uses: obi1kenobi/cargo-semver-checks-action@v2 + # - name: Check semver + # uses: obi1kenobi/cargo-semver-checks-action@v2 publish: needs: @@ -142,7 +142,7 @@ jobs: - test - lint - docs - - semver-check + # - semver-check runs-on: ubuntu-latest env: RUST_LOG: info From cfdad48a91ccf3719718474b08a21b6d2e14ac68 Mon Sep 17 00:00:00 2001 From: Jeb Bearer Date: Tue, 2 Apr 2024 11:59:29 -0400 Subject: [PATCH 5/5] Use crates.io version of async-compatibility-layer --- Cargo.lock | 60 +++++++++++++++++++++++++++++++++++++++++------------- Cargo.toml | 4 ++-- 2 files changed, 48 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fc8dc0a5..558fdadd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -199,17 +199,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" dependencies = [ "concurrent-queue", - "event-listener", + "event-listener 2.5.3", "futures-core", ] [[package]] name = "async-compatibility-layer" -version = "1.0.0" -source = "git+https://github.com/EspressoSystems/async-compatibility-layer.git?tag=1.4.2#482cece7d27f20d5a543e209a5d88b1837778b4c" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7d24a8f9d6fec5b9313ceebbd82133ae87cf94944c362e8169d7ec735c88a23" dependencies = [ - "async-channel", - "async-lock", + "async-lock 3.3.0", "async-std", "async-trait", "color-eyre", @@ -239,7 +239,7 @@ version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fa3dc5f2a8564f07759c008b9109dc0d39de92a88d5588b8a5036d286383afb" dependencies = [ - "async-lock", + "async-lock 2.8.0", "async-task", "concurrent-queue", "fastrand 1.9.0", @@ -256,7 +256,7 @@ dependencies = [ "async-channel", "async-executor", "async-io", - "async-lock", + "async-lock 2.8.0", "blocking", "futures-lite", "once_cell", @@ -285,7 +285,7 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" dependencies = [ - "async-lock", + "async-lock 2.8.0", "autocfg", "cfg-if", "concurrent-queue", @@ -305,7 +305,18 @@ version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" dependencies = [ - "event-listener", + "event-listener 2.5.3", +] + +[[package]] +name = "async-lock" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" +dependencies = [ + "event-listener 4.0.3", + "event-listener-strategy", + "pin-project-lite 0.2.12", ] [[package]] @@ -315,11 +326,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a9d28b1d97e08915212e2e45310d47854eafa69600756fc735fb788f75199c9" dependencies = [ "async-io", - "async-lock", + "async-lock 2.8.0", "autocfg", "blocking", "cfg-if", - "event-listener", + "event-listener 2.5.3", "futures-lite", "rustix 0.37.25", "signal-hook", @@ -350,7 +361,7 @@ dependencies = [ "async-channel", "async-global-executor", "async-io", - "async-lock", + "async-lock 2.8.0", "async-process", "crossbeam-utils", "futures-channel", @@ -579,7 +590,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77231a1c8f801696fc0123ec6150ce92cffb8e164a02afb9c8ddee0e9b65ad65" dependencies = [ "async-channel", - "async-lock", + "async-lock 2.8.0", "async-task", "atomic-waker", "fastrand 1.9.0", @@ -1120,6 +1131,27 @@ version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" +[[package]] +name = "event-listener" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite 0.2.12", +] + +[[package]] +name = "event-listener-strategy" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" +dependencies = [ + "event-listener 4.0.3", + "pin-project-lite 0.2.12", +] + [[package]] name = "eyre" version = "0.6.12" @@ -3044,7 +3076,7 @@ version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38aabbeafa6f6dead8cebf246fe9fae1f9215c8d29b3a69f93bd62a9e4a3dcd6" dependencies = [ - "event-listener", + "event-listener 2.5.3", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index adf422ad..0f221f7f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -67,7 +67,7 @@ url = "2.5.0" vbs = "0.1" # Dependencies enabled by feature `testing` -async-compatibility-layer = { git = "https://github.com/EspressoSystems/async-compatibility-layer.git", tag = "1.4.2", features = ["logging-utils"], optional = true } +async-compatibility-layer = { version = "1.1", features = ["logging-utils"], optional = true } async-tungstenite = { version = "0.25", features = ["async-std-runtime"], optional = true } [target.'cfg(not(windows))'.dependencies] @@ -76,6 +76,6 @@ signal-hook-async-std = "0.2.2" [dev-dependencies] ark-serialize = { version = "0.4", features = ["derive"] } ark-std = "0.4.0" -async-compatibility-layer = { git = "https://github.com/EspressoSystems/async-compatibility-layer.git", tag = "1.4.2", features = ["logging-utils"] } +async-compatibility-layer = { version = "1.1", features = ["logging-utils"] } async-tungstenite = { version = "0.25", features = ["async-std-runtime"] } portpicker = "0.1"