• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env sh
2
3# Checks that libc does not contain breaking changes for the following targets.
4
5set -ex
6
7OS=${1}
8
9echo "Testing Semver on ${OS}"
10
11if ! rustc --version | grep -E "nightly" ; then
12    echo "Building semverver requires a nightly Rust toolchain"
13    exit 1
14fi
15
16rustup component add rustc-dev llvm-tools-preview
17
18# Should update the nightly version in bors CI config if we touch this.
19cargo install semverver --version=0.1.50
20
21TARGETS=
22case "${OS}" in
23    *linux*)
24        TARGETS="\
25aarch64-fuchsia \
26aarch64-linux-android \
27aarch64-unknown-linux-gnu \
28aarch64-unknown-linux-musl \
29armv7-linux-androideabi \
30armv7-unknown-linux-gnueabihf \
31i586-unknown-linux-gnu \
32i586-unknown-linux-musl \
33i686-linux-android \
34i686-unknown-freebsd \
35i686-unknown-linux-gnu \
36i686-unknown-linux-musl \
37i686-pc-windows-gnu \
38x86_64-unknown-freebsd \
39x86_64-unknown-linux-gnu \
40x86_64-unknown-linux-musl \
41x86_64-unknown-netbsd \
42x86_64-pc-solaris \
43x86_64-fuchsia \
44x86_64-pc-windows-gnu \
45x86_64-unknown-linux-gnux32 \
46x86_64-unknown-redox \
47x86_64-fortanix-unknown-sgx \
48wasm32-unknown-unknown \
49"
50    ;;
51    *macos*)
52        TARGETS="\
53aarch64-apple-ios \
54x86_64-apple-darwin \
55x86_64-apple-ios \
56"
57    ;;
58esac
59
60for TARGET in $TARGETS; do
61    # FIXME: rustup often fails to download some artifacts due to network
62    # issues, so we retry this N times.
63    N=5
64    n=0
65    until [ $n -ge $N ]
66    do
67        if rustup target add "${TARGET}" ; then
68            break
69        fi
70        n=$((n+1))
71        sleep 1
72    done
73
74    cargo semver --api-guidelines --target="${TARGET}"
75done
76