Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): bump rust toolchain to 1.81 #1523

Merged
merged 6 commits into from
Sep 25, 2024
Merged

Conversation

SuperFluffy
Copy link
Member

@SuperFluffy SuperFluffy commented Sep 19, 2024

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 and comes with a load of niceties that we would like to use. Among them of immediate interest are:

  1. lint reasons (Replace all allow attributes by expect and require lint reasons #1521)
  2. fixes clippy::blocks_in_conditions lint triggering on proc macros like tracing::instrument (which chore(sequencer): Add instrumentation #1368 needed to work around)
  3. lazy lock and lazy cell (to replace once_cell) in 1.80 (Replace once_cell by sync primitives added 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

@github-actions github-actions bot added ci issues that are related to ci and github workflows docker labels Sep 19, 2024
@SuperFluffy SuperFluffy force-pushed the ENG-819/bump-msrv-to-1.81 branch 2 times, most recently from 8415675 to 9142701 Compare September 19, 2024 10:26
@github-actions github-actions bot added conductor pertaining to the astria-conductor crate sequencer pertaining to the astria-sequencer crate labels Sep 19, 2024
@SuperFluffy SuperFluffy force-pushed the ENG-819/bump-msrv-to-1.81 branch 4 times, most recently from c084b23 to c751c24 Compare September 19, 2024 12:10
@SuperFluffy SuperFluffy marked this pull request as ready for review September 20, 2024 11:33
@SuperFluffy SuperFluffy requested review from a team as code owners September 20, 2024 11:33
.github/workflows/reusable-build.yml Outdated Show resolved Hide resolved
@@ -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 rustup-toolchain.toml at the repository root
RUSTUP_TOOLCHAIN: "1.81.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we could name this RUST_TOOLCHAIN to be consistent with the filename?

Also, could we read the appropriate value from the rust-toolchain.toml file here rather than having to keep these in sync?

Copy link
Member Author

@SuperFluffy SuperFluffy Sep 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RUSTUP_TOOLCHAIN is the actual env var that's read by rust: https://rust-lang.github.io/rustup/overrides.html#the-toolchain-file, so I'd like to keep that.

And I guess we could extract this, but I didn't want to move away from dtolnay/rust-toolchain (at least for now), and parsing toml files in workflows can only be done through obscure github actions, which I didn't feel comfortable introducing.

Followup?

.github/workflows/test.yml Outdated Show resolved Hide resolved
lint/tracing_debug_field/rust-toolchain Outdated Show resolved Hide resolved
@SuperFluffy SuperFluffy added this pull request to the merge queue Sep 24, 2024
@SuperFluffy SuperFluffy removed this pull request from the merge queue due to a manual request Sep 24, 2024
@SuperFluffy SuperFluffy added this pull request to the merge queue Sep 25, 2024
Merged via the queue into main with commit 4478cb6 Sep 25, 2024
42 checks passed
@SuperFluffy SuperFluffy deleted the ENG-819/bump-msrv-to-1.81 branch September 25, 2024 13:02
github-merge-queue bot pushed a commit that referenced this pull request Sep 25, 2024
## Summary
We accidentally broke the reusable build script with a poorly formatted
workflow file in #1523 this
fixes it.
bharath-123 pushed a commit that referenced this pull request Sep 26, 2024
## 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
bharath-123 pushed a commit that referenced this pull request Sep 26, 2024
## Summary
We accidentally broke the reusable build script with a poorly formatted
workflow file in #1523 this
fixes it.
github-merge-queue bot pushed a commit that referenced this pull request Sep 30, 2024
## Summary
Implemented usage of `#[expect]` instead of `#[allow]` following bump to
Rust 1.81

## Background
With the recent bump to Rust 1.81 (#1523), the usage of `#[expect]` is
now stable. This is preferable because it warns in case the lint is
unfulfilled, keeping us from having superfluous allow attributes.

## Changes
- Changed `test.yml` to include `clippy::allow_attributes` and
`clippy::allow_attributes_with_no_reason` lints
- Updated all crates to use Rust 1.81.0
- Migrated all instances of `#[allow]` to `#[expect]`, with the
exception of our generated modules.
- Deleted all allow attributes which were no longer useful

## Testing
Passing all tests

## Related Issues
closes #1521
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci issues that are related to ci and github workflows conductor pertaining to the astria-conductor crate docker sequencer pertaining to the astria-sequencer crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update CI to Rust 1.81
3 participants