Skip to content

infra: improve MSRV check #1667

@kevinjqliu

Description

@kevinjqliu

Apache Iceberg Rust version

None

Describe the bug

Context:

MSRV check is currently only done in CI

- name: Generate minimal versions lockfile
run: |
cargo generate-lockfile -Z direct-minimal-versions
- name: Setup MSRV Rust toolchain
uses: ./.github/actions/setup-builder
with:
rust-version: ${{ env.rust_msrv }}
- name: Check MSRV
run: |
cargo +${{ env.rust_msrv }} check --locked --workspace

This would require multiple roundtrips and checking against CI, which is costly.
I propose that we add a new Makefile command to run this MSRV check.

check-msrv:
    cargo generate-lockfile -Z direct-minimal-versions
    cargo check --locked --workspace

We have to ensure the use of the MSRV version from Cargo.toml's rust-version field here somehow...

rust-version = "1.87"

The check itself, mainly the cargo generate-lockfile command, also generates a new Cargo.lock file which should not be checked in. This can be a potential footgun when upgrading libraries, as we've seen in #1501. Perhaps in the make command, we can also restore any Cargo.lock file changes to prevent footgun.

To Reproduce

No response

Expected behavior

No response

Willingness to contribute

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions