Skip to content

Commit bf7a5fd

Browse files
committedDec 7, 2020
Switch all builds from Travis to Cirrus
Travis has been super-slow lately (> 6 hours per build). Cirrus is much faster: about 20 minutes. Cirrus also has slightly better test coverage, mainly because it doesn't use SECCOMP. Also, * Fix the Redox CI build. The old Travis configuration didn't actually build for Redox, so we never noticed that Redox can't be built with a stable compiler. Thanks to @coolreader18 for finding this. * Disable the udp_offload tests on cross-tested platforms. These tests are failing with ENOPROTOOPT in Cirrus-CI. I suspect it's due to a lack of support in QEMU. These tests were skipped on Travis because its kernel was too old. * Fix require_kernel_version on Cirrus-CI. Cirrus reports the Linux kernel version as 4.19.112+, which the semver crate can't handle. * Fix test_setfsuid on Cirrus. When run on Cirrus, it seems like the file in /tmp gets deleted as soon as it's closed. Probably an overzealous temporary file cleaner. Use /var/tmp, because no temporary file cleaner should run in there. * Skip mount tests on Cirrus. They fail for an unknown reason. Issue nix-rust#1351 * Skip the AF_ALG tests on Cirrus-CI Issue nix-rust#1352
1 parent a1eb895 commit bf7a5fd

17 files changed

+396
-276
lines changed
 

‎.cirrus.yml

+190-8
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
freebsd_instance:
2-
image: freebsd-11-4-release-amd64
1+
cargo_cache:
2+
folder: $CARGO_HOME/registry
3+
fingerprint_script: cat Cargo.lock || echo ""
34

