Skip to content

Commit

Permalink
Merge pull request #731 from zcash/msrv-1.60
Browse files Browse the repository at this point in the history
Bump MSRV to 1.60
  • Loading branch information
str4d authored Feb 10, 2023
2 parents 94b454c + 8dbc554 commit e0f6512
Show file tree
Hide file tree
Showing 13 changed files with 106 additions and 48 deletions.
53 changes: 53 additions & 0 deletions .github/actions/prepare/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: 'Prepare Halo 2'
description: 'Sets up the Rust toolchain and prepares feature flags'
inputs:
toolchain:
description: 'Rust toolchain to use (defaults to MSRV)'
required: false
default: 1.60.0
beta-features:
description: 'Include beta features'
required: false
default: false
nightly-features:
description: 'Include nightly features'
required: false
default: false
test-dependencies:
description: 'Include test dependencies'
required: false
default: true
outputs:
feature-flags:
description: 'Feature flags'
value: ${{ steps.prepare-flags.outputs.flags }}
runs:
using: 'composite'
steps:
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ inputs.toolchain }}
override: true
- id: beta
shell: bash
run: echo "feature=beta" >> $GITHUB_OUTPUT
if: inputs.beta-features == 'true'
- id: nightly
shell: bash
run: echo "feature=nightly" >> $GITHUB_OUTPUT
if: inputs.nightly-features == 'true'
- id: test
shell: bash
run: echo "feature=test-dependencies" >> $GITHUB_OUTPUT
if: inputs.test-dependencies == 'true'
- id: prepare-flags
shell: bash
run: >
echo "flags=--no-default-features --features '
batch
dev-graph
gadget-traces
${{ steps.beta.outputs.feature }}
${{ steps.nightly.outputs.feature }}
${{ steps.test.outputs.feature }}
'" >> $GITHUB_OUTPUT
5 changes: 1 addition & 4 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.56.1
override: true
- uses: ./.github/actions/prepare
- name: Run benchmark
run: cargo bench -- --output-format bencher | tee output.txt
- name: Store benchmark result
Expand Down
52 changes: 26 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,18 @@ jobs:

steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.56.1
override: true
- id: prepare
uses: ./.github/actions/prepare
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --release --workspace --features batch,dev-graph,gadget-traces,test-dependencies ${{ matrix.extra_flags }}
args: >
--verbose
--release
--workspace
${{ steps.prepare.outputs.feature-flags }}
${{ matrix.extra_flags }}
build:
name: Build target ${{ matrix.target }}
Expand All @@ -41,17 +44,20 @@ jobs:

steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
- id: prepare
uses: ./.github/actions/prepare
with:
toolchain: 1.56.1
override: true
nightly-features: true
test-dependencies: false
- name: Add target
run: rustup target add ${{ matrix.target }}
- name: cargo build
uses: actions-rs/cargo@v1
with:
command: build
args: --features batch,dev-graph,gadget-traces,nightly --target ${{ matrix.target }}
args: >
${{ steps.prepare.outputs.feature-flags }}
--target ${{ matrix.target }}
bitrot:
name: Bitrot check
Expand All @@ -61,10 +67,9 @@ jobs:
- uses: actions/checkout@v3
# Check bitrot with stable (as we don't need benchmarks or the test-dev-graph
# feature flag to work with MSRV).
- uses: actions-rs/toolchain@v1
- uses: ./.github/actions/prepare
with:
toolchain: stable
override: true
# Build benchmarks and all-features to prevent bitrot
- name: Build benchmarks
uses: actions-rs/cargo@v1
Expand All @@ -77,10 +82,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.56.1
override: true
- uses: ./.github/actions/prepare
- name: cargo build
uses: actions-rs/cargo@v1
with:
Expand All @@ -99,10 +101,11 @@ jobs:
steps:
- uses: actions/checkout@v3
# Use stable for this to ensure that cargo-tarpaulin can be built.
- uses: actions-rs/toolchain@v1
- id: prepare
uses: ./.github/actions/prepare
with:
toolchain: stable
override: true
nightly-features: true
- name: Install cargo-tarpaulin
uses: actions-rs/cargo@v1
with:
Expand All @@ -112,7 +115,10 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: tarpaulin
args: --features batch,dev-graph,gadget-traces,test-dependencies,nightly --timeout 600 --out Xml
args: >
${{ steps.prepare.outputs.feature-flags }}
--timeout 600
--out Xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3.1.1

