Skip to content

Commit f752f87

Browse files
authored
Fix Evergreen task for MSRV compilation with async-std (#672)
1 parent 3e49a6f commit f752f87

File tree

5 files changed

+38
-27
lines changed

5 files changed

+38
-27
lines changed

.evergreen/MSRV-Cargo.lock

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.evergreen/compile-only-async-std.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.

.evergreen/compile-only-tokio.sh

Lines changed: 0 additions & 16 deletions
This file was deleted.

.evergreen/compile-only.sh

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,25 @@ source ./.evergreen/configure-rust.sh
66
rustup update $RUST_VERSION
77

88
if [ "$ASYNC_RUNTIME" = "tokio" ]; then
9-
.evergreen/compile-only-tokio.sh
9+
FEATURE_FLAGS=snappy-compression,zlib-compression
10+
11+
# Zstd requires Rust version 1.54
12+
if [[ $RUST_VERSION == "nightly" ]]; then
13+
FEATURE_FLAGS=$FEATURE_FLAGS,zstd-compression
14+
fi
15+
16+
rustup run $RUST_VERSION cargo build --features $FEATURE_FLAGS
17+
rustup run $RUST_VERSION cargo build --features tokio-sync,$FEATURE_FLAGS
18+
1019
elif [ "$ASYNC_RUNTIME" = "async-std" ]; then
11-
.evergreen/compile-only-async-std.sh
20+
# v2.1 of async-global-executor bumped its MSRV to 1.59, so we need a Cargo.lock
21+
# pinning to v2.0 to build with our MSRV.
22+
if [ "$MSRV" = "true" ]; then
23+
cp .evergreen/MSRV-Cargo.lock Cargo.lock
24+
fi
25+
26+
rustup run $RUST_VERSION cargo build --no-default-features --features async-std-runtime
27+
rustup run $RUST_VERSION cargo build --no-default-features --features sync
1228
else
1329
echo "invalid async runtime: ${ASYNC_RUNTIME}" >&2
1430
exit 1

.evergreen/config.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ functions:
537537
working_dir: "src"
538538
script: |
539539
${PREPARE_SHELL}
540-
ASYNC_RUNTIME=${ASYNC_RUNTIME} RUST_VERSION=${RUST_VERSION} .evergreen/compile-only.sh
540+
ASYNC_RUNTIME=${ASYNC_RUNTIME} RUST_VERSION=${RUST_VERSION} MSRV=${MSRV} .evergreen/compile-only.sh
541541
542542
"check cargo deny":
543543
- command: shell.exec
@@ -1444,6 +1444,7 @@ axes:
14441444
display_name: "1.53 (minimum supported version)"
14451445
variables:
14461446
RUST_VERSION: "1.53.0"
1447+
MSRV: true
14471448
- id: "nightly"
14481449
display_name: "nightly"
14491450
variables:

0 commit comments

Comments
 (0)