Skip to content

Commit 8f1acf4

Browse files
committed
Build all platforms in CI
This commit adds a `ci/build.sh` script that checks that libc builds correctly for some common configurations (`--no-default-features`, `default`, `extra_traits`) on most targets supported by Rust since Rust 1.13.0 (the oldest Rust version that libc supports). The build matrix is refactored into two stages. The first stage is called `tools-and-build-and-tier1` and it aims to discover issues quickly by running the documentation and linter builds, as well as checking that the library builds correctly on all targets in all supported channels and "problematic" Rust versions; Rust versions adding major new features like `repr(align)`, `union`, etc. This first stage also runs libc-test for the tier-1 targets on linux and osx. These builds finish quickly because no emulation is necessary. The second stage is called `tier2` and it runs libc-test for all other targets for which we are currently able to do so. Closes #1229 .
1 parent a2bf9f1 commit 8f1acf4

File tree

3 files changed

+323
-89
lines changed

3 files changed

+323
-89
lines changed

.travis.yml

Lines changed: 151 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,112 +1,188 @@
11
language: rust
2-
rust: stable
2+
rust: nightly
33
sudo: required
44
dist: xenial
55
services: docker
66

7+
stages:
8+
- tools-and-build-and-tier1
9+
- tier2
10+
711
matrix:
812
include:
9-
# 1.13.0 compat
10-
- env: TARGET=x86_64-unknown-linux-gnu
11-
rust: 1.13.0
12-
script: rm -f Cargo.lock && cargo build
13-
install: true
14-
15-
# build documentation
16-
- env: TARGET=x86_64-unknown-linux-gnu
17-
rust: nightly
13+
# TOOLS
14+
- name: "Documentation"
15+
env: TARGET=x86_64-unknown-linux-gnu
1816
script: sh ci/dox.sh
1917
install: true
20-
21-
# stable compat
22-
- env: TARGET=x86_64-unknown-linux-gnu
18+
stage: tools-and-build-and-tier1
19+
- name: "Shellcheck"
2320
install: true
24-
- env: TARGET=i686-unknown-linux-gnu
25-
- os: osx
26-
env: TARGET=x86_64-apple-darwin
21+
script:
22+
- shellcheck --version
23+
- shellcheck ci/*.sh
24+
stage: tools-and-build-and-tier1
25+
- name: "Style"
26+
install: rustup component add rustfmt-preview
27+
script:
28+
- rustc ci/style.rs && ./style src
29+
- cargo fmt --all -- --check
30+
stage: tools-and-build-and-tier1
31+
32+
# BUILD stable, beta, nightly
33+
- name: "Build Stable Rust"
34+
script: sh ci/build.sh
35+
stage: tools-and-build-and-tier1
36+
rust: stable
37+
- name: "Build Beta Rust"
38+
script: sh ci/build.sh
39+
stage: tools-and-build-and-tier1
40+
rust: beta
41+
- name: "Build Nightly Rust"
42+
script: sh ci/build.sh
43+
stage: tools-and-build-and-tier1
44+
rust: nightly
45+
- name: "Build Stable Rust"
46+
script: sh ci/build.sh
47+
stage: tools-and-build-and-tier1
48+
rust: stable
49+
os: osx
2750
osx_image: xcode10
28-
install: true
29-
- os: osx
30-
env: TARGET=i686-apple-darwin
51+
- name: "Build Beta Rust"
52+
script: sh ci/build.sh
53+
stage: tools-and-build-and-tier1
54+
rust: beta
55+
os: osx
3156
osx_image: xcode10
32-
- env: TARGET=arm-linux-androideabi
57+
- name: "Build Nightly Rust"
58+
script: sh ci/build.sh
59+
stage: tools-and-build-and-tier1
60+
rust: nightly
61+
os: osx
62+
osx_image: xcode10
63+
- name: "Build Stable Rust 1.13.0"
64+
script: sh ci/build.sh
65+
stage: tools-and-build-and-tier1
66+
rust: 1.13.0
67+
- name: "Build Stable Rust 1.19.0"
68+
script: sh ci/build.sh
69+
stage: tools-and-build-and-tier1
70+
rust: 1.19.0
71+
- name: "Build Stable Rust 1.24.0"
72+
script: sh ci/build.sh
73+
stage: tools-and-build-and-tier1
74+
rust: 1.24.0
75+
- name: "Build Stable Rust 1.25.0"
76+
script: sh ci/build.sh
77+
stage: tools-and-build-and-tier1
78+
rust: 1.25.0
79+
- name: "Build Stable Rust 1.30.0"
80+
script: sh ci/build.sh
81+
stage: tools-and-build-and-tier1
82+
rust: 1.30.0
83+
- name: "Build Stable Rust 1.13.0"
84+
script: sh ci/build.sh
85+
stage: tools-and-build-and-tier1
86+
rust: 1.13.0
87+
os: osx
88+
osx_image: xcode10
89+
- name: "Build Stable Rust 1.19.0"
90+
script: sh ci/build.sh
91+
stage: tools-and-build-and-tier1
92+
rust: 1.19.0
93+
os: osx
94+
osx_image: xcode10
95+
- name: "Build Stable Rust 1.24.0"
96+
script: sh ci/build.sh
97+
stage: tools-and-build-and-tier1
98+
rust: 1.24.0
99+
os: osx
100+
osx_image: xcode10
101+
- name: "Build Stable Rust 1.25.0"
102+
script: sh ci/build.sh
103+
stage: tools-and-build-and-tier1
104+
rust: 1.25.0
105+
os: osx
106+
osx_image: xcode10
107+
- name: "Build Stable Rust 1.30.0"
108+
script: sh ci/build.sh
109+
stage: tools-and-build-and-tier1
110+
rust: 1.30.0
111+
os: osx
112+
osx_image: xcode10
113+
- env: TARGET=i686-apple-darwin
114+
os: osx
115+
osx_image: xcode10
116+
stage: tools-and-build-and-tier1
117+
- env: TARGET=i686-unknown-linux-gnu
118+
stage: tools-and-build-and-tier1
119+
- env: TARGET=x86_64-apple-darwin
120+
os: osx
121+
osx_image: xcode10
122+
stage: tools-and-build-and-tier1
123+
- env: TARGET=x86_64-unknown-linux-gnu
124+
stage: tools-and-build-and-tier1
125+
126+
# Tier 2 targets
33127
- env: TARGET=aarch64-linux-android
34-
# FIXME(#826) should reenable
35-
#- env: TARGET=i686-linux-android
36-
- env: TARGET=x86_64-linux-android
37-
- env: TARGET=x86_64-unknown-linux-musl
38-
- env: TARGET=i686-unknown-linux-musl
39-
- env: TARGET=arm-unknown-linux-gnueabihf
40-
- env: TARGET=arm-unknown-linux-musleabihf
128+
stage: tier2
41129
- env: TARGET=aarch64-unknown-linux-gnu
130+
stage: tier2
42131
- env: TARGET=aarch64-unknown-linux-musl
43-
- env: TARGET=powerpc-unknown-linux-gnu
44-
- env: TARGET=powerpc64-unknown-linux-gnu
45-
- env: TARGET=powerpc64le-unknown-linux-gnu
132+
stage: tier2
133+
- env: TARGET=arm-linux-androideabi
134+
stage: tier2
135+
- env: TARGET=arm-unknown-linux-gnueabihf
136+
stage: tier2
137+
- env: TARGET=arm-unknown-linux-musleabihf
138+
stage: tier2
139+
- env: TARGET=asmjs-unknown-emscripten
140+
stage: tier2
141+
- env: TARGET=i686-unknown-linux-musl
142+
stage: tier2
143+
- env: TARGET=mips-unknown-linux-gnu
144+
stage: tier2
46145
- env: TARGET=mips-unknown-linux-musl
47-
- env: TARGET=mipsel-unknown-linux-musl
146+
stage: tier2
48147
- env: TARGET=mips64-unknown-linux-gnuabi64
148+
stage: tier2
49149
- env: TARGET=mips64el-unknown-linux-gnuabi64
50-
- env: TARGET=mips-unknown-linux-gnu
150+
stage: tier2
151+
- env: TARGET=mipsel-unknown-linux-musl
152+
stage: tier2
153+
- env: TARGET=powerpc-unknown-linux-gnu
154+
stage: tier2
155+
- env: TARGET=powerpc64-unknown-linux-gnu
156+
stage: tier2
157+
- env: TARGET=powerpc64le-unknown-linux-gnu
158+
stage: tier2
51159
- env: TARGET=s390x-unknown-linux-gnu
160+
stage: tier2
52161
- env: TARGET=sparc64-unknown-linux-gnu
53-
- env: TARGET=asmjs-unknown-emscripten
162+
stage: tier2
54163
- env: TARGET=wasm32-unknown-emscripten
55-
56-
# beta
57-
- env: TARGET=x86_64-unknown-linux-gnu
58-
rust: beta
59-
install: true
60-
- os: osx
61-
env: TARGET=x86_64-apple-darwin
62-
osx_image: xcode10
63-
rust: beta
64-
install: true
65-
66-
# nightly
67-
- env: TARGET=x86_64-unknown-linux-gnu
68-
rust: nightly
69-
install: true
70-
- os: osx
71-
env: TARGET=x86_64-apple-darwin
72-
osx_image: xcode10
73-
rust: nightly
74-
install: true
75-
# not available on stable
76-
# without --release the build fails
77-
# see https://github.com/rust-lang/rust/issues/45417
164+
stage: tier2
165+
- env: TARGET=x86_64-linux-android
166+
stage: tier2
78167
- env: TARGET=x86_64-unknown-linux-gnux32 OPT="--release"
79-
rust: nightly
80-
81-
- env: TARGET=wasm32-unknown-unknown
82-
install: rustup target add $TARGET
83-
script: cargo build --no-default-features --target $TARGET --release
84-
- name: "Style"
85-
install: rustup component add rustfmt-preview
86-
script:
87-
- rustc ci/style.rs && ./style src
88-
- cargo fmt --all -- --check
89-
- name: "Shellcheck"
90-
install: true
91-
script:
92-
- shellcheck --version
93-
- shellcheck ci/*.sh
168+
stage: tier2
169+
- env: TARGET=x86_64-unknown-linux-musl
170+
stage: tier2
94171

95172
allow_failures:
96173
# FIXME: https://github.com/rust-lang/libc/issues/1226
97174
- env: TARGET=asmjs-unknown-emscripten
98175
- env: TARGET=wasm32-unknown-emscripten
99176

100-
install: rustup target add $TARGET
177+
install: rustup target add $TARGET || true
178+
101179
script:
102180
- cargo generate-lockfile --manifest-path libc-test/Cargo.toml
103-
- if [[ $TRAVIS_OS_NAME = "linux" ]]; then
181+
- if [[ $TRAVIS_OS_NAME = "linux" ]] && [[ $BUILD_ONLY != "1" ]]; then
104182
sh ci/run-docker.sh $TARGET;
105183
else
106-
export CARGO_TARGET_DIR=`pwd`/target;
107184
sh ci/run.sh $TARGET;
108185
fi
109-
110186
env:
111187
global:
112188
secure: "e2/3QjgRN9atOuSHp22TrYG7QVKcYUWY48Hi9b60w+r1+BhPkTseIJLte7WefRhdXtqpjjUJTooKDhnurFOeHaCT+nmBgiv+FPU893sBl4bhesY4m0vgUJVbNZcs6lTImYekWVb+aqjGdgV/XAgCw7c3kPmrZV0MzGDWL64Xaps="

0 commit comments

Comments
 (0)