Skip to content

Commit

Permalink
don't set MSRV and only run doctests on nightly
Browse files Browse the repository at this point in the history
We have too many dependencies to actually guarantee our MSRV.

We only run doctests on nightly so we don't have to generalize
doctests for slightly different line numbers across different Rust
versions. Our integration tests do generalize in this way, so we
still run those on both stable and nightly.
  • Loading branch information
jswrenn committed Feb 6, 2024
1 parent d3d3a39 commit 31005fa
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 31 deletions.
36 changes: 13 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ env:
# `CRATE_NIGHTLY_XXX` are flags that we add to `XXX` only on the nightly
# toolchain.
CRATE_NIGHTLY_RUSTFLAGS: -Zrandomize-layout
CRATE_NIGHTLY_MIRIFLAGS: "-Zmiri-disable-isolation -Zmiri-symbolic-alignment-check"
CRATE_NIGHTLY_MIRIFLAGS: "-Zmiri-disable-isolation"

jobs:
build_test:
runs-on: ubuntu-latest

strategy:
matrix:
toolchain: [ "msrv", "stable", "nightly" ]
toolchain: [ "stable", "nightly" ]
target: [ "i686-unknown-linux-gnu", "x86_64-unknown-linux-gnu" ]

name: Build & Test (toolchain:${{ matrix.toolchain }}, target:${{ matrix.target }})
Expand Down Expand Up @@ -138,23 +138,27 @@ jobs:

- name: Check lib
run: cargo +${{ env.CRATE_TOOLCHAIN }} check --target ${{ matrix.target }} --lib --verbose
if: ${{ matrix.toolchain == 'msrv' }}

- name: Check extras
run: cargo +${{ env.CRATE_TOOLCHAIN }} check --target ${{ matrix.target }} --all-targets --verbose
if: ${{ matrix.toolchain != 'msrv' }}

- name: Test
run: cargo +${{ env.CRATE_TOOLCHAIN }} test --target ${{ matrix.target }} --verbose
- name: Test (doc)
run: cargo +${{ env.CRATE_TOOLCHAIN }} test --target ${{ matrix.target }} --verbose --doc
# Only run tests when targetting x86 (32- or 64-bit) - we're executing on
# x86_64, so we can't run tests for any non-x86 target.
if: ${{ matrix.toolchain != 'msrv' && (contains(matrix.target, 'x86_64') || contains(matrix.target, 'i686')) }}
if: ${{ matrix.toolchain == 'nightly' && (contains(matrix.target, 'x86_64') || contains(matrix.target, 'i686')) }}

- name: Test (integration)
run: cargo +${{ env.CRATE_TOOLCHAIN }} test --target ${{ matrix.target }} --verbose --tests
# Only run tests when targetting x86 (32- or 64-bit) - we're executing on
# x86_64, so we can't run tests for any non-x86 target.
if: ${{ (contains(matrix.target, 'x86_64') || contains(matrix.target, 'i686')) }}

- name: Test (loom)
run: cargo +${{ env.CRATE_TOOLCHAIN }} test --target ${{ matrix.target }} --verbose --release --tests
# Only run tests when targetting x86 (32- or 64-bit) - we're executing on
# x86_64, so we can't run tests for any non-x86 target.
if: ${{ matrix.toolchain != 'msrv' && (contains(matrix.target, 'x86_64') || contains(matrix.target, 'aarch64')) }}
if: ${{ (contains(matrix.target, 'x86_64') || contains(matrix.target, 'aarch64')) }}
env:
RUSTFLAGS: --cfg loom ${{ env.RUSTFLAGS }}

Expand Down Expand Up @@ -198,19 +202,6 @@ jobs:
set -e
cargo clippy --all-targets
check_msrv:
runs-on: ubuntu-latest
name: Check MSRVs match
steps:
- uses: actions/checkout@v3
- name: Rust Cache
uses: Swatinem/[email protected]
- uses: extractions/setup-just@v1
# Make sure that the MSRV in async-backtrace's and async-backtrace-attributes's
# `Cargo.toml` files are the same.
- name: Check MSRVs match
run: just check-msrv

check_readme:
runs-on: ubuntu-latest
name: Check README is correctly generated.
Expand All @@ -219,7 +210,7 @@ jobs:
- name: Rust Cache
uses: Swatinem/[email protected]
- uses: extractions/setup-just@v1
- name: Check MSRVs match
- name: Check README matches
run: |
set -e
cargo install cargo-readme --version 3.2.0
Expand All @@ -233,7 +224,6 @@ jobs:
- build_test
- check_fmt
- check_clippy
- check_msrv
- check_readme
runs-on: ubuntu-latest
steps:
Expand Down
1 change: 0 additions & 1 deletion attributes/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name = "async-backtrace-attributes"
version = "0.2.6"
edition = "2018"
license = "MIT"
rust-version = "1.59"
description = "Procedural macros for the `async-backtrace` crate."
repository = "https://github.com/tokio-rs/async-backtrace"

Expand Down
1 change: 0 additions & 1 deletion backtrace/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ version = "0.2.6"
edition = "2018"
license = "MIT"
readme = "../README.md"
rust-version = "1.59"
description = "Efficient, logical 'backtraces' of async tasks."
repository = "https://github.com/tokio-rs/async-backtrace"
categories = ["asynchronous", "development-tools::debugging"]
Expand Down
4 changes: 2 additions & 2 deletions backtrace/src/frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ impl Frame {
}

/// Produces an iterator over this frame's ancestors.
pub fn backtrace(&self) -> impl Iterator<Item = &Frame> + FusedIterator {
pub fn backtrace(&self) -> impl FusedIterator<Item = &Frame> {
/// An iterator that traverses up the tree of [`Frame`]s from a leaf.
#[derive(Clone)]
pub(crate) struct Backtrace<'a> {
Expand Down Expand Up @@ -399,7 +399,7 @@ impl Frame {
/// The caller must ensure that the corresponding Kind::Root{mutex} is
/// locked. The caller must also ensure that the returned iterator is
/// dropped before the mutex is dropped.
pub(crate) unsafe fn subframes(&self) -> impl Iterator<Item = &Frame> + FusedIterator {
pub(crate) unsafe fn subframes(&self) -> impl FusedIterator<Item = &Frame> {
pub(crate) struct Subframes<'a> {
iter: linked_list::Iter<'a, Frame>,
}
Expand Down
7 changes: 3 additions & 4 deletions backtrace/src/location.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ use futures::Future;
///
/// #[tokio::main]
/// async fn main() {
/// # macro_rules! assert_eq { ($l:expr, $r:expr) => { debug_assert_eq!($l.len(), $r.len()); } }
/// assert_eq!(location!().to_string(), "rust_out::main::{{closure}} at src/location.rs:8:16");
/// assert_eq!(location!().to_string(), "rust_out::main::{{closure}} at backtrace/src/location.rs:8:16");
///
/// async {
/// assert_eq!(location!().to_string(), "rust_out::main::{{closure}}::{{closure}} at src/location.rs:11:20");
/// assert_eq!(location!().to_string(), "rust_out::main::{{closure}}::{{closure}} at backtrace/src/location.rs:11:20");
/// }.await;
///
/// (|| async {
/// assert_eq!(location!().to_string(), "rust_out::main::{{closure}}::{{closure}}::{{closure}} at src/location.rs:15:20");
/// assert_eq!(location!().to_string(), "rust_out::main::{{closure}}::{{closure}}::{{closure}} at backtrace/src/location.rs:15:20");
/// })().await;
/// }
/// ```
Expand Down

0 comments on commit 31005fa

Please sign in to comment.