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
13 changes: 7 additions & 6 deletions .github/scripts/generate-lockfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ set -e

# allow overriding cargo binary
: "${CARGO_BIN:=cargo}"
echo "\`$CARGO_BIN --version\`: $($CARGO_BIN --version)"
: "${CARGO_STABLE_BIN:=cargo +stable}"
echo "\`$CARGO_STABLE_BIN --version\`: $($CARGO_STABLE_BIN --version)"

RESOLVER_V3_MIN_VERSION='1.84.0'
VERSION="$($CARGO_BIN --version | cut -d' ' -f2)"
Expand All @@ -19,12 +22,10 @@ LOWER_VERSION="$(echo -e "$RESOLVER_V3_MIN_VERSION\n$VERSION" | sort --version-s
if [[ "$LOWER_VERSION" == "$RESOLVER_V3_MIN_VERSION" ]]; then
$CARGO_BIN generate-lockfile
else
# generate lockfile with resolver v3 using stable toolchain
$CARGO_STABLE_BIN generate-lockfile

# then make it MSRV-compatible
# must declare workspace resolver, or it defaults to v1
sed -Ei '/resolver ?=/ s/3/2/' Cargo.toml

$CARGO_BIN generate-lockfile

# manually downgrade dependencies to compatible versions
$CARGO_BIN update --package phf --precise 0.13.1
$CARGO_BIN update --package unicode-segmentation --precise 1.12.0
fi
8 changes: 8 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v7

# needed for generating lockfile using resolver v3
- name: Install stable Rust
if: ${{ matrix.rust == needs.get-msrv.outputs.msrv }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable

# this overrides the default toolchain from the previous step
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
Expand Down