Skip to content

Commit 9b33131

Browse files
committed
Fix CI with the latest Rustup
The latest Rustup does not allow the toolchain specification to be blank, which we were using. Fix it by ensuring that only one toolchain is ever installed in a given task, so we won't need to use the +$TOOLCHAIN with cargo.
1 parent c6f9e23 commit 9b33131

File tree

1 file changed

+20
-28
lines changed

1 file changed

+20
-28
lines changed

.cirrus.yml

+20-28
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,28 @@ env:
88
RUSTFLAGS: -D warnings
99
RUSTDOCFLAGS: -D warnings
1010
TOOL: cargo
11-
# The MSRV
12-
TOOLCHAIN: 1.63.0
11+
MSRV: 1.63.0
1312
ZFLAGS:
1413

1514
# Tests that don't require executing the build binaries
1615
build: &BUILD
1716
build_script:
1817
- . $HOME/.cargo/env || true
19-
- $TOOL +$TOOLCHAIN -Vv
20-
- rustc +$TOOLCHAIN -Vv
21-
- $TOOL +$TOOLCHAIN $BUILD $ZFLAGS --target $TARGET --all-targets
22-
- $TOOL +$TOOLCHAIN doc $ZFLAGS --no-deps --target $TARGET
23-
- $TOOL +$TOOLCHAIN clippy $ZFLAGS --target $TARGET --all-targets -- -D warnings
18+
- $TOOL -Vv
19+
- rustc -Vv
20+
- $TOOL $BUILD $ZFLAGS --target $TARGET --all-targets
21+
- $TOOL doc $ZFLAGS --no-deps --target $TARGET
22+
- $TOOL clippy $ZFLAGS --target $TARGET --all-targets -- -D warnings
2423
- if [ -z "$NOHACK" ]; then mkdir -p $HOME/.cargo/bin; export PATH=$HOME/.cargo/bin:$PATH; fi
2524
- if [ -z "$NOHACK" ]; then curl -LsSf https://github.com/taiki-e/cargo-hack/releases/latest/download/cargo-hack-${HOST:-$TARGET}.tar.gz | tar xzf - -C ~/.cargo/bin; fi
26-
- if [ -z "$NOHACK" ]; then $TOOL +$TOOLCHAIN hack $ZFLAGS check --target $TARGET --each-feature; fi
25+
- if [ -z "$NOHACK" ]; then $TOOL hack $ZFLAGS check --target $TARGET --each-feature; fi
2726

2827
# Tests that do require executing the binaries
2928
test: &TEST
3029
<< : *BUILD
3130
test_script:
3231
- . $HOME/.cargo/env || true
33-
- $TOOL +$TOOLCHAIN test --target $TARGET
32+
- $TOOL test --target $TARGET
3433

3534
# Test FreeBSD in a full VM. Test the i686 target too, in the
3635
# same VM. The binary will be built in 32-bit mode, but will execute on a
@@ -52,10 +51,10 @@ task:
5251
setup_script:
5352
- kldload mqueuefs
5453
- fetch https://sh.rustup.rs -o rustup.sh
55-
- sh rustup.sh -y --profile=minimal --default-toolchain $TOOLCHAIN
54+
- sh rustup.sh -y --profile=minimal --default-toolchain $MSRV
5655
- . $HOME/.cargo/env
5756
- rustup target add i686-unknown-freebsd
58-
- rustup component add --toolchain $TOOLCHAIN clippy
57+
- rustup component add clippy
5958
<< : *TEST
6059
i386_test_script:
6160
- . $HOME/.cargo/env
@@ -76,9 +75,9 @@ task:
7675
image: ghcr.io/cirruslabs/macos-ventura-base:latest
7776
setup_script:
7877
- curl --proto '=https' --tlsv1.2 -sSf -o rustup.sh https://sh.rustup.rs
79-
- sh rustup.sh -y --profile=minimal --default-toolchain $TOOLCHAIN
78+
- sh rustup.sh -y --profile=minimal --default-toolchain $MSRV
8079
- . $HOME/.cargo/env
81-
- rustup component add --toolchain $TOOLCHAIN clippy
80+
- rustup component add clippy
8281
<< : *TEST
8382
before_cache_script: rm -rf $CARGO_HOME/registry/index
8483

