9
9
RUSTDOCFLAGS : -D warnings
10
10
TOOL : cargo
11
11
# The MSRV
12
- TOOLCHAIN : 1.46.0
12
+ TOOLCHAIN : 1.56.1
13
13
ZFLAGS :
14
14
15
15
# Tests that don't require executing the build binaries
16
16
build : &BUILD
17
17
build_script :
18
18
- . $HOME/.cargo/env || true
19
+ - $TOOL +$TOOLCHAIN -Vv
20
+ - rustc +$TOOLCHAIN -Vv
19
21
- $TOOL +$TOOLCHAIN $BUILD $ZFLAGS --target $TARGET --all-targets
20
22
- $TOOL +$TOOLCHAIN doc $ZFLAGS --no-deps --target $TARGET
21
- - $TOOL +$TOOLCHAIN clippy $ZFLAGS --target $TARGET -- -D warnings
22
- - if [ -z "$NOHACK" ]; then $TOOL +$TOOLCHAIN install cargo-hack; fi
23
+ - $TOOL +$TOOLCHAIN clippy $ZFLAGS --target $TARGET --all-targets -- -D warnings
24
+ - if [ -z "$NOHACK" ]; then mkdir -p $HOME/.cargo/bin; export PATH=$HOME/.cargo/bin:$PATH; fi
25
+ - 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
23
26
- if [ -z "$NOHACK" ]; then $TOOL +$TOOLCHAIN hack $ZFLAGS check --target $TARGET --each-feature; fi
24
27
25
28
# Tests that do require executing the binaries
@@ -34,11 +37,18 @@ test: &TEST
34
37
# 64-bit kernel and in a 64-bit environment. Our tests don't execute any of
35
38
# the system's binaries, so the environment shouldn't matter.
36
39
task :
37
- name : FreeBSD amd64 & i686
38
40
env :
39
41
TARGET : x86_64-unknown-freebsd
40
- freebsd_instance :
41
- image : freebsd-12-2-release-amd64
42
+ matrix :
43
+ - name : FreeBSD 12 amd64 & i686
44
+ freebsd_instance :
45
+ image : freebsd-12-3-release-amd64
46
+ - name : FreeBSD 14 amd64 & i686
47
+ freebsd_instance :
48
+ image_family : freebsd-14-0-snap
49
+ # Enable tests that would fail on FreeBSD 12
50
+ RUSTFLAGS : --cfg fbsd14 -D warnings
51
+ RUSTDOCFLAGS : --cfg fbsd14
42
52
setup_script :
43
53
- kldload mqueuefs
44
54
- fetch https://sh.rustup.rs -o rustup.sh
55
65
- cargo test --target i686-unknown-freebsd
56
66
i386_feature_script :
57
67
- . $HOME/.cargo/env
58
- - cargo hack check --each-feature --target i686-unknown-freebsd
68
+ - if [ -z "$NOHACK" ]; then cargo hack check --each-feature --target i686-unknown-freebsd; fi
59
69
before_cache_script : rm -rf $CARGO_HOME/registry/index
60
70
61
71
# Test macOS x86_64 in a full VM
80
90
env :
81
91
RUST_TEST_THREADS : 1 # QEMU works best with 1 thread
82
92
HOME : /tmp/home
93
+ HOST : x86_64-unknown-linux-gnu
83
94
PATH : $HOME/.cargo/bin:$PATH
84
95
RUSTFLAGS : --cfg qemu -D warnings
85
96
TOOL : cross
@@ -122,7 +133,7 @@ task:
122
133
- curl --proto '=https' --tlsv1.2 -sSf -o rustup.sh https://sh.rustup.rs
123
134
- sh rustup.sh -y --profile=minimal --default-toolchain $TOOLCHAIN
124
135
- . $HOME/.cargo/env
125
- - cargo install cross
136
+ - cargo install cross --version 0.2.1 # cross 0.2.2 bumped the MSRV to 1.58.1
126
137
- cp Cargo.lock.msrv Cargo.lock
127
138
<< : *TEST
128
139
before_cache_script : rm -rf $CARGO_HOME/registry/index
@@ -132,18 +143,18 @@ task:
132
143
matrix :
133
144
- name : Linux aarch64
134
145
arm_container :
135
- image : rust:1.46
146
+ image : rust:1.56
136
147
env :
137
148
RUSTFLAGS : --cfg graviton -D warnings
138
149
TARGET : aarch64-unknown-linux-gnu
139
150
- name : Linux x86_64
140
151
container :
141
- image : rust:1.46
152
+ image : rust:1.56
142
153
env :
143
154
TARGET : x86_64-unknown-linux-gnu
144
155
- name : Linux x86_64 musl
145
156
container :
146
- image : rust:1.46
157
+ image : rust:1.56
147
158
env :
148
159
TARGET : x86_64-unknown-linux-musl
149
160
setup_script :
@@ -169,9 +180,10 @@ task:
169
180
# Tasks for cross-compiling, but no testing
170
181
task :
171
182
container :
172
- image : rust:1.46
183
+ image : rust:1.56
173
184
env :
174
185
BUILD : check
186
+ HOST : x86_64-unknown-linux-gnu
175
187
matrix :
176
188
# Cross claims to support Android, but when it tries to run Nix's tests it
177
189
# reports undefined symbol references.
@@ -199,27 +211,18 @@ task:
199
211
- name : Illumos
200
212
env :
201
213
TARGET : x86_64-unknown-illumos
202
- # illumos toolchain isn't available via rustup until 1.50
203
- TOOLCHAIN : 1.50.0
204
- container :
205
- image : rust:1.50
206
214
# Cross claims to support running tests on iOS, but it actually doesn't.
207
215
# https://github.com/rust-embedded/cross/issues/535
208
216
- name : iOS aarch64
209
217
env :
210
218
# cargo hack tries to invoke the iphonesimulator SDK for iOS
211
219
NOHACK : 1
212
220
TARGET : aarch64-apple-ios
213
- # Rustup only supports cross-building from arbitrary hosts for iOS at
214
- # 1.49.0 and above. Below that it's possible to cross-build from a macOS
215
- # host, but macOS VMs are more expensive than Linux VMs.
216
- TOOLCHAIN : 1.49.0
217
221
- name : iOS x86_64
218
222
env :
219
223
# cargo hack tries to invoke the iphonesimulator SDK for iOS
220
224
NOHACK : 1
221
225
TARGET : x86_64-apple-ios
222
- TOOLCHAIN : 1.49.0
223
226
# Cross testing on powerpc fails with "undefined reference to renameat2".
224
227
# Perhaps cross is using too-old a version?
225
228
- name : Linux powerpc
@@ -239,10 +242,6 @@ task:
239
242
- name : macOS aarch64
240
243
env :
241
244
TARGET : aarch64-apple-darwin
242
- # macOS aarch64 toolchain isn't available via rustup until 1.49
243
- TOOLCHAIN : 1.49.0
244
- container :
245
- image : rust:1.49
246
245
- name : NetBSD x86_64
247
246
env :
248
247
TARGET : x86_64-unknown-netbsd
@@ -256,11 +255,12 @@ task:
256
255
257
256
task :
258
257
container :
259
- image : rust:1.46
258
+ image : rust:1.56
260
259
env :
261
260
BUILD : check
262
261
name : Redox x86_64
263
262
env :
263
+ HOST : x86_64-unknown-linux-gnu
264
264
TARGET : x86_64-unknown-redox
265
265
# Redox's MSRV policy is unclear. Until they define it, use nightly.
266
266
TOOLCHAIN : nightly
@@ -277,6 +277,7 @@ task:
277
277
image : rustlang/rust:nightly
278
278
env :
279
279
BUILD : check
280
+ HOST : x86_64-unknown-linux-gnu
280
281
TOOLCHAIN : nightly
281
282
ZFLAGS : -Zbuild-std
282
283
matrix :
@@ -289,6 +290,9 @@ task:
289
290
- name : Linux armv7 uclibceabihf
290
291
env :
291
292
TARGET : armv7-unknown-linux-uclibceabihf
293
+ - name : Haiku x86_64
294
+ env :
295
+ TARGET : x86_64-unknown-haiku
292
296
setup_script :
293
297
- rustup component add rust-src
294
298
<< : *BUILD
@@ -300,6 +304,7 @@ task:
300
304
task :
301
305
name : Minver
302
306
env :
307
+ HOST : x86_64-unknown-linux-gnu
303
308
TOOLCHAIN : nightly
304
309
container :
305
310
image : rustlang/rust:nightly
@@ -308,3 +313,11 @@ task:
308
313
check_script :
309
314
- cargo check
310
315
before_cache_script : rm -rf $CARGO_HOME/registry/index
316
+
317
+ # Tasks that checks if the code is formatted right using `cargo fmt` tool
318
+ task :
319
+ name : Rust Formatter
320
+ container :
321
+ image : rust:latest
322
+ setup_script : rustup +$TOOLCHAIN component add rustfmt
323
+ test_script : $TOOL +$TOOLCHAIN fmt --all -- --check
0 commit comments