mirror of
https://github.com/tokio-rs/tracing.git
synced 2026-03-19 06:12:30 +00:00
chore(ci): run MSRV checks with minimal versions (#2171)
In many cases, new releases of a dependency can break compatibility with `tracing`'s minimum supported Rust version (MSRV). It shouldn't be necessary for a `tracing` crate to bump its MSRV when a dependency does, as users on older Rust versions should be able to depend on older versions of that crate explicitly and avoid bumping. Instead, we should probably just run our MSRV checks with minimal dependency versions. This way, we don't need to bump our MSRV when the latest version of a dependency does, unless we actually *need* to pick up that new version. This branch changes the `check_msrv` CI jobs to do that. I also did some minor dependency editing to actually make tracing build with `-Zminimal-versions`. Note that `tracing-futures` is currently excluded from the MSRV build because it depends on a really ancient version of Tokio that pulls in broken deps. We should probably drop support for Tokio 0.1 and release a new version of that crate, but for now, we have to skip it from the CI job temporarily. Signed-off-by: Eliza Weisman <eliza@buoyant.io>
This commit is contained in:
59
.github/workflows/check_msrv.yml
vendored
59
.github/workflows/check_msrv.yml
vendored
@@ -27,37 +27,76 @@ env:
|
||||
RUSTUP_MAX_RETRIES: 10
|
||||
# Don't emit giant backtraces in the CI logs.
|
||||
RUST_BACKTRACE: short
|
||||
MSRV: 1.49.0
|
||||
# TODO: remove this once tracing's MSRV is bumped.
|
||||
APPENDER_MSRV: 1.53.0
|
||||
|
||||
jobs:
|
||||
check-msrv:
|
||||
# Run `cargo check` on our minimum supported Rust version (1.49.0).
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@main
|
||||
- uses: actions-rs/toolchain@v1
|
||||
- uses: actions/checkout@master
|
||||
- name: "install Rust ${{ env.MSRV }}"
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: 1.49.0
|
||||
toolchain: ${{ env.MSRV }}
|
||||
profile: minimal
|
||||
override: true
|
||||
- name: "install Rust nightly"
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: nightly
|
||||
profile: minimal
|
||||
- name: Select minimal versions
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: update
|
||||
args: -Z minimal-versions
|
||||
toolchain: nightly
|
||||
- name: Check
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: check
|
||||
args: --all --exclude=tracing-appender
|
||||
# skip the following crates:
|
||||
# - tracing-appender, as it has its own MSRV.
|
||||
# TODO(eliza): remove this when appender is on the same MSRV as
|
||||
# everything else
|
||||
# - the examples, as they are not published & we don't care about
|
||||
# MSRV support for them.
|
||||
# - tracing-futures, as it depends on ancient tokio versions.
|
||||
# TODO(eliza): remove this when the ancient tokio deps are dropped
|
||||
args: >-
|
||||
--workspace --all-features --locked
|
||||
--exclude=tracing-appender
|
||||
--exclude=tracing-examples
|
||||
--exclude=tracing-futures
|
||||
toolchain: ${{ env.MSRV }}
|
||||
|
||||
# TODO: remove this once tracing's MSRV is bumped.
|
||||
check-msrv-appender:
|
||||
# Run `cargo check` on our minimum supported Rust version (1.53.0).
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@main
|
||||
- uses: actions-rs/toolchain@v1
|
||||
- uses: actions/checkout@master
|
||||
- name: "install Rust ${{ env.APPENDER_MSRV }}"
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: 1.53.0
|
||||
toolchain: ${{ env.APPENDER_MSRV }}
|
||||
profile: minimal
|
||||
override: true
|
||||
- name: "install Rust nightly"
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: nightly
|
||||
profile: minimal
|
||||
- name: Select minimal versions
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: update
|
||||
args: -Z minimal-versions
|
||||
toolchain: nightly
|
||||
- name: Check
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: check
|
||||
args: --lib=tracing-appender
|
||||
args: --all-features --locked -p tracing-appender
|
||||
toolchain: ${{ env.APPENDER_MSRV }}
|
||||
Reference in New Issue
Block a user