Skip to content

Commit d20fe20

Browse files
committed
Multiple CI improvements:
* Install cross the easy way, via cargo * Don't test in release mode. Nix contains no release-dependent paths, and release mode testing has to my knowledge never revealed a bug in Nix. * Add Linux powerpc back to CI, fixed by the latest cross. * Check the tests even on platforms that can't run them. * DRY for the Illumos and Redox sections * Cross-check iOS from a Linux VM instead of OSX * Revert the workaround for rust-lang/rustup issue 2774
1 parent f3cb6b3 commit d20fe20

File tree

4 files changed

+52
-138
lines changed

4 files changed

+52
-138
lines changed

.cirrus.yml

Lines changed: 51 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ cargo_cache:
88
# the system's binaries, so the environment shouldn't matter.
99
task:
1010
name: FreeBSD amd64 & i686
11-
env:
12-
# Temporary workaround for https://github.com/rust-lang/rustup/issues/2774
13-
RUSTUP_IO_THREADS: 1
1411
freebsd_instance:
1512
image: freebsd-11-4-release-amd64
1613
setup_script:
@@ -31,24 +28,17 @@ task:
3128
- name: OSX x86_64
3229
env:
3330
TARGET: x86_64-apple-darwin
34-
- name: iOS aarch64
35-
env:
36-
TARGET: aarch64-apple-ios
37-
DISABLE_TESTS: 1
38-
- name: iOS x86_64
39-
env:
40-
TARGET: x86_64-apple-ios
41-
DISABLE_TESTS: 1
4231
osx_instance:
4332
image: catalina-xcode
4433
setup_script:
4534
- curl --proto '=https' --tlsv1.2 -sSf -o rustup.sh https://sh.rustup.rs
4635
- sh rustup.sh -y --profile=minimal --default-toolchain 1.46.0
4736
- . $HOME/.cargo/env
48-
- bash ci/install.sh
37+
- cargo install cross
4938
script:
5039
- . $HOME/.cargo/env
51-
- bash ci/script.sh
40+
- cross build --target $TARGET
41+
- cross test --target $TARGET
5242
before_cache_script: rm -rf $CARGO_HOME/registry/index
5343

5444
# Use cross for QEMU-based testing
@@ -100,10 +90,11 @@ task:
10090
- curl --proto '=https' --tlsv1.2 -sSf -o rustup.sh https://sh.rustup.rs
10191
- sh rustup.sh -y --profile=minimal --default-toolchain 1.46.0
10292
- . $HOME/.cargo/env
103-
- bash ci/install.sh
93+
- cargo install cross
10494
script:
10595
- . $HOME/.cargo/env || true
106-
- bash ci/script.sh
96+
- cross build --target $TARGET
97+
- cross test --target $TARGET
10798
before_cache_script: rm -rf $CARGO_HOME/registry/index
10899

109100
# Tasks for Linux amd64 builds
@@ -128,14 +119,18 @@ task:
128119
- rustup target add --toolchain $TOOLCHAIN $TARGET
129120
script:
130121
- cargo +$TOOLCHAIN build --target $TARGET --all-targets
131-
- cargo +$TOOLCHAIN build --target $TARGET --all-targets --release
132122
- cargo +$TOOLCHAIN test --target $TARGET
133-
- cargo +$TOOLCHAIN test --target $TARGET --release
134123
before_cache_script: rm -rf $CARGO_HOME/registry/index
135124