4-
# Test FreeBSD in a full VM on cirrus-ci.com. Test the i686 target too, in the
5+
# Test FreeBSD in a full VM. Test the i686 target too, in the
56
# same VM. The binary will be built in 32-bit mode, but will execute on a
67
# 64-bit kernel and in a 64-bit environment. Our tests don't execute any of
78
# the system's binaries, so the environment shouldn't matter.
89
task:
9-
name: FreeBSD 11.4
10-
cargo_cache:
11-
folder: $CARGO_HOME/registry
12-
fingerprint_script: cat Cargo.lock || echo ""
13-
# Install Rust
10+
name: FreeBSD amd64 & i686
11+
freebsd_instance:
12+
image: freebsd-11-4-release-amd64
1413
setup_script:
1514
- fetch https://sh.rustup.rs -o rustup.sh
1615
- sh rustup.sh -y --profile=minimal --default-toolchain 1.36.0
@@ -22,3 +21,186 @@ task:
2221
- . $HOME/.cargo/env
2322
- cargo test --target i686-unknown-freebsd
2423
before_cache_script: rm -rf $CARGO_HOME/registry/index
24+
25+
task:
26+
matrix:
27+
- name: OSX x86_64
28+
env:
29+
TARGET: x86_64-apple-darwin
30+
- name: OSX i686
31+
env:
32+
TARGET: i686-apple-darwin
33+
DISABLE_TESTS: 1
34+
- name: iOS
35+
env:
36+
# To save VM startup time, test all iOS targets in a single task.
37+
# The startup and scheduling time was very significant for Travis, but
38+
# not known for Cirrus.
39+
TARGET: "aarch64-apple-ios;armv7-apple-ios;armv7s-apple-ios;i386-apple-ios;x86_64-apple-ios"
40+
DISABLE_TESTS: 1
41+
osx_instance:
42+
image: catalina-xcode
43+
setup_script:
44+
- curl --proto '=https' --tlsv1.2 -sSf -o rustup.sh https://sh.rustup.rs
45+
- sh rustup.sh -y --profile=minimal --default-toolchain 1.36.0
46+
- . $HOME/.cargo/env
47+
- bash ci/install.sh
48+
script:
49+
- . $HOME/.cargo/env
50+
- bash ci/script.sh
51+
before_cache_script: rm -rf $CARGO_HOME/registry/index
52+
53+
# Use cross for QEMU-based testing
54+
# cross needs to execute Docker, so we must use Cirrus's Docker Builder task.
55+
docker_builder:
56+
env:
57+
RUST_TEST_THREADS: 1 # QEMU works best with 1 thread
58+
HOME: /tmp/home
59+
PATH: $HOME/.cargo/bin:$PATH
60+
#cpu: 1 docker_builder doesn't support "cpu"?
61+
matrix:
62+
- name: Linux aarch64
63+
env:
64+
TARGET: aarch64-unknown-linux-gnu
65+
- name: Linux arm gnueabi
66+
env:
67+
TARGET: arm-unknown-linux-gnueabi
68+
- name: Linux armv7 gnueabihf
69+
env:
70+
TARGET: armv7-unknown-linux-gnueabihf
71+
- name: Linux i686
72+
env:
73+
TARGET: i686-unknown-linux-gnu
74+
- name: Linux i686 musl
75+
env:
76+
TARGET: i686-unknown-linux-musl
77+
- name: Linux MIPS
78+
env:
79+
TARGET: mips-unknown-linux-gnu
80+
- name: Linux MIPS64
81+
env:
82+
TARGET: mips64-unknown-linux-gnuabi64
83+
- name: Linux MIPS64 el
84+
env:
85+
TARGET: mips64el-unknown-linux-gnuabi64
86+
- name: Linux mipsel
87+
env:
88+
TARGET: mipsel-unknown-linux-gnu
89+
- name: Linux powerpc64le
90+
env:
91+
TARGET: powerpc64le-unknown-linux-gnu
92+
setup_script:
93+
- mkdir /tmp/home
94+
- curl --proto '=https' --tlsv1.2 -sSf -o rustup.sh https://sh.rustup.rs
95+
- sh rustup.sh -y --profile=minimal --default-toolchain 1.36.0
96+
- . $HOME/.cargo/env
97+
- bash ci/install.sh
98+
script:
99+
- . $HOME/.cargo/env || true
100+
- bash ci/script.sh
101+
before_cache_script: rm -rf $CARGO_HOME/registry/index
102+
103+
# Tasks for Linux amd64 builds
104+
task:
105+
matrix:
106+
- name: Rust Stable
107+
env:
108+
TARGET: x86_64-unknown-linux-gnu
109+
TOOLCHAIN: stable
110+
- name: Linux x86_64
111+
env:
112+
TARGET: x86_64-unknown-linux-gnu
113+
TOOLCHAIN: 1.36.0
114+
- name: Linux x86_64 musl
115+
env:
116+
TARGET: x86_64-unknown-linux-musl
117+
TOOLCHAIN: 1.36.0
118+
container:
119+
image: rust:1.36
120+
setup_script:
121+
- rustup toolchain install $TOOLCHAIN
122+
- rustup target add --toolchain $TOOLCHAIN $TARGET
123+
script:
124+
- cargo +$TOOLCHAIN build --target $TARGET --all-targets
125+
- cargo +$TOOLCHAIN build --target $TARGET --all-targets --release
126+
- cargo +$TOOLCHAIN test --target $TARGET
127+
- cargo +$TOOLCHAIN test --target $TARGET --release
128+
before_cache_script: rm -rf $CARGO_HOME/registry/index
129+
130+
# Tasks for cross-compiling, but no testing
131+
task:
132+
matrix:
133+
- name: Android aarch64
134+
env:
135+
TARGET: aarch64-linux-android
136+
- name: Android arm
137+
env:
138+
TARGET: arm-linux-androideabi
139+
- name: Android armv7
140+
env:
141+
TARGET: armv7-linux-androideabi
142+
- name: Android i686
143+
env:
144+
TARGET: i686-linux-android
145+
- name: Android x86_64
146+
env:
147+
TARGET: x86_64-linux-android
148+
- name: Linux arm-musleabi
149+
env:
150+
TARGET: arm-unknown-linux-musleabi
151+
- name: Linux powerpc
152+
env:
153+
TARGET: powerpc-unknown-linux-gnu
154+
- name: Linux s390x
155+
env:
156+
TARGET: s390x-unknown-linux-gnu
157+
- name: Linux s390x
158+
env:
159+
TARGET: s390x-unknown-linux-gnu
160+
- name: NetBSD x86_64
161+
env:
162+
TARGET: x86_64-unknown-netbsd
163+
container:
164+
image: rust:1.36
165+
setup_script:
166+
- rustup target add $TARGET
167+
script:
168+
- cargo +$TOOLCHAIN check --target $TARGET
169+
- cargo +$TOOLCHAIN check --target $TARGET --release
170+
# TODO: check the tests, too. The old Travis CI setup didn't do that, so
171+
# they don't build on all platforms.
172+
before_cache_script: rm -rf $CARGO_HOME/registry/index
173+
174+
# Redoxer is too unreliable, so we'll do a cross-build only
175+
# See also:
176+
# https://github.com/nix-rust/nix/issues/1258
177+
# https://github.com/rust-embedded/cross/issues/427
178+
task:
179+
name: Redox x86_64
180+
env:
181+
TARGET: x86_64-unknown-redox
182+
# Redox requires a nightly compiler.
183+
# If stuff breaks, change nightly to the date in the toolchain_*
184+
# directory at https://static.redox-os.org
185+
TOOLCHAIN: nightly-2020-08-04
186+
container:
187+
image: rustlang/rust:nightly
188+
setup_script:
189+
- rustup toolchain install $TOOLCHAIN --profile minimal --target $TARGET
190+
script:
191+
- cargo +$TOOLCHAIN check --target $TARGET
192+
- cargo +$TOOLCHAIN check --target $TARGET --release
193+
before_cache_script: rm -rf $CARGO_HOME/registry/index
194+
195+
# Test that we can build with the lowest version of all dependencies.
196+
# "cargo test" doesn't work because some of our dev-dependencies, like
197+
# rand, can't build with thier own minimal dependencies.
198+
task:
199+
name: Minver
200+
container:
201+
image: rustlang/rust:nightly
202+
setup_script:
203+
- cargo update -Zminimal-versions
204+
script:
205+
- cargo check
206+
before_cache_script: rm -rf $CARGO_HOME/registry/index

‎.travis.yml

-136
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.