@@ -129,7 +128,7 @@ task:
129128
setup_script:
130129
- mkdir /tmp/home
131130
- curl --proto '=https' --tlsv1.2 -sSf -o rustup.sh https://sh.rustup.rs
132-
- sh rustup.sh -y --profile=minimal --default-toolchain $TOOLCHAIN
131+
- sh rustup.sh -y --profile=minimal --default-toolchain $MSRV
133132
- . $HOME/.cargo/env
134133
- cargo install cross --version 0.2.1 # cross 0.2.2 bumped the MSRV to 1.58.1
135134
<< : *TEST
@@ -165,9 +164,7 @@ task:
165164
image: rust:latest
166165
env:
167166
TARGET: x86_64-unknown-linux-gnu
168-
TOOLCHAIN:
169167
setup_script:
170-
- rustup target add $TARGET
171168
- rustup component add clippy
172169
<< : *TEST
173170
before_cache_script: rm -rf $CARGO_HOME/registry/index
@@ -242,37 +239,33 @@ task:
242239
TARGET: x86_64-unknown-netbsd
243240
setup_script:
244241
- rustup target add $TARGET
245-
- rustup toolchain install $TOOLCHAIN --profile minimal --target $TARGET
246-
- rustup component add --toolchain $TOOLCHAIN clippy
242+
- rustup component add clippy
247243
<< : *BUILD
248244
before_cache_script: rm -rf $CARGO_HOME/registry/index
249245

250246
task:
251247
container:
252-
image: rust:1.63.0
248+
# Redox's MSRV policy is unclear. Until they define it, use nightly.
249+
image: rustlang/rust:nightly
253250
env:
254251
BUILD: check
255252
name: Redox x86_64
256253
env:
257254
HOST: x86_64-unknown-linux-gnu
258255
TARGET: x86_64-unknown-redox
259-
# Redox's MSRV policy is unclear. Until they define it, use nightly.
260-
TOOLCHAIN: nightly
261256
setup_script:
262257
- rustup target add $TARGET
263-
- rustup toolchain install $TOOLCHAIN --profile minimal --target $TARGET
264-
- rustup component add --toolchain $TOOLCHAIN clippy
258+
- rustup component add clippy
265259
<< : *BUILD
266260
before_cache_script: rm -rf $CARGO_HOME/registry/index
267261

268-
# Rust Tier 3 targets can't use Rustup
262+
## Rust Tier 3 targets can't use Rustup
269263
task:
270264
container:
271265
image: rustlang/rust:nightly
272266
env:
273267
BUILD: check
274268
HOST: x86_64-unknown-linux-gnu
275-
TOOLCHAIN: nightly
276269
ZFLAGS: -Zbuild-std
277270
matrix:
278271
- name: DragonFly BSD x86_64
@@ -299,7 +292,6 @@ task:
299292
name: Minver
300293
env:
301294
HOST: x86_64-unknown-linux-gnu
302-
TOOLCHAIN: nightly
303295
container:
304296
image: rustlang/rust:nightly
305297
setup_script:
@@ -313,5 +305,5 @@ task:
313305
name: Rust Formatter
314306
container:
315307
image: rust:latest
316-
setup_script: rustup +$TOOLCHAIN component add rustfmt
317-
test_script: $TOOL +$TOOLCHAIN fmt --all -- --check **/*.rs
308+
setup_script: rustup component add rustfmt
309+
test_script: cargo fmt --all -- --check **/*.rs

0 commit comments

Comments
 (0)