Skip to content

Commit 1236fed

Browse files
committed
Auto merge of #1154 - gnzlbg:semverver2, r=gnzlbg
Verify that only non-technical breaking changes are applied to libc Closes #270 . cc @alexcrichton so this would be a solution to #270 that uses rust-semverver to check that the API of `libc` contains only non-technical breaking changes. This is a WIP and uses a fork of `rust-semverver` for now, but I've sent PRs upstream already. This is the only idea I have for solving #270 . `rust-semverver` is not perfect, but it can deal with functions, consts, and simple structs just fine, and that's pretty much everything that libc uses. cc @ibabushkin Some other notes: * we have to compile `rust-semverver` for each toolchain version, and it depends on `cargo` so we have to build ~160 dependencies. Using `cache: cargo` breaks everything.
2 parents 2cd7b3b + d6443f7 commit 1236fed

File tree

2 files changed

+82
-0
lines changed

2 files changed

+82
-0
lines changed

.travis.yml

+12
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,16 @@ matrix:
3434
# cargo fmt --all -- --check
3535
# fi
3636
stage: tools-and-build-and-tier1
37+
- name: "Semver Linux"
38+
install: travis_retry cargo +nightly install semverver
39+
script: sh ci/semver.sh
40+
stage: tools-and-build-and-tier1
41+
- name: "Semver MacOSX"
42+
install: travis_retry cargo +nightly install semverver
43+
script: sh ci/semver.sh
44+
os: osx
45+
osx_image: xcode10
46+
stage: tools-and-build-and-tier1
3747

3848
# BUILD stable, beta, nightly
3949
- name: "Build Stable Rust"
@@ -202,6 +212,8 @@ matrix:
202212
# FIXME: https://github.com/rust-lang/libc/issues/1226
203213
- env: TARGET=asmjs-unknown-emscripten
204214
- env: TARGET=wasm32-unknown-emscripten
215+
- name: "Semver Linux"
216+
- name: "Semver MacOSX"
205217

206218
install: travis_retry rustup target add $TARGET
207219

ci/semver.sh

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#!/usr/bin/env sh
2+
3+
# Checks that libc does not contain breaking changes for the following targets.
4+
5+
set -ex
6+
7+
OS=${TRAVIS_OS_NAME}
8+
9+
echo "Testing Semver on ${OS}"
10+
11+
TARGETS=
12+
case "${OS}" in
13+
*linux*)
14+
TARGETS="\
15+
aarch64-fuchsia \
16+
aarch64-linux-android \
17+
aarch64-unknown-linux-gnu \
18+
aarch64-unknown-linux-musl \
19+
armv7-linux-androideabi \
20+
armv7-unknown-linux-gnueabihf \
21+
i586-unknown-linux-gnu \
22+
i586-unknown-linux-musl \
23+
i686-linux-android \
24+
i686-unknown-freebsd \
25+
i686-unknown-linux-gnu \
26+
i686-unknown-linux-musl \
27+
i686-pc-windows-gnu \
28+
x86_64-unknown-freebsd \
29+
x86_64-unknown-linux-gnu \
30+
x86_64-unknown-linux-musl \
31+
x86_64-unknown-netbsd \
32+
x86_64-unknown-cloudabi \
33+
x86_64-sun-solaris \
34+
x86_64-fuchsia \
35+
x86_64-pc-windows-gnu \
36+
x86_64-unknown-linux-gnux32 \
37+
x86_64-unknown-redox \
38+
x86_64-fortanix-unknown-sgx \
39+
wasm32-unknown-unknown \
40+
"
41+
;;
42+
*osx*)
43+
TARGETS="\
44+
aarch64-apple-ios \
45+
armv7-apple-ios \
46+
armv7s-apple-ios \
47+
i386-apple-ios \
48+
i686-apple-darwin \
49+
x86_64-apple-darwin \
50+
x86_64-apple-ios \
51+
"
52+
;;
53+
esac
54+
55+
for TARGET in $TARGETS; do
56+
# FIXME: rustup often fails to download some artifacts due to network
57+
# issues, so we retry this N times.
58+
N=5
59+
n=0
60+
until [ $n -ge $N ]
61+
do
62+
if rustup target add "${TARGET}" ; then
63+
break
64+
fi
65+
n=$((n+1))
66+
sleep 1
67+
done
68+
69+
cargo +nightly semver --api-guidelines --target="${TARGET}"
70+
done

0 commit comments

Comments
 (0)