Skip to content

Commit f95fc16

Browse files
kmaharpatrickfreed
authored andcommitted
Fix Evergreen task for MSRV compilation with async-std (#672)
1 parent 546011f commit f95fc16

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 @@ set -o errexit
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
@@ -535,7 +535,7 @@ functions:
535535
working_dir: "src"
536536
script: |
537537
${PREPARE_SHELL}
538-
ASYNC_RUNTIME=${ASYNC_RUNTIME} RUST_VERSION=${RUST_VERSION} .evergreen/compile-only.sh
538+
ASYNC_RUNTIME=${ASYNC_RUNTIME} RUST_VERSION=${RUST_VERSION} MSRV=${MSRV} .evergreen/compile-only.sh
539539
540540
"check rustfmt":
541541
- command: shell.exec
@@ -1292,6 +1292,7 @@ axes:
12921292
display_name: "1.51 (minimum supported version)"
12931293
variables:
12941294
RUST_VERSION: "1.51.0"
1295+
MSRV: true
12951296
- id: "nightly"
12961297
display_name: "nightly"
12971298
variables:

0 commit comments

Comments
 (0)