Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -484,11 +484,9 @@ jobs:

msrv:
name: MSRV
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ubuntu-latest
# TODO: switch to a matrix build once the MSRV is >= 1.68, which supports Cargo's sparse registry protocol.
# Without it, each job would cache the Git-based crates.io index, each adding ~690 MB to the GitHub Actions cache.
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
Expand All @@ -499,15 +497,24 @@ jobs:
uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0
with:
cache: false
target: |
aarch64-apple-darwin
wasm32-unknown-unknown
x86_64-pc-windows-msvc
x86_64-unknown-linux-gnu
toolchain: ${{ env.MSRV }}
- uses: taiki-e/install-action@e67fa11c4b9316fa714ddf0abed07a0c3143b95b # v2.87.4
with:
tool: |
cargo-hack
cargo-minimal-versions
tool: cargo-hack
fallback: none
# Cache the crates.io registry because older Cargo versions do not support the sparse registry protocol.
# This can be removed once the MSRV is >= 1.68.
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
- run: cargo minimal-versions check --workspace --all-targets --feature-powerset --ignore-private
- run: RUSTC_BOOTSTRAP=1 cargo -Zminimal-versions generate-lockfile
- run: cargo hack check --locked --workspace --all-targets --feature-powerset --ignore-private --target aarch64-apple-darwin

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

--all-targets is usually a bad idea here since it enables dev-deps. This often hides compile errors that exist in lib/bin which will be released on crates.io. See also the quoted comment in https://github.com/taiki-e/cargo-minimal-versions#details.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Is --no-dev-deps necessary with cargo-minimal-versions?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

cargo-minimal-versions automatically do the same processing as --no-dev-deps when --all-targets/--tests/etc. are not used.

- run: cargo hack check --locked --workspace --all-targets --feature-powerset --ignore-private --target wasm32-unknown-unknown
- run: cargo hack check --locked --workspace --all-targets --feature-powerset --ignore-private --target x86_64-pc-windows-msvc
- run: cargo hack check --locked --workspace --all-targets --feature-powerset --ignore-private --target x86_64-unknown-linux-gnu

clippy:
name: Clippy
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ unexpected_cfgs = { level = "allow", check-cfg = ["cfg(disable_clang_cl_tests)"]

[dependencies]
find-msvc-tools = { path = "find-msvc-tools", version = "0.1.12" }
jobserver = { version = "0.1.30", default-features = false, optional = true }
jobserver = { version = "0.1.32", default-features = false, optional = true }
shlex = "2.0.1"

[dev-dependencies]
tempfile = "3"
tempfile = "3.0.4"

[target.'cfg(unix)'.dependencies]
# Don't turn on the feature "std" for this, see https://github.com/rust-lang/cargo/issues/4866
Expand Down
Loading