136125
# Tasks for cross-compiling, but no testing
137126
task:
127+
container:
128+
image: rust:1.46
129+
env:
130+
TOOLCHAIN: 1.46.0
138131
matrix:
132+
# Cross claims to support Android, but when it tries to run Nix's tests it
133+
# reports undefined symbol references.
139134
- name: Android aarch64
140135
env:
141136
TARGET: aarch64-linux-android
@@ -154,9 +149,40 @@ task:
154149
- name: Linux arm-musleabi
155150
env:
156151
TARGET: arm-unknown-linux-musleabi
152+
- name: Fuchsia x86_64
153+
env:
154+
TARGET: x86_64-fuchsia
155+
- name: Illumos
156+
env:
157+
TARGET: x86_64-unknown-illumos
158+
# illumos toolchain isn't available via rustup until 1.50
159+
TOOLCHAIN: 1.50.0
160+
container:
161+
image: rust:1.50
162+
# Cross claims to support running tests on iOS, but it actually doesn't.
163+
# https://github.com/rust-embedded/cross/issues/535
164+
- name: iOS aarch64
165+
env:
166+
TARGET: aarch64-apple-ios
167+
# Rustup only supports cross-building from arbitrary hosts for iOS at
168+
# 1.49.0 and above. Below that it's possible to cross-build from an OSX
169+
# host, but OSX VMs
170+
# are more expensive than Linux VMs.
171+
TOOLCHAIN: 1.49.0
172+
- name: iOS x86_64
173+
env:
174+
TARGET: x86_64-apple-ios
175+
TOOLCHAIN: 1.49.0
176+
# Cross testing on powerpc fails with "undefined reference to renameat2".
177+
# Perhaps cross is using too-old a version?
157178
- name: Linux powerpc
158179
env:
159180
TARGET: powerpc-unknown-linux-gnu
181+
# Cross claims to support Linux powerpc64, but it really doesn't.
182+
# https://github.com/rust-embedded/cross/issues/441
183+
- name: Linux powerpc64
184+
env:
185+
TARGET: powerpc64-unknown-linux-gnu
160186
- name: Linux s390x
161187
env:
162188
TARGET: s390x-unknown-linux-gnu
@@ -166,57 +192,24 @@ task:
166192
- name: NetBSD x86_64
167193
env:
168194
TARGET: x86_64-unknown-netbsd
169-
- name: Fuchsia x86_64
195+
- name: Redox x86_64
170196
env:
171-
TARGET: x86_64-fuchsia
172-
container:
173-
image: rust:1.46
174-
setup_script:
175-
- rustup target add $TARGET
176-
script:
177-
- cargo +$TOOLCHAIN check --target $TARGET
178-
- cargo +$TOOLCHAIN check --target $TARGET --release
179-
- cargo +$TOOLCHAIN check --all-targets --target $TARGET
180-
before_cache_script: rm -rf $CARGO_HOME/registry/index
181-
182-
# illumos toolchain isn't available via rustup until 1.50
183-
task:
184-
name: illumos
185-
env:
186-
TARGET: x86_64-unknown-illumos
187-
container:
188-
image: rust:1.50
197+
TARGET: x86_64-unknown-redox
198+
# Redox requires a nightly compiler.
199+
# If stuff breaks, change nightly to the date in the toolchain_*
200+
# directory at https://static.redox-os.org
201+
TOOLCHAIN: nightly-2020-08-04
189202
setup_script:
190203
- rustup target add $TARGET
191-
script:
192-
- cargo +$TOOLCHAIN check --target $TARGET
193-
- cargo +$TOOLCHAIN check --target $TARGET --release
194-
before_cache_script: rm -rf $CARGO_HOME/registry/index
195-
196-
# Redoxer is too unreliable, so we'll do a cross-build only
197-
# See also:
198-
# https://github.com/nix-rust/nix/issues/1258
199-
# https://github.com/rust-embedded/cross/issues/427
200-
task:
201-
name: Redox x86_64
202-
env:
203-
TARGET: x86_64-unknown-redox
204-
# Redox requires a nightly compiler.
205-
# If stuff breaks, change nightly to the date in the toolchain_*
206-
# directory at https://static.redox-os.org
207-
TOOLCHAIN: nightly-2020-08-04
208-
container:
209-
image: rustlang/rust:nightly
210-
setup_script:
211204
- rustup toolchain install $TOOLCHAIN --profile minimal --target $TARGET
212205
script:
213206
- cargo +$TOOLCHAIN check --target $TARGET
214-
- cargo +$TOOLCHAIN check --target $TARGET --release
207+
- cargo +$TOOLCHAIN check --all-targets --target $TARGET
215208
before_cache_script: rm -rf $CARGO_HOME/registry/index
216209

217210
# Test that we can build with the lowest version of all dependencies.
218211
# "cargo test" doesn't work because some of our dev-dependencies, like
219-
# rand, can't build with thier own minimal dependencies.
212+
# rand, can't build with their own minimal dependencies.
220213
task:
221214
name: Minver
222215
container:

bors.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ status = [
1717
"Linux i686",
1818
"Linux mipsel",
1919
"Linux powerpc",
20+
"Linux powerpc64",
2021
"Linux powerpc64le",
2122
"Linux s390x",
2223
"Linux x32",

ci/install.sh

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

ci/script.sh

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

0 commit comments

Comments
 (0)