summaryrefslogtreecommitdiff
path: root/libc/ci
diff options
context:
space:
mode:
Diffstat (limited to 'libc/ci')
-rw-r--r--libc/ci/README.md2
-rwxr-xr-xlibc/ci/android-accept-licenses.sh15
-rw-r--r--libc/ci/android-install-sdk.sh27
-rw-r--r--libc/ci/docker/aarch64-linux-android/Dockerfile4
-rw-r--r--libc/ci/docker/aarch64-unknown-linux-musl/Dockerfile27
-rw-r--r--libc/ci/docker/arm-linux-androideabi/Dockerfile4
-rw-r--r--libc/ci/docker/arm-unknown-linux-musleabihf/Dockerfile25
-rw-r--r--libc/ci/docker/i686-linux-android/Dockerfile4
-rw-r--r--libc/ci/docker/i686-unknown-linux-gnu/Dockerfile2
-rw-r--r--libc/ci/docker/mips-unknown-linux-musl/Dockerfile2
-rw-r--r--libc/ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile11
-rw-r--r--libc/ci/docker/mipsel-unknown-linux-musl/Dockerfile2
-rw-r--r--libc/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile11
-rw-r--r--libc/ci/docker/s390x-unknown-linux-gnu/Dockerfile16
-rw-r--r--libc/ci/docker/sparc64-unknown-linux-gnu/Dockerfile19
-rwxr-xr-xlibc/ci/docker/wasm32-unknown-emscripten/node-wrapper.sh4
-rw-r--r--libc/ci/docker/x86_64-unknown-freebsd/Dockerfile4
-rw-r--r--libc/ci/docker/x86_64-unknown-linux-gnu/Dockerfile2
-rw-r--r--libc/ci/docker/x86_64-unknown-linux-gnux32/Dockerfile5
-rwxr-xr-xlibc/ci/emscripten-entry.sh2
-rw-r--r--libc/ci/linux-s390x.sh18
-rw-r--r--libc/ci/linux-sparc64.sh17
-rwxr-xr-xlibc/ci/run.sh21
-rwxr-xr-xlibc/ci/test-runner-linux23
24 files changed, 216 insertions, 51 deletions
diff --git a/libc/ci/README.md b/libc/ci/README.md
index 13c7c8d..aef6ef1 100644
--- a/libc/ci/README.md
+++ b/libc/ci/README.md
@@ -39,7 +39,7 @@ running tests. The triples tested are:
* `{i686,x86_64}-pc-windows-{msvc,gnu}`
* Travis
* `{i686,x86_64,mips,aarch64}-unknown-linux-gnu`
- * `x86_64-unknown-linux-musl`
+ * `{x86_64,aarch64}-unknown-linux-musl`
* `arm-unknown-linux-gnueabihf`
* `arm-linux-androideabi`
* `{i686,x86_64}-apple-{darwin,ios}`
diff --git a/libc/ci/android-accept-licenses.sh b/libc/ci/android-accept-licenses.sh
deleted file mode 100755
index 8d8f60a..0000000
--- a/libc/ci/android-accept-licenses.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/expect -f
-# ignore-license
-
-set timeout 1800
-set cmd [lindex $argv 0]
-set licenses [lindex $argv 1]
-
-spawn {*}$cmd
-expect {
- "Do you accept the license '*'*" {
- exp_send "y\r"
- exp_continue
- }
- eof
-}
diff --git a/libc/ci/android-install-sdk.sh b/libc/ci/android-install-sdk.sh
index d03b762..ab7e14d 100644
--- a/libc/ci/android-install-sdk.sh
+++ b/libc/ci/android-install-sdk.sh
@@ -19,10 +19,8 @@ set -ex
# which apparently magically accepts the licenses.
mkdir sdk
-curl https://dl.google.com/android/repository/tools_r25.2.5-linux.zip -O
-unzip -d sdk tools_r25.2.5-linux.zip
-
-filter="platform-tools,android-24"
+curl https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip -O
+unzip -d sdk sdk-tools-linux-3859397.zip
case "$1" in
arm | armv7)
@@ -47,11 +45,16 @@ case "$1" in
;;
esac;
-filter="$filter,sys-img-$abi-android-24"
-
-./android-accept-licenses.sh "android - update sdk -a --no-ui --filter $filter"
-
-echo "no" | android create avd \
- --name $1 \
- --target android-24 \
- --abi $abi
+# --no_https avoids
+# javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
+echo "yes" | \
+ ./sdk/tools/bin/sdkmanager --no_https \
+ "emulator" \
+ "platform-tools" \
+ "platforms;android-24" \
+ "system-images;android-24;default;$abi"
+
+echo "no" |
+ ./sdk/tools/bin/avdmanager create avd \
+ --name $1 \
+ --package "system-images;android-24;default;$abi"
diff --git a/libc/ci/docker/aarch64-linux-android/Dockerfile b/libc/ci/docker/aarch64-linux-android/Dockerfile
index 345540a..5fc83aa 100644
--- a/libc/ci/docker/aarch64-linux-android/Dockerfile
+++ b/libc/ci/docker/aarch64-linux-android/Dockerfile
@@ -25,7 +25,7 @@ RUN sh /android/android-install-ndk.sh $ANDROID_ARCH
RUN sh /android/android-install-sdk.sh $ANDROID_ARCH
RUN mv /root/.android /tmp
RUN chmod 777 -R /tmp/.android
-RUN chmod 755 /android/sdk/tools/* /android/sdk/tools/qemu/linux-x86_64/*
+RUN chmod 755 /android/sdk/tools/* /android/sdk/emulator/qemu/linux-x86_64/*
ENV PATH=$PATH:/rust/bin \
CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=aarch64-linux-android-gcc \
@@ -38,7 +38,7 @@ ENTRYPOINT [ \
"-c", \
# set SHELL so android can detect a 64bits system, see
# http://stackoverflow.com/a/41789144
- "SHELL=/bin/dash emulator @aarch64 -no-window & \
+ "SHELL=/bin/dash /android/sdk/emulator/emulator @aarch64 -no-window & \
rustc /tmp/runtest.rs -o /tmp/runtest && \
exec \"$@\"", \
"--" \
diff --git a/libc/ci/docker/aarch64-unknown-linux-musl/Dockerfile b/libc/ci/docker/aarch64-unknown-linux-musl/Dockerfile
new file mode 100644
index 0000000..e86c4c0
--- /dev/null
+++ b/libc/ci/docker/aarch64-unknown-linux-musl/Dockerfile
@@ -0,0 +1,27 @@
+FROM ubuntu:17.10
+
+RUN apt-get update && apt-get install -y --no-install-recommends \
+ gcc make libc6-dev git curl ca-certificates \
+ gcc-aarch64-linux-gnu qemu-user
+RUN curl https://www.musl-libc.org/releases/musl-1.1.16.tar.gz | \
+ tar xzf - && \
+ cd musl-1.1.16 && \
+ CC=aarch64-linux-gnu-gcc \
+ ./configure --prefix=/musl-aarch64 --enable-wrapper=yes && \
+ make install -j4 && \
+ cd .. && \
+ rm -rf musl-1.1.16 && \
+# Install linux kernel headers sanitized for use with musl
+ curl -L https://github.com/sabotage-linux/kernel-headers/archive/v3.12.6-5.tar.gz | \
+ tar xzf - && \
+ cd kernel-headers-3.12.6-5 && \
+ make ARCH=arm64 prefix=/musl-aarch64 install -j4 && \
+ cd .. && \
+ rm -rf kernel-headers-3.12.6-5
+
+# FIXME: shouldn't need the `-lgcc` here, shouldn't that be in libstd?
+ENV PATH=$PATH:/musl-aarch64/bin:/rust/bin \
+ CC_aarch64_unknown_linux_musl=musl-gcc \
+ RUSTFLAGS='-Clink-args=-lgcc' \
+ CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=musl-gcc \
+ CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUNNER="qemu-aarch64 -L /musl-aarch64"
diff --git a/libc/ci/docker/arm-linux-androideabi/Dockerfile b/libc/ci/docker/arm-linux-androideabi/Dockerfile
index 554f078..a3fc64b 100644
--- a/libc/ci/docker/arm-linux-androideabi/Dockerfile
+++ b/libc/ci/docker/arm-linux-androideabi/Dockerfile
@@ -25,7 +25,7 @@ RUN sh /android/android-install-ndk.sh $ANDROID_ARCH
RUN sh /android/android-install-sdk.sh $ANDROID_ARCH
RUN mv /root/.android /tmp
RUN chmod 777 -R /tmp/.android
-RUN chmod 755 /android/sdk/tools/* /android/sdk/tools/qemu/linux-x86_64/*
+RUN chmod 755 /android/sdk/tools/* /android/sdk/emulator/qemu/linux-x86_64/*
ENV PATH=$PATH:/rust/bin \
CARGO_TARGET_ARM_LINUX_ANDROIDEABI_LINKER=arm-linux-androideabi-gcc \
@@ -38,7 +38,7 @@ ENTRYPOINT [ \
"-c", \
# set SHELL so android can detect a 64bits system, see
# http://stackoverflow.com/a/41789144
- "SHELL=/bin/dash emulator @arm -no-window & \
+ "SHELL=/bin/dash /android/sdk/emulator/emulator @arm -no-window & \
rustc /tmp/runtest.rs -o /tmp/runtest && \
exec \"$@\"", \
"--" \
diff --git a/libc/ci/docker/arm-unknown-linux-musleabihf/Dockerfile b/libc/ci/docker/arm-unknown-linux-musleabihf/Dockerfile
new file mode 100644
index 0000000..130730b
--- /dev/null
+++ b/libc/ci/docker/arm-unknown-linux-musleabihf/Dockerfile
@@ -0,0 +1,25 @@
+FROM ubuntu:17.10
+
+RUN apt-get update && apt-get install -y --no-install-recommends \
+ gcc make libc6-dev git curl ca-certificates \
+ gcc-arm-linux-gnueabihf qemu-user
+
+RUN curl https://www.musl-libc.org/releases/musl-1.1.16.tar.gz | tar xzf -
+WORKDIR /musl-1.1.16
+RUN CC=arm-linux-gnueabihf-gcc \
+ CFLAGS="-march=armv6 -marm" \
+ ./configure --prefix=/musl-arm --enable-wrapper=yes
+RUN make install -j4
+
+# Install linux kernel headers sanitized for use with musl
+RUN \
+ curl -L https://github.com/sabotage-linux/kernel-headers/archive/v3.12.6-5.tar.gz | \
+ tar xzf - && \
+ cd kernel-headers-3.12.6-5 && \
+ make ARCH=arm prefix=/musl-arm install -j4 && \
+ cd .. && \
+ rm -rf kernel-headers-3.12.6-5
+ENV PATH=$PATH:/musl-arm/bin:/rust/bin \
+ CC_arm_unknown_linux_musleabihf=musl-gcc \
+ CARGO_TARGET_ARM_UNKNOWN_LINUX_MUSLEABIHF_LINKER=musl-gcc \
+ CARGO_TARGET_ARM_UNKNOWN_LINUX_MUSLEABIHF_RUNNER="qemu-arm -L /musl-arm"
diff --git a/libc/ci/docker/i686-linux-android/Dockerfile b/libc/ci/docker/i686-linux-android/Dockerfile
index 7671f78..f0836c3 100644
--- a/libc/ci/docker/i686-linux-android/Dockerfile
+++ b/libc/ci/docker/i686-linux-android/Dockerfile
@@ -25,7 +25,7 @@ RUN sh /android/android-install-ndk.sh $ANDROID_ARCH
RUN sh /android/android-install-sdk.sh $ANDROID_ARCH
RUN mv /root/.android /tmp
RUN chmod 777 -R /tmp/.android
-RUN chmod 755 /android/sdk/tools/* /android/sdk/tools/qemu/linux-x86_64/*
+RUN chmod 755 /android/sdk/tools/* /android/sdk/emulator/qemu/linux-x86_64/*
ENV PATH=$PATH:/rust/bin \
CARGO_TARGET_I686_LINUX_ANDROID_LINKER=i686-linux-android-gcc \
@@ -38,7 +38,7 @@ ENTRYPOINT [ \
"-c", \
# set SHELL so android can detect a 64bits system, see
# http://stackoverflow.com/a/41789144
- "SHELL=/bin/dash emulator @i686 -no-window -no-accel & \
+ "SHELL=/bin/dash /android/sdk/emulator/emulator @i686 -no-window -no-accel & \
rustc /tmp/runtest.rs -o /tmp/runtest && \
exec \"$@\"", \
"--" \
diff --git a/libc/ci/docker/i686-unknown-linux-gnu/Dockerfile b/libc/ci/docker/i686-unknown-linux-gnu/Dockerfile
index a5a4b8e..1af4134 100644
--- a/libc/ci/docker/i686-unknown-linux-gnu/Dockerfile
+++ b/libc/ci/docker/i686-unknown-linux-gnu/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:17.10
+FROM ubuntu:17.04
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
gcc-multilib libc6-dev ca-certificates
diff --git a/libc/ci/docker/mips-unknown-linux-musl/Dockerfile b/libc/ci/docker/mips-unknown-linux-musl/Dockerfile
index 3fb0eeb..91ffd58 100644
--- a/libc/ci/docker/mips-unknown-linux-musl/Dockerfile
+++ b/libc/ci/docker/mips-unknown-linux-musl/Dockerfile
@@ -8,7 +8,7 @@ RUN mkdir /toolchain
# Note that this originally came from:
# https://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/OpenWrt-SDK-ar71xx-generic_gcc-5.3.0_musl-1.1.15.Linux-x86_64.tar.bz2
-RUN curl -L https://s3.amazonaws.com/rust-lang-ci/libc/OpenWrt-SDK-ar71xx-generic_gcc-5.3.0_musl-1.1.15.Linux-x86_64.tar.bz2 | \
+RUN curl -L https://s3-us-west-1.amazonaws.com/rust-lang-ci2/libc/OpenWrt-SDK-ar71xx-generic_gcc-5.3.0_musl-1.1.15.Linux-x86_64.tar.bz2 | \
tar xjf - -C /toolchain --strip-components=1
ENV PATH=$PATH:/rust/bin:/toolchain/staging_dir/toolchain-mips_34kc_gcc-5.3.0_musl-1.1.15/bin \
diff --git a/libc/ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile b/libc/ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile
new file mode 100644
index 0000000..434c908
--- /dev/null
+++ b/libc/ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile
@@ -0,0 +1,11 @@
+FROM ubuntu:17.10
+
+RUN apt-get update && apt-get install -y --no-install-recommends \
+ gcc libc6-dev qemu-user ca-certificates \
+ gcc-mips64el-linux-gnuabi64 libc6-dev-mips64el-cross \
+ qemu-system-mips64el
+
+ENV CARGO_TARGET_MIPS64EL_UNKNOWN_LINUX_GNUABI64_LINKER=mips64el-linux-gnuabi64-gcc \
+ CARGO_TARGET_MIPS64EL_UNKNOWN_LINUX_GNUABI64_RUNNER="qemu-mips64el -L /usr/mips64el-linux-gnuabi64" \
+ CC_mips64el_unknown_linux_gnuabi64=mips64el-linux-gnuabi64-gcc \
+ PATH=$PATH:/rust/bin
diff --git a/libc/ci/docker/mipsel-unknown-linux-musl/Dockerfile b/libc/ci/docker/mipsel-unknown-linux-musl/Dockerfile
index a2c3bc4..3642fa8 100644
--- a/libc/ci/docker/mipsel-unknown-linux-musl/Dockerfile
+++ b/libc/ci/docker/mipsel-unknown-linux-musl/Dockerfile
@@ -8,7 +8,7 @@ RUN mkdir /toolchain
# Note that this originally came from:
# https://downloads.openwrt.org/snapshots/trunk/malta/generic/OpenWrt-Toolchain-malta-le_gcc-5.3.0_musl-1.1.15.Linux-x86_64.tar.bz2
-RUN curl -L https://s3.amazonaws.com/rust-lang-ci/libc/OpenWrt-Toolchain-malta-le_gcc-5.3.0_musl-1.1.15.Linux-x86_64.tar.bz2 | \
+RUN curl -L https://s3-us-west-1.amazonaws.com/rust-lang-ci2/libc/OpenWrt-Toolchain-malta-le_gcc-5.3.0_musl-1.1.15.Linux-x86_64.tar.bz2 | \
tar xjf - -C /toolchain --strip-components=2
ENV PATH=$PATH:/rust/bin:/toolchain/bin \
diff --git a/libc/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile b/libc/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile
new file mode 100644
index 0000000..627123e
--- /dev/null
+++ b/libc/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile
@@ -0,0 +1,11 @@
+FROM ubuntu:17.10
+
+RUN apt-get update && apt-get install -y --no-install-recommends \
+ gcc libc6-dev qemu-user ca-certificates \
+ gcc-powerpc64le-linux-gnu libc6-dev-ppc64el-cross \
+ qemu-system-ppc
+
+ENV CARGO_TARGET_POWERPC64LE_UNKNOWN_LINUX_GNU_LINKER=powerpc64le-linux-gnu-gcc \
+ CARGO_TARGET_POWERPC64LE_UNKNOWN_LINUX_GNU_RUNNER="qemu-ppc64le -L /usr/powerpc64le-linux-gnu" \
+ CC=powerpc64le-linux-gnu-gcc \
+ PATH=$PATH:/rust/bin
diff --git a/libc/ci/docker/s390x-unknown-linux-gnu/Dockerfile b/libc/ci/docker/s390x-unknown-linux-gnu/Dockerfile
index 49a277d..861f4f9 100644
--- a/libc/ci/docker/s390x-unknown-linux-gnu/Dockerfile
+++ b/libc/ci/docker/s390x-unknown-linux-gnu/Dockerfile
@@ -1,12 +1,18 @@
FROM ubuntu:17.10
RUN apt-get update && apt-get install -y --no-install-recommends \
- gcc libc6-dev qemu-user ca-certificates \
- gcc-s390x-linux-gnu libc6-dev-s390x-cross
+ curl ca-certificates \
+ gcc libc6-dev \
+ gcc-s390x-linux-gnu libc6-dev-s390x-cross \
+ qemu-system-s390x \
+ cpio
+
+COPY linux-s390x.sh /
+RUN bash /linux-s390x.sh
+
+COPY test-runner-linux /
ENV CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_LINKER=s390x-linux-gnu-gcc \
- # TODO: in theory we should execute this, but qemu segfaults immediately :(
- # CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_RUNNER="qemu-s390x -L /usr/s390x-linux-gnu" \
- CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_RUNNER=true \
+ CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_RUNNER="/test-runner-linux s390x" \
CC_s390x_unknown_linux_gnu=s390x-linux-gnu-gcc \
PATH=$PATH:/rust/bin
diff --git a/libc/ci/docker/sparc64-unknown-linux-gnu/Dockerfile b/libc/ci/docker/sparc64-unknown-linux-gnu/Dockerfile
new file mode 100644
index 0000000..2c551f9
--- /dev/null
+++ b/libc/ci/docker/sparc64-unknown-linux-gnu/Dockerfile
@@ -0,0 +1,19 @@
+# link fails on 17.10
+FROM ubuntu:17.04
+
+RUN apt-get update && apt-get install -y --no-install-recommends \
+ curl ca-certificates \
+ gcc libc6-dev \
+ gcc-sparc64-linux-gnu libc6-dev-sparc64-cross \
+ qemu-system-sparc64 openbios-sparc seabios ipxe-qemu \
+ p7zip-full cpio
+
+COPY linux-sparc64.sh /
+RUN bash /linux-sparc64.sh
+
+COPY test-runner-linux /
+
+ENV CARGO_TARGET_SPARC64_UNKNOWN_LINUX_GNU_LINKER=sparc64-linux-gnu-gcc \
+ CARGO_TARGET_SPARC64_UNKNOWN_LINUX_GNU_RUNNER="/test-runner-linux sparc64" \
+ CC_sparc64_unknown_linux_gnu=sparc64-linux-gnu-gcc \
+ PATH=$PATH:/rust/bin
diff --git a/libc/ci/docker/wasm32-unknown-emscripten/node-wrapper.sh b/libc/ci/docker/wasm32-unknown-emscripten/node-wrapper.sh
index b1936f0..3122e2e 100755
--- a/libc/ci/docker/wasm32-unknown-emscripten/node-wrapper.sh
+++ b/libc/ci/docker/wasm32-unknown-emscripten/node-wrapper.sh
@@ -7,5 +7,9 @@ shift
dir=$(dirname $me)
file=$(basename $me)
+if echo $file | grep -q wasm; then
+ exit 0 # FIXME(rust-lang/cargo#4750)
+fi
+
cd $dir
exec node $file "$@"
diff --git a/libc/ci/docker/x86_64-unknown-freebsd/Dockerfile b/libc/ci/docker/x86_64-unknown-freebsd/Dockerfile
index 12b0bdf..7ad3faf 100644
--- a/libc/ci/docker/x86_64-unknown-freebsd/Dockerfile
+++ b/libc/ci/docker/x86_64-unknown-freebsd/Dockerfile
@@ -1,9 +1,9 @@
-FROM alexcrichton/rust-slave-linux-cross:2016-04-15
-USER root
+FROM alexcrichton/port-prebuilt-freebsd:2017-09-16
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
qemu genext2fs
+RUN apt-get install -y curl ca-certificates gcc
ENTRYPOINT ["sh"]
diff --git a/libc/ci/docker/x86_64-unknown-linux-gnu/Dockerfile b/libc/ci/docker/x86_64-unknown-linux-gnu/Dockerfile
index ca60ede..c5ec682 100644
--- a/libc/ci/docker/x86_64-unknown-linux-gnu/Dockerfile
+++ b/libc/ci/docker/x86_64-unknown-linux-gnu/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:17.10
+FROM ubuntu:17.04
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
gcc libc6-dev ca-certificates
diff --git a/libc/ci/docker/x86_64-unknown-linux-gnux32/Dockerfile b/libc/ci/docker/x86_64-unknown-linux-gnux32/Dockerfile
new file mode 100644
index 0000000..1af4134
--- /dev/null
+++ b/libc/ci/docker/x86_64-unknown-linux-gnux32/Dockerfile
@@ -0,0 +1,5 @@
+FROM ubuntu:17.04
+RUN apt-get update
+RUN apt-get install -y --no-install-recommends \
+ gcc-multilib libc6-dev ca-certificates
+ENV PATH=$PATH:/rust/bin
diff --git a/libc/ci/emscripten-entry.sh b/libc/ci/emscripten-entry.sh
index acaebfe..22ae8b0 100755
--- a/libc/ci/emscripten-entry.sh
+++ b/libc/ci/emscripten-entry.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# Copyright 2017 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
diff --git a/libc/ci/linux-s390x.sh b/libc/ci/linux-s390x.sh
new file mode 100644
index 0000000..972abee
--- /dev/null
+++ b/libc/ci/linux-s390x.sh
@@ -0,0 +1,18 @@
+set -ex
+
+mkdir -m 777 /qemu
+cd /qemu
+
+curl -LO https://github.com/qemu/qemu/raw/master/pc-bios/s390-ccw.img
+curl -LO http://ftp.debian.org/debian/dists/testing/main/installer-s390x/20170828/images/generic/kernel.debian
+curl -LO http://ftp.debian.org/debian/dists/testing/main/installer-s390x/20170828/images/generic/initrd.debian
+
+mv kernel.debian kernel
+mv initrd.debian initrd.gz
+
+mkdir init
+cd init
+gunzip -c ../initrd.gz | cpio -id
+rm ../initrd.gz
+cp /usr/s390x-linux-gnu/lib/libgcc_s.so.1 usr/lib/
+chmod a+w .
diff --git a/libc/ci/linux-sparc64.sh b/libc/ci/linux-sparc64.sh
new file mode 100644
index 0000000..33a3c46
--- /dev/null
+++ b/libc/ci/linux-sparc64.sh
@@ -0,0 +1,17 @@
+set -ex
+
+mkdir -m 777 /qemu
+cd /qemu
+
+curl -LO https://cdimage.debian.org/cdimage/ports/debian-9.0-sparc64-NETINST-1.iso
+7z e debian-9.0-sparc64-NETINST-1.iso boot/initrd.gz
+7z e debian-9.0-sparc64-NETINST-1.iso boot/sparc64
+mv sparc64 kernel
+rm debian-9.0-sparc64-NETINST-1.iso
+
+mkdir init
+cd init
+gunzip -c ../initrd.gz | cpio -id
+rm ../initrd.gz
+cp /usr/sparc64-linux-gnu/lib/libgcc_s.so.1 usr/lib/
+chmod a+w .
diff --git a/libc/ci/run.sh b/libc/ci/run.sh
index ddf18fd..02dd35a 100755
--- a/libc/ci/run.sh
+++ b/libc/ci/run.sh
@@ -21,14 +21,14 @@ if [ "$QEMU" != "" ]; then
# image is .gz : download and uncompress it
qemufile=$(echo ${QEMU%.gz} | sed 's/\//__/g')
if [ ! -f $tmpdir/$qemufile ]; then
- curl https://s3.amazonaws.com/rust-lang-ci/libc/$QEMU | \
+ curl https://s3-us-west-1.amazonaws.com/rust-lang-ci2/libc/$QEMU | \
gunzip -d > $tmpdir/$qemufile
fi
else
# plain qcow2 image: just download it
qemufile=$(echo ${QEMU} | sed 's/\//__/g')
if [ ! -f $tmpdir/$qemufile ]; then
- curl https://s3.amazonaws.com/rust-lang-ci/libc/$QEMU \
+ curl https://s3-us-west-1.amazonaws.com/rust-lang-ci2/libc/$QEMU \
> $tmpdir/$qemufile
fi
fi
@@ -41,8 +41,12 @@ if [ "$QEMU" != "" ]; then
# Do the standard rigamarole of cross-compiling an executable and then the
# script to run just executes the binary.
- cargo build --manifest-path libc-test/Cargo.toml --target $TARGET
- cp $CARGO_TARGET_DIR/$TARGET/debug/libc-test $tmpdir/mount/
+ cargo build \
+ --manifest-path libc-test/Cargo.toml \
+ --target $TARGET \
+ --test main
+ rm $CARGO_TARGET_DIR/$TARGET/debug/main-*.d
+ cp $CARGO_TARGET_DIR/$TARGET/debug/main-* $tmpdir/mount/libc-test
echo 'exec $1/libc-test' > $tmpdir/mount/run.sh
du -sh $tmpdir/mount
@@ -68,4 +72,11 @@ if [ "$QEMU" != "" ]; then
exec grep "^PASSED .* tests" $CARGO_TARGET_DIR/out.log
fi
-exec cargo test --manifest-path libc-test/Cargo.toml --target $TARGET
+# FIXME: x86_64-unknown-linux-gnux32 fail to compile wihout --release
+# See https://github.com/rust-lang/rust/issues/45417
+opt=
+if [ "$TARGET" = "x86_64-unknown-linux-gnux32" ]; then
+ opt="--release"
+fi
+
+exec cargo test $opt --manifest-path libc-test/Cargo.toml --target $TARGET
diff --git a/libc/ci/test-runner-linux b/libc/ci/test-runner-linux
new file mode 100755
index 0000000..5f1fb23
--- /dev/null
+++ b/libc/ci/test-runner-linux
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+set -e
+
+arch=$1
+prog=$2
+
+cd /qemu/init
+cp -f $2 prog
+find . | cpio --create --format='newc' --quiet | gzip > ../initrd.gz
+cd ..
+
+timeout 30s qemu-system-$arch \
+ -m 1024 \
+ -nographic \
+ -kernel kernel \
+ -initrd initrd.gz \
+ -append init=/prog > output || true
+
+# remove kernel messages
+tr -d '\r' < output | egrep -v '^\['
+
+grep PASSED output > /dev/null