Expand All @@ -122,10 +128,7 @@ jobs:

steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.56.1
override: true
- uses: ./.github/actions/prepare
- name: cargo fetch
uses: actions-rs/cargo@v1
with:
Expand All @@ -145,10 +148,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.56.1
override: true
- uses: ./.github/actions/prepare
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/lints-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,19 @@ jobs:

steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
- id: prepare
uses: ./.github/actions/prepare
with:
toolchain: beta
components: clippy
override: true
nightly-features: true
- run: rustup component add clippy
- name: Run Clippy (beta)
uses: actions-rs/clippy-check@v1
continue-on-error: true
with:
name: Clippy (beta)
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features --all-targets -- -W clippy::all
args: >
${{ steps.prepare.outputs.feature-flags }}
--all-targets
-- -W clippy::all
17 changes: 10 additions & 7 deletions .github/workflows/lints-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,23 @@ on: pull_request

jobs:
clippy:
name: Clippy (1.56.1)
name: Clippy (MSRV)
timeout-minutes: 30
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
- id: prepare
uses: ./.github/actions/prepare
with:
toolchain: 1.56.1
components: clippy
override: true
nightly-features: true
- run: rustup component add clippy
- name: Run clippy
uses: actions-rs/clippy-check@v1
with:
name: Clippy (1.56.1)
name: Clippy (MSRV)
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features --all-targets -- -D warnings
args: >
${{ steps.prepare.outputs.feature-flags }}
--all-targets
-- -D warnings
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## Minimum Supported Rust Version

Requires Rust **1.56.1** or higher.
Requires Rust **1.60** or higher.

Minimum supported Rust version can be changed in the future, but it will be done with a
minor version bump.
Expand Down
2 changes: 1 addition & 1 deletion halo2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = [
"Jack Grigg <jack@electriccoin.co>",
]
edition = "2021"
rust-version = "1.56.1"
rust-version = "1.59"
description = "[BETA] Fast zero-knowledge proof-carrying data implementation with no trusted setup"
license = "MIT OR Apache-2.0"
repository = "https://github.com/zcash/halo2"
Expand Down
2 changes: 1 addition & 1 deletion halo2_gadgets/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ authors = [
"Kris Nuttycombe <kris@electriccoin.co>",
]
edition = "2021"
rust-version = "1.56.1"
rust-version = "1.59"
description = "Reusable gadgets and chip implementations for Halo 2"
license = "MIT OR Apache-2.0"
repository = "https://github.com/zcash/halo2"
Expand Down
2 changes: 1 addition & 1 deletion halo2_gadgets/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# halo2_gadgets [![Crates.io](https://img.shields.io/crates/v/halo2_gadgets.svg)](https://crates.io/crates/halo2_gadgets) #

Requires Rust 1.56.1+.
Requires Rust 1.60+.

## Documentation

Expand Down
2 changes: 1 addition & 1 deletion halo2_proofs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ authors = [
"Jack Grigg <jack@electriccoin.co>",
]
edition = "2021"
rust-version = "1.56.1"
rust-version = "1.59"
description = """
Fast PLONK-based zero-knowledge proving system with no trusted setup
"""
Expand Down
2 changes: 1 addition & 1 deletion halo2_proofs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## Minimum Supported Rust Version

Requires Rust **1.56.1** or higher.
Requires Rust **1.60** or higher.

Minimum supported Rust version can be changed in the future, but it will be done with a
minor version bump.
Expand Down
1 change: 0 additions & 1 deletion rust-toolchain

This file was deleted.

2 changes: 2 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[toolchain]
channel = "1.60.0"

0 comments on commit e0f6512

Please sign in to comment.