Skip to content

Commit

Permalink
Require minimum Rust 1.71 to work.
Browse files Browse the repository at this point in the history
  • Loading branch information
obi1kenobi committed Nov 8, 2023
1 parent 50363e9 commit eab3b8b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 23 deletions.
34 changes: 12 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,13 @@ jobs:
rust-tests:
name: Run tests
runs-on: ubuntu-latest
continue-on-error: true # TODO: revert this change before merging!!
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
# IMPORTANT: When updating the versions here, make sure you also update
# the `fails-on-too-old-rustc` job and its error message to
# to account for the raised minimum required version.
toolchain: ["1.70", "1.71", "1.72", "stable", "beta"]
toolchain: ["1.71", "1.72", "stable", "beta"]
experimental: [false]
include:
- toolchain: "nightly"
Expand Down Expand Up @@ -330,7 +330,7 @@ jobs:
id: toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: "1.70" # Rust 1.70 uses rustdoc v24
toolchain: "1.73" # Rust 1.73 uses rustdoc v26
rustflags: ""
cache: false

Expand Down Expand Up @@ -364,11 +364,15 @@ jobs:
- name: Install newer rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: "1.72" # Rust 1.72 uses rustdoc v26
# Make sure this version matches the env var below.
toolchain: "nightly" # Rust 1.75-nightly uses rustdoc v27

rustflags: ""
cache: false

- name: Check with older rustdoc version cached
env:
NEWER_RUST_VERSION: "nightly" # Make sure this matches the version installed just above.
run: |
# Use a separate workspace, to avoid contaminating the cache for Swatinem/rust-cache@v2
cp -R subject subject-new
Expand All @@ -385,9 +389,9 @@ jobs:
export OLD_RUSTDOC_VERSION="$(jq .format_version subject-new/target/semver-checks/cache/registry-libp2p_core-0_37_0.json)"
# Run cargo-semver-checks with the older cached file.
# In a prior step, we installed stable Rust, so we'll set that as the default
# In a prior step, we installed a newer Rust, so we'll set that as the default
# for cargo-semver-checks to invoke here.
rustup override set stable
rustup override set "$NEWER_RUST_VERSION"
bins/cargo-semver-checks semver-checks check-release --manifest-path="subject-new/core/Cargo.toml" --verbose
export NEW_RUSTDOC_VERSION="$(jq .format_version subject-new/target/semver-checks/cache/registry-libp2p_core-0_37_0.json)"
Expand Down Expand Up @@ -432,7 +436,6 @@ jobs:
with:
cache: false
rustflags: ""
toolchain: nightly

- name: Restore rustdoc
id: cache
Expand Down Expand Up @@ -526,7 +529,6 @@ jobs:
with:
cache: false
rustflags: ""
toolchain: nightly

# rust-libp2p requires protobuf-compiler.
- name: Install protobuf-compiler
Expand Down Expand Up @@ -606,7 +608,6 @@ jobs:
with:
cache: false
rustflags: ""
toolchain: nightly

# rust-libp2p requires protobuf-compiler.
- name: Install protobuf-compiler
Expand Down Expand Up @@ -681,7 +682,6 @@ jobs:
with:
cache: false
rustflags: ""
toolchain: nightly

# rust-libp2p requires protobuf-compiler.
- name: Install protobuf-compiler
Expand Down Expand Up @@ -754,7 +754,6 @@ jobs:
with:
cache: false
rustflags: ""
toolchain: nightly

# rust-libp2p requires protobuf-compiler.
- name: Install protobuf-compiler
Expand Down Expand Up @@ -823,7 +822,6 @@ jobs:
with:
cache: false
rustflags: ""
toolchain: nightly

# This job runs on macOS, not Linux like the rest.
# It should save its cache, because no other job will save it in its place.
Expand Down Expand Up @@ -882,7 +880,6 @@ jobs:
with:
cache: false
rustflags: ""
toolchain: nightly

- name: Restore binary
id: cache-binary
Expand Down Expand Up @@ -946,7 +943,6 @@ jobs:
with:
cache: false
rustflags: ""
toolchain: nightly

- name: Restore binary
id: cache-binary
Expand Down Expand Up @@ -1009,7 +1005,6 @@ jobs:
with:
cache: false
rustflags: ""
toolchain: nightly

- name: Restore binary
id: cache-binary
Expand Down Expand Up @@ -1077,7 +1072,6 @@ jobs:
with:
cache: false
rustflags: ""
toolchain: nightly

- name: Restore cargo index and rustdoc target dir
uses: Swatinem/rust-cache@v2
Expand Down Expand Up @@ -1156,7 +1150,6 @@ jobs:
with:
cache: false
rustflags: ""
toolchain: nightly

- name: Restore cargo index and rustdoc target dir
uses: Swatinem/rust-cache@v2
Expand Down Expand Up @@ -1234,7 +1227,6 @@ jobs:
with:
cache: false
rustflags: ""
toolchain: nightly

- name: Restore binary
id: cache-binary
Expand Down Expand Up @@ -1458,7 +1450,6 @@ jobs:
with:
cache: false
rustflags: ""
toolchain: nightly

- name: Restore binary
id: cache-binary
Expand Down Expand Up @@ -1556,7 +1547,6 @@ jobs:
with:
cache: false
rustflags: ""
toolchain: nightly

- name: Restore binary
id: cache-binary
Expand Down Expand Up @@ -1620,7 +1610,7 @@ jobs:
id: toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: "1.67"
toolchain: "1.70"
rustflags: ""
cache: false

Expand Down Expand Up @@ -1663,7 +1653,7 @@ jobs:
- name: Check output
run: |
cd semver
EXPECTED="$(echo -e "Error: rustc version is not high enough: >=1.68.0 needed, got 1.67.1")"
EXPECTED="$(echo -e "Error: rustc version is not high enough: >=1.71.0 needed, got 1.70.0")"
RESULT="$(cat output | grep Error)"
diff <(echo "$RESULT") <(echo "$EXPECTED")
Expand Down
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ impl GlobalConfig {
}
})),
handlebars: make_handlebars_registry(),
minimum_rustc_version: semver::Version::new(1, 68, 0),
minimum_rustc_version: semver::Version::new(1, 71, 0),
}
}

Expand Down

0 comments on commit eab3b8b

Please sign in to comment.