-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): bump rust toolchain to 1.81 (#1523)
## Summary Updates the rust toolchain used for all rust releated github jobs to and the containerfile to 1.81.0. ## Background Rust [1.81 was released](https://blog.rust-lang.org/2024/09/05/Rust-1.81.0.html) and comes with a load of niceties that we would like to use. Among them of immediate interest are: 1. lint reasons (#1521) 2. fixes `clippy::blocks_in_conditions` lint triggering on proc macros like `tracing::instrument` (which #1368 needed to work around) 3. lazy lock and lazy cell (to replace once_cell) in 1.80 (#1520) 4. checked cfg names (also 1.80 which flags a few issues in our code and should be immediately available). Note that this is orthgonal to setting the MSRV in individual Astria crates. ## Changes - Updates all github workflows to use the `1.81.0` toolchain (except for rustfmt and dylint, which need nightlies, respectively). - Fix all new clippy warnings. - Upgraded to the most recent dylint to make it compile again - Upgrade the single containerfile to use `rust:1.81-bookwarm` as the base image ## Related Issues Closes #1522
- Loading branch information
1 parent
b94d66c
commit 347152d
Showing
15 changed files
with
173 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,8 @@ on: | |
env: | ||
REGISTRY: ghcr.io | ||
FULL_REF: ${{ inputs.tag && format('refs/tags/{0}', inputs.tag) || github.ref }} | ||
# This must match the entry in rust-toolchain.toml at the repository root | ||
RUSTUP_TOOLCHAIN: "1.81.0" | ||
|
||
jobs: | ||
upload-binaries: | ||
|
@@ -34,7 +36,9 @@ jobs: | |
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.tag }} | ||
- uses: dtolnay/[email protected] | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ env.RUSTUP_TOOLCHAIN }} | ||
- uses: arduino/setup-protoc@v3 | ||
with: | ||
version: "24.4" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,9 @@ name: Test | |
env: | ||
CI: true | ||
RUSTFLAGS: "-D warnings -D unreachable-pub --cfg tokio_unstable" | ||
|
||
# This must match the entry in rust-toolchain.toml at the repository root | ||
RUSTUP_TOOLCHAIN: "1.81.0" | ||
on: | ||
pull_request: | ||
merge_group: | ||
|
@@ -26,7 +29,9 @@ jobs: | |
version: "1.32.0" | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Install Rust toolchain | ||
uses: dtolnay/[email protected] | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ env.RUSTUP_TOOLCHAIN }} | ||
- uses: Swatinem/[email protected] | ||
with: | ||
cache-provider: "buildjet" | ||
|
@@ -51,7 +56,9 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install Rust toolchain | ||
uses: dtolnay/[email protected] | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ env.RUSTUP_TOOLCHAIN }} | ||
- uses: Swatinem/[email protected] | ||
with: | ||
cache-provider: "buildjet" | ||
|
@@ -77,7 +84,9 @@ jobs: | |
- uses: actions/checkout@v4 | ||
with: | ||
submodules: 'true' | ||
- uses: dtolnay/[email protected] | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ env.RUSTUP_TOOLCHAIN }} | ||
- uses: taiki-e/[email protected] | ||
with: | ||
tool: [email protected] | ||
|
@@ -100,7 +109,9 @@ jobs: | |
if: needs.run_checker.outputs.run_tests == 'true' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/[email protected] | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ env.RUSTUP_TOOLCHAIN }} | ||
- uses: Swatinem/[email protected] | ||
with: | ||
cache-provider: "github" | ||
|
@@ -113,7 +124,9 @@ jobs: | |
if: needs.run_checker.outputs.run_audit == 'true' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/[email protected] | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ env.RUSTUP_TOOLCHAIN }} | ||
- uses: rustsec/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
@@ -126,7 +139,9 @@ jobs: | |
- uses: actions/checkout@v4 | ||
with: | ||
submodules: 'true' | ||
- uses: dtolnay/[email protected] | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ env.RUSTUP_TOOLCHAIN }} | ||
- uses: Swatinem/[email protected] | ||
with: | ||
cache-provider: "buildjet" | ||
|
@@ -154,7 +169,9 @@ jobs: | |
- uses: actions/checkout@v4 | ||
with: | ||
submodules: 'true' | ||
- uses: dtolnay/[email protected] | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ env.RUSTUP_TOOLCHAIN }} | ||
- uses: Swatinem/[email protected] | ||
with: | ||
cache-provider: "buildjet" | ||
|
@@ -179,7 +196,9 @@ jobs: | |
- uses: actions/checkout@v4 | ||
with: | ||
submodules: 'true' | ||
- uses: dtolnay/[email protected] | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ env.RUSTUP_TOOLCHAIN }} | ||
- uses: Swatinem/[email protected] | ||
with: | ||
cache-provider: "buildjet" | ||
|
@@ -198,8 +217,9 @@ jobs: | |
- uses: actions/checkout@v4 | ||
with: | ||
submodules: 'true' | ||
- uses: dtolnay/rust-toolchain@1.78.0 | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ env.RUSTUP_TOOLCHAIN }} | ||
components: clippy | ||
- uses: Swatinem/[email protected] | ||
with: | ||
|
@@ -226,24 +246,25 @@ jobs: | |
- uses: actions/checkout@v4 | ||
with: | ||
submodules: 'true' | ||
- uses: dtolnay/rust-toolchain@v1 | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
# This has to match `rust-toolchain` in the rust-toolchain file of the dylint lints | ||
toolchain: nightly-2023-12-28 | ||
components: "clippy, llvm-tools-preview, rustc-dev" | ||
toolchain: nightly-2024-09-05 | ||
components: "clippy, llvm-tools-preview, rustc-dev, rust-src" | ||
- uses: Swatinem/[email protected] | ||
with: | ||
cache-provider: "buildjet" | ||
- name: install cargo-dylint and dylint-link | ||
run: cargo install cargo-dylint@2.6.1 dylint-link@2.6.1 --locked | ||
run: cargo install cargo-dylint@3.2.0 dylint-link@3.2.0 --locked | ||
- uses: arduino/setup-protoc@v3 | ||
with: | ||
version: "24.4" | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: run clippy against custom lints | ||
run: | | ||
: # list all lint packages here to have clippy explicitly test them | ||
cargo clippy --all-targets --all-features \ | ||
: # uses the same nightly installed above to work around the entry in rust-toolchain.toml | ||
cargo +nightly-2024-09-05 clippy --all-targets --all-features \ | ||
-p tracing_debug_field \ | ||
-- --warn clippy::pedantic --deny warnings | ||
- name: run dylint clippy on workspace crates | ||
|
Oops, something went wrong.