From 82cf43dd887801b8b22b8aae8c02854d921915d5 Mon Sep 17 00:00:00 2001 From: Daniel Mueller Date: Fri, 24 May 2019 18:07:22 -0700 Subject: Update libc crate to 0.2.55 This change updates the libc crate to version 0.2.55. Import subrepo libc/:libc at caf17a0641d29dc624621177f5756804dd180c13 --- libc/ci/android-install-ndk.sh | 2 +- libc/ci/android-install-sdk.sh | 5 +- libc/ci/build.sh | 214 +++++++++++++++++++++ libc/ci/docker/aarch64-linux-android/Dockerfile | 4 +- .../ci/docker/aarch64-unknown-linux-gnu/Dockerfile | 2 +- .../docker/aarch64-unknown-linux-musl/Dockerfile | 2 +- libc/ci/docker/arm-linux-androideabi/Dockerfile | 4 +- .../docker/arm-unknown-linux-gnueabihf/Dockerfile | 2 +- .../docker/arm-unknown-linux-musleabihf/Dockerfile | 2 +- libc/ci/docker/asmjs-unknown-emscripten/Dockerfile | 2 +- libc/ci/docker/i686-linux-android/Dockerfile | 4 +- libc/ci/docker/i686-unknown-linux-gnu/Dockerfile | 2 +- libc/ci/docker/i686-unknown-linux-musl/Dockerfile | 2 +- libc/ci/docker/mips-unknown-linux-gnu/Dockerfile | 2 +- libc/ci/docker/mips-unknown-linux-musl/Dockerfile | 2 +- .../mips64-unknown-linux-gnuabi64/Dockerfile | 2 +- .../mips64el-unknown-linux-gnuabi64/Dockerfile | 2 +- .../ci/docker/mipsel-unknown-linux-musl/Dockerfile | 2 +- .../ci/docker/powerpc-unknown-linux-gnu/Dockerfile | 3 +- .../docker/powerpc64-unknown-linux-gnu/Dockerfile | 2 +- .../powerpc64le-unknown-linux-gnu/Dockerfile | 2 +- libc/ci/docker/s390x-unknown-linux-gnu/Dockerfile | 2 +- .../ci/docker/sparc64-unknown-linux-gnu/Dockerfile | 7 +- .../ci/docker/wasm32-unknown-emscripten/Dockerfile | 2 +- libc/ci/docker/wasm32-wasi/Dockerfile | 93 +++++++++ libc/ci/docker/wasm32-wasi/clang.sh | 2 + libc/ci/docker/x86_64-linux-android/Dockerfile | 2 +- libc/ci/docker/x86_64-rumprun-netbsd/runtest.rs | 3 +- libc/ci/docker/x86_64-unknown-linux-gnu/Dockerfile | 2 +- .../docker/x86_64-unknown-linux-gnux32/Dockerfile | 2 +- .../ci/docker/x86_64-unknown-linux-musl/Dockerfile | 2 +- libc/ci/dox.sh | 63 ++++-- libc/ci/ios/deploy_and_run_on_ios_simulator.rs | 7 +- libc/ci/landing-page-footer.html | 3 - libc/ci/landing-page-head.html | 7 - libc/ci/linux-s390x.sh | 4 +- libc/ci/linux-sparc64.sh | 8 +- libc/ci/run.sh | 19 +- libc/ci/runtest-android.rs | 22 ++- libc/ci/semver.sh | 70 +++++++ libc/ci/style.rs | 3 + libc/ci/switch.json | 37 ++++ libc/ci/test-runner-linux | 15 +- 43 files changed, 552 insertions(+), 87 deletions(-) create mode 100644 libc/ci/build.sh create mode 100644 libc/ci/docker/wasm32-wasi/Dockerfile create mode 100755 libc/ci/docker/wasm32-wasi/clang.sh delete mode 100644 libc/ci/landing-page-footer.html delete mode 100644 libc/ci/landing-page-head.html create mode 100644 libc/ci/semver.sh create mode 100644 libc/ci/switch.json (limited to 'libc/ci') diff --git a/libc/ci/android-install-ndk.sh b/libc/ci/android-install-ndk.sh index ce11d00..54f7b2e 100644 --- a/libc/ci/android-install-ndk.sh +++ b/libc/ci/android-install-ndk.sh @@ -11,7 +11,7 @@ set -ex -curl --retry 5 -O https://dl.google.com/android/repository/android-ndk-r15b-linux-x86_64.zip +curl --retry 10 -O https://dl.google.com/android/repository/android-ndk-r15b-linux-x86_64.zip unzip -q android-ndk-r15b-linux-x86_64.zip case "$1" in diff --git a/libc/ci/android-install-sdk.sh b/libc/ci/android-install-sdk.sh index 6b5ac09..e011cfc 100644 --- a/libc/ci/android-install-sdk.sh +++ b/libc/ci/android-install-sdk.sh @@ -19,7 +19,7 @@ set -ex # which apparently magically accepts the licenses. mkdir sdk -curl --retry 5 https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip -O +curl --retry 10 https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip -O unzip -d sdk sdk-tools-linux-3859397.zip case "$1" in @@ -45,6 +45,9 @@ case "$1" in ;; esac; +# See: https://stackoverflow.com/a/51644855/1422197 +export JAVA_OPTS='-XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee' + # --no_https avoids # javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found yes | ./sdk/tools/bin/sdkmanager --licenses --no_https diff --git a/libc/ci/build.sh b/libc/ci/build.sh new file mode 100644 index 0000000..eb07c18 --- /dev/null +++ b/libc/ci/build.sh @@ -0,0 +1,214 @@ +#!/usr/bin/env sh + +# Checks that libc builds properly for all supported targets on a particular +# Rust version: + +set -ex + +RUST=${TRAVIS_RUST_VERSION} +OS=${TRAVIS_OS_NAME} + +echo "Testing Rust ${RUST} on ${OS}" + +test_target() { + CARGO="${1}" + TARGET="${2}" + NO_STD="${3}" + + opt= + if [ "${TARGET}" = "x86_64-unknown-linux-gnux32" ]; then + # FIXME: x86_64-unknown-linux-gnux32 fail to compile without + # --release + # + # See https://github.com/rust-lang/rust/issues/45417 + opt="--release" + fi + + # If there is a std component, fetch it: + if [ "${NO_STD}" != "1" ]; then + # FIXME: rustup often fails to download some artifacts due to network + # issues, so we retry this N times. + N=5 + n=0 + until [ $n -ge $N ] + do + if rustup target add "${TARGET}" --toolchain "${RUST}" ; then + break + fi + n=$((n+1)) + sleep 1 + done + fi + + # Test that libc builds without any default features (no libstd) + "$CARGO" "+${RUST}" build -vv $opt --no-default-features --target "${TARGET}" + + # Test that libc builds with default features (e.g. libstd) + # if the target supports libstd + if [ "$NO_STD" != "1" ]; then + "$CARGO" "+${RUST}" build -vv $opt --target "${TARGET}" + fi + + # Test that libc builds with the `extra_traits` feature + "$CARGO" "+${RUST}" build -vv $opt --no-default-features --target "${TARGET}" \ + --features extra_traits + + # Also test that it builds with `extra_traits` and default features: + if [ "$NO_STD" != "1" ]; then + "$CARGO" "+${RUST}" build -vv $opt --target "${TARGET}" \ + --features extra_traits + fi +} + +RUST_LINUX_TARGETS="\ +aarch64-linux-android \ +aarch64-unknown-linux-gnu \ +arm-linux-androideabi \ +arm-unknown-linux-gnueabi \ +arm-unknown-linux-gnueabihf \ +armv7-linux-androideabi \ +armv7-unknown-linux-gnueabihf \ +i586-unknown-linux-gnu \ +i686-linux-android \ +i686-unknown-freebsd \ +i686-unknown-linux-gnu \ +i686-unknown-linux-musl \ +mips-unknown-linux-gnu \ +mips-unknown-linux-musl \ +mips64-unknown-linux-gnuabi64 \ +mips64el-unknown-linux-gnuabi64 \ +mipsel-unknown-linux-gnu \ +mipsel-unknown-linux-gnu \ +mipsel-unknown-linux-musl \ +powerpc-unknown-linux-gnu \ +powerpc64-unknown-linux-gnu \ +powerpc64le-unknown-linux-gnu \ +s390x-unknown-linux-gnu \ +x86_64-unknown-freebsd \ +x86_64-unknown-linux-gnu \ +x86_64-unknown-linux-musl \ +x86_64-unknown-netbsd \ +" + +RUST_GT_1_13_LINUX_TARGETS="\ +arm-unknown-linux-musleabi \ +arm-unknown-linux-musleabihf \ +armv7-unknown-linux-musleabihf \ +sparc64-unknown-linux-gnu \ +wasm32-unknown-emscripten \ +x86_64-linux-android \ +x86_64-rumprun-netbsd \ +" +RUST_GT_1_19_LINUX_TARGETS="\ +aarch64-unknown-linux-musl \ +sparcv9-sun-solaris \ +wasm32-unknown-unknown \ +x86_64-sun-solaris \ +" +RUST_GT_1_24_LINUX_TARGETS="\ +i586-unknown-linux-musl \ +x86_64-unknown-cloudabi \ +" + +RUST_NIGHTLY_LINUX_TARGETS="\ +aarch64-fuchsia \ +armv5te-unknown-linux-gnueabi \ +armv5te-unknown-linux-musleabi \ +i686-pc-windows-gnu \ +wasm32-wasi \ +x86_64-fortanix-unknown-sgx \ +x86_64-fuchsia \ +x86_64-pc-windows-gnu \ +x86_64-unknown-linux-gnux32 \ +x86_64-unknown-redox \ +" + +RUST_OSX_TARGETS="\ +aarch64-apple-ios \ +armv7-apple-ios \ +armv7s-apple-ios \ +i386-apple-ios \ +i686-apple-darwin \ +x86_64-apple-darwin \ +x86_64-apple-ios \ +" + +# The targets are listed here alphabetically +TARGETS="" +case "${OS}" in + linux*) + TARGETS="${RUST_LINUX_TARGETS}" + + if [ "${RUST}" != "1.13.0" ]; then + TARGETS="${TARGETS} ${RUST_GT_1_13_LINUX_TARGETS}" + if [ "${RUST}" != "1.19.0" ]; then + TARGETS="${TARGETS} ${RUST_GT_1_19_LINUX_TARGETS}" + if [ "${RUST}" != "1.24.0" ]; then + TARGETS="${TARGETS} ${RUST_GT_1_24_LINUX_TARGETS}" + fi + fi + fi + + if [ "${RUST}" = "nightly" ]; then + TARGETS="${TARGETS} ${RUST_NIGHTLY_LINUX_TARGETS}" + fi + + ;; + osx*) + TARGETS="${RUST_OSX_TARGETS}" + ;; + *) + ;; +esac + +for TARGET in $TARGETS; do + test_target cargo "$TARGET" +done + +# FIXME: https://github.com/rust-lang/rust/issues/58564 +# sparc-unknown-linux-gnu +RUST_LINUX_NO_CORE_TARGETS="\ +aarch64-pc-windows-msvc \ +aarch64-unknown-cloudabi \ +aarch64-unknown-hermit \ +aarch64-unknown-netbsd \ +aarch64-unknown-openbsd \ +armebv7r-none-eabi \ +armebv7r-none-eabihf \ +armv7-unknown-cloudabi-eabihf \ +armv7r-none-eabi \ +armv7r-none-eabihf \ +i586-pc-windows-msvc \ +i686-pc-windows-msvc \ +i686-unknown-cloudabi \ +i686-unknown-haiku \ +i686-unknown-netbsd \ +i686-unknown-openbsd \ +mips-unknown-linux-uclibc \ +mipsel-unknown-linux-uclibc \ +nvptx64-nvidia-cuda \ +powerpc-unknown-linux-gnuspe \ +powerpc-unknown-netbsd \ +riscv32imac-unknown-none-elf \ +riscv32imc-unknown-none-elf \ +sparc64-unknown-netbsd \ +thumbv6m-none-eabi \ +thumbv7em-none-eabi \ +thumbv7em-none-eabihf \ +thumbv7m-none-eabi \ +thumbv7neon-linux-androideabi \ +thumbv7neon-unknown-linux-gnueabihf \ +thumbv8m.main-none-eabi \ +x86_64-pc-windows-msvc +x86_64-unknown-dragonfly \ +x86_64-unknown-haiku \ +x86_64-unknown-hermit \ +x86_64-unknown-l4re-uclibc \ +x86_64-unknown-openbsd \ +" + +if [ "${RUST}" = "nightly" ] && [ "${OS}" = "linux" ]; then + for TARGET in $RUST_LINUX_NO_CORE_TARGETS; do + test_target xargo "$TARGET" 1 + done +fi diff --git a/libc/ci/docker/aarch64-linux-android/Dockerfile b/libc/ci/docker/aarch64-linux-android/Dockerfile index 5fc83aa..1458423 100644 --- a/libc/ci/docker/aarch64-linux-android/Dockerfile +++ b/libc/ci/docker/aarch64-linux-android/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:19.04 RUN dpkg --add-architecture i386 && \ apt-get update && \ @@ -9,7 +9,7 @@ RUN dpkg --add-architecture i386 && \ python \ unzip \ expect \ - openjdk-9-jre \ + openjdk-11-jre \ libstdc++6:i386 \ libpulse0 \ gcc \ diff --git a/libc/ci/docker/aarch64-unknown-linux-gnu/Dockerfile b/libc/ci/docker/aarch64-unknown-linux-gnu/Dockerfile index 18214a3..716a445 100644 --- a/libc/ci/docker/aarch64-unknown-linux-gnu/Dockerfile +++ b/libc/ci/docker/aarch64-unknown-linux-gnu/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:17.10 +FROM ubuntu:19.04 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev ca-certificates \ gcc-aarch64-linux-gnu libc6-dev-arm64-cross qemu-user diff --git a/libc/ci/docker/aarch64-unknown-linux-musl/Dockerfile b/libc/ci/docker/aarch64-unknown-linux-musl/Dockerfile index fbc47d9..143a960 100644 --- a/libc/ci/docker/aarch64-unknown-linux-musl/Dockerfile +++ b/libc/ci/docker/aarch64-unknown-linux-musl/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:17.10 +FROM ubuntu:19.04 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc make libc6-dev git curl ca-certificates \ diff --git a/libc/ci/docker/arm-linux-androideabi/Dockerfile b/libc/ci/docker/arm-linux-androideabi/Dockerfile index a3fc64b..acc784e 100644 --- a/libc/ci/docker/arm-linux-androideabi/Dockerfile +++ b/libc/ci/docker/arm-linux-androideabi/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:19.04 RUN dpkg --add-architecture i386 && \ apt-get update && \ @@ -9,7 +9,7 @@ RUN dpkg --add-architecture i386 && \ python \ unzip \ expect \ - openjdk-9-jre \ + openjdk-11-jre \ libstdc++6:i386 \ libpulse0 \ gcc \ diff --git a/libc/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile b/libc/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile index 9fe71dc..bcdbb22 100644 --- a/libc/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile +++ b/libc/ci/docker/arm-unknown-linux-gnueabihf/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:17.10 +FROM ubuntu:19.04 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev ca-certificates \ gcc-arm-linux-gnueabihf libc6-dev-armhf-cross qemu-user diff --git a/libc/ci/docker/arm-unknown-linux-musleabihf/Dockerfile b/libc/ci/docker/arm-unknown-linux-musleabihf/Dockerfile index 0d493ca..e29e854 100644 --- a/libc/ci/docker/arm-unknown-linux-musleabihf/Dockerfile +++ b/libc/ci/docker/arm-unknown-linux-musleabihf/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:17.10 +FROM ubuntu:19.04 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc make libc6-dev git curl ca-certificates \ diff --git a/libc/ci/docker/asmjs-unknown-emscripten/Dockerfile b/libc/ci/docker/asmjs-unknown-emscripten/Dockerfile index 3088fc5..6c08340 100644 --- a/libc/ci/docker/asmjs-unknown-emscripten/Dockerfile +++ b/libc/ci/docker/asmjs-unknown-emscripten/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:19.04 RUN apt-get update && \ apt-get install -y --no-install-recommends \ diff --git a/libc/ci/docker/i686-linux-android/Dockerfile b/libc/ci/docker/i686-linux-android/Dockerfile index f0836c3..59ea2d7 100644 --- a/libc/ci/docker/i686-linux-android/Dockerfile +++ b/libc/ci/docker/i686-linux-android/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:19.04 RUN dpkg --add-architecture i386 && \ apt-get update && \ @@ -9,7 +9,7 @@ RUN dpkg --add-architecture i386 && \ python \ unzip \ expect \ - openjdk-9-jre \ + openjdk-11-jre \ libstdc++6:i386 \ libpulse0 \ gcc \ diff --git a/libc/ci/docker/i686-unknown-linux-gnu/Dockerfile b/libc/ci/docker/i686-unknown-linux-gnu/Dockerfile index 03f3e8e..5563a7b 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:18.04 +FROM ubuntu:19.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/i686-unknown-linux-musl/Dockerfile b/libc/ci/docker/i686-unknown-linux-musl/Dockerfile index b726e4d..c085c10 100644 --- a/libc/ci/docker/i686-unknown-linux-musl/Dockerfile +++ b/libc/ci/docker/i686-unknown-linux-musl/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:17.10 +FROM ubuntu:19.04 RUN dpkg --add-architecture i386 RUN apt-get update diff --git a/libc/ci/docker/mips-unknown-linux-gnu/Dockerfile b/libc/ci/docker/mips-unknown-linux-gnu/Dockerfile index c66abd4..9f1bcaf 100644 --- a/libc/ci/docker/mips-unknown-linux-gnu/Dockerfile +++ b/libc/ci/docker/mips-unknown-linux-gnu/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:17.10 +FROM ubuntu:19.04 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev qemu-user ca-certificates \ diff --git a/libc/ci/docker/mips-unknown-linux-musl/Dockerfile b/libc/ci/docker/mips-unknown-linux-musl/Dockerfile index dde22fd..7f2764c 100644 --- a/libc/ci/docker/mips-unknown-linux-musl/Dockerfile +++ b/libc/ci/docker/mips-unknown-linux-musl/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:17.10 +FROM ubuntu:19.04 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev qemu-user ca-certificates qemu-system-mips curl \ diff --git a/libc/ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile b/libc/ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile index b9921fc..b97cdb4 100644 --- a/libc/ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile +++ b/libc/ci/docker/mips64-unknown-linux-gnuabi64/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:17.10 +FROM ubuntu:19.04 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev qemu-user ca-certificates \ diff --git a/libc/ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile b/libc/ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile index 434c908..7f79452 100644 --- a/libc/ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile +++ b/libc/ci/docker/mips64el-unknown-linux-gnuabi64/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:17.10 +FROM ubuntu:19.04 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev qemu-user ca-certificates \ diff --git a/libc/ci/docker/mipsel-unknown-linux-musl/Dockerfile b/libc/ci/docker/mipsel-unknown-linux-musl/Dockerfile index 037bf64..03e8357 100644 --- a/libc/ci/docker/mipsel-unknown-linux-musl/Dockerfile +++ b/libc/ci/docker/mipsel-unknown-linux-musl/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:17.10 +FROM ubuntu:19.04 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev qemu-user ca-certificates qemu-system-mips curl \ diff --git a/libc/ci/docker/powerpc-unknown-linux-gnu/Dockerfile b/libc/ci/docker/powerpc-unknown-linux-gnu/Dockerfile index 106ada4..9fa05af 100644 --- a/libc/ci/docker/powerpc-unknown-linux-gnu/Dockerfile +++ b/libc/ci/docker/powerpc-unknown-linux-gnu/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:17.10 +FROM ubuntu:19.04 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev qemu-user ca-certificates \ @@ -7,4 +7,5 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ ENV CARGO_TARGET_POWERPC_UNKNOWN_LINUX_GNU_LINKER=powerpc-linux-gnu-gcc \ CARGO_TARGET_POWERPC_UNKNOWN_LINUX_GNU_RUNNER="qemu-ppc -L /usr/powerpc-linux-gnu" \ + CC=powerpc-linux-gnu-gcc \ PATH=$PATH:/rust/bin diff --git a/libc/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile b/libc/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile index a6ab66a..ab40789 100644 --- a/libc/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile +++ b/libc/ci/docker/powerpc64-unknown-linux-gnu/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:17.10 +FROM ubuntu:19.04 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev qemu-user ca-certificates \ diff --git a/libc/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile b/libc/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile index 627123e..4dcd632 100644 --- a/libc/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile +++ b/libc/ci/docker/powerpc64le-unknown-linux-gnu/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:17.10 +FROM ubuntu:19.04 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc libc6-dev qemu-user ca-certificates \ diff --git a/libc/ci/docker/s390x-unknown-linux-gnu/Dockerfile b/libc/ci/docker/s390x-unknown-linux-gnu/Dockerfile index 861f4f9..75c11c1 100644 --- a/libc/ci/docker/s390x-unknown-linux-gnu/Dockerfile +++ b/libc/ci/docker/s390x-unknown-linux-gnu/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:17.10 +FROM ubuntu:19.04 RUN apt-get update && apt-get install -y --no-install-recommends \ curl ca-certificates \ diff --git a/libc/ci/docker/sparc64-unknown-linux-gnu/Dockerfile b/libc/ci/docker/sparc64-unknown-linux-gnu/Dockerfile index d9edaab..d1f4503 100644 --- a/libc/ci/docker/sparc64-unknown-linux-gnu/Dockerfile +++ b/libc/ci/docker/sparc64-unknown-linux-gnu/Dockerfile @@ -1,14 +1,11 @@ -FROM debian:stretch +FROM ubuntu:19.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 linux-libc-dev-sparc64-cross linux-headers-4.9.0-3-common - -# Put linux/module.h into the right spot as it is not shipped by debian -RUN cp /usr/src/linux-headers-4.9.0-3-common/include/uapi/linux/module.h /usr/sparc64-linux-gnu/include/linux/ + p7zip-full cpio linux-libc-dev-sparc64-cross COPY linux-sparc64.sh / RUN bash /linux-sparc64.sh diff --git a/libc/ci/docker/wasm32-unknown-emscripten/Dockerfile b/libc/ci/docker/wasm32-unknown-emscripten/Dockerfile index 59bf7d9..de8e353 100644 --- a/libc/ci/docker/wasm32-unknown-emscripten/Dockerfile +++ b/libc/ci/docker/wasm32-unknown-emscripten/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:19.04 RUN apt-get update && \ apt-get install -y --no-install-recommends \ diff --git a/libc/ci/docker/wasm32-wasi/Dockerfile b/libc/ci/docker/wasm32-wasi/Dockerfile new file mode 100644 index 0000000..d963a44 --- /dev/null +++ b/libc/ci/docker/wasm32-wasi/Dockerfile @@ -0,0 +1,93 @@ +# In the first container we want to assemble the `wasi-sysroot` by compiling it +# from source. This requires a clang 8.0+ compiler with enough wasm support and +# then we're just running a standard `make` inside of what we clone. +FROM ubuntu:18.04 as wasi-sysroot + +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + clang \ + cmake \ + curl \ + g++ \ + git \ + libc6-dev \ + libclang-dev \ + make \ + ssh \ + xz-utils + +# Fetch clang 8.0+ which is used to compile the wasi target and link our +# programs together. +RUN curl http://releases.llvm.org/8.0.0/clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz | tar xJf - +RUN mv /clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-18.04 /wasmcc + +# Note that we're using `git reset --hard` to pin to a specific commit for +# verification for now. The sysroot is currently in somewhat of a state of flux +# and is expected to have breaking changes, so this is an attempt to mitigate +# those breaking changes on `libc`'s own CI +RUN git clone https://github.com/CraneStation/wasi-sysroot && \ + cd wasi-sysroot && \ + git reset --hard eee6ee7566e26f2535eb6088c8494a112ff423b9 +RUN make -C wasi-sysroot install -j $(nproc) WASM_CC=/wasmcc/bin/clang INSTALL_DIR=/wasi-sysroot + +# This is a small wrapper script which executes the actual clang binary in +# `/wasmcc` and then is sure to pass the right `--sysroot` argument which we +# just built above. +COPY docker/wasm32-wasi/clang.sh /wasi-sysroot/bin/clang + +# In the second container we're going to build the `wasmtime` binary which is +# used to execute wasi executables. This is a standard Rust project so we're +# just checking out a known revision (which pairs with the sysroot one we +# downlaoded above) and then we're building it with Cargo +FROM ubuntu:18.04 as wasmtime + +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + clang \ + cmake \ + curl \ + g++ \ + git \ + libclang-dev \ + make \ + ssh + +RUN curl -sSf https://sh.rustup.rs | sh -s -- -y +ENV PATH=/root/.cargo/bin:$PATH + +RUN apt-get install -y --no-install-recommends python +RUN git clone --recursive https://github.com/CraneStation/wasmtime wasmtime && \ + cd wasmtime && \ + git reset --hard 67edb00f29b62864b00179fe4bfa99bc29973285 +RUN cargo build --release --manifest-path wasmtime/Cargo.toml + +# And finally in the last image we're going to assemble everything together. +# We'll install things needed at runtime for now and then copy over the +# sysroot/wasmtime artifacts into their final location. +FROM ubuntu:18.04 + +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + gcc \ + libc6-dev \ + libxml2 \ + ca-certificates + +# Copy over clang we downloaded to link executables ... +COPY --from=wasi-sysroot /wasmcc /wasmcc/ +# ... and the sysroot we built to link executables against ... +COPY --from=wasi-sysroot /wasi-sysroot/ /wasi-sysroot/ +# ... and finally wasmtime to actually execute binaries +COPY --from=wasmtime /wasmtime/target/release/wasmtime /usr/bin/ + +# Of note here is our clang wrapper which just executes a normal clang +# executable with the right sysroot, and then we're sure to turn off the +# crt-static feature to ensure that the CRT that we're specifying with `clang` +# is used. +ENV CARGO_TARGET_WASM32_WASI_RUNNER=wasmtime \ + CARGO_TARGET_WASM32_WASI_LINKER=/wasi-sysroot/bin/clang \ + CC_wasm32_wasi=/wasi-sysroot/bin/clang \ + PATH=$PATH:/rust/bin \ + RUSTFLAGS=-Ctarget-feature=-crt-static diff --git a/libc/ci/docker/wasm32-wasi/clang.sh b/libc/ci/docker/wasm32-wasi/clang.sh new file mode 100755 index 0000000..6f29812 --- /dev/null +++ b/libc/ci/docker/wasm32-wasi/clang.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +exec /wasmcc/bin/clang --target=wasm32-wasi --sysroot /wasi-sysroot "$@" diff --git a/libc/ci/docker/x86_64-linux-android/Dockerfile b/libc/ci/docker/x86_64-linux-android/Dockerfile index 0cfbc48..b0984c0 100644 --- a/libc/ci/docker/x86_64-linux-android/Dockerfile +++ b/libc/ci/docker/x86_64-linux-android/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:16.04 +FROM ubuntu:19.04 RUN apt-get update && \ apt-get install -y --no-install-recommends \ diff --git a/libc/ci/docker/x86_64-rumprun-netbsd/runtest.rs b/libc/ci/docker/x86_64-rumprun-netbsd/runtest.rs index 94b5946..7e96fbf 100644 --- a/libc/ci/docker/x86_64-rumprun-netbsd/runtest.rs +++ b/libc/ci/docker/x86_64-rumprun-netbsd/runtest.rs @@ -47,7 +47,8 @@ fn find_ok(input: &mut Read, tx: mpsc::Sender<()>) { for line in BufReader::new(input).lines() { let line = line.unwrap(); println!("{}", line); - if line.starts_with("PASSED ") && line.contains(" tests") { + if (line.starts_with("PASSED ") && line.contains(" tests")) || + line.starts_with("test result: ok"){ tx.send(()).unwrap(); } } diff --git a/libc/ci/docker/x86_64-unknown-linux-gnu/Dockerfile b/libc/ci/docker/x86_64-unknown-linux-gnu/Dockerfile index 6ab9c92..0dbb191 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:18.04 +FROM ubuntu:19.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 index 03f3e8e..5563a7b 100644 --- a/libc/ci/docker/x86_64-unknown-linux-gnux32/Dockerfile +++ b/libc/ci/docker/x86_64-unknown-linux-gnux32/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM ubuntu:19.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/x86_64-unknown-linux-musl/Dockerfile b/libc/ci/docker/x86_64-unknown-linux-musl/Dockerfile index 0a27709..59164d2 100644 --- a/libc/ci/docker/x86_64-unknown-linux-musl/Dockerfile +++ b/libc/ci/docker/x86_64-unknown-linux-musl/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:17.10 +FROM ubuntu:19.04 RUN apt-get update RUN apt-get install -y --no-install-recommends \ diff --git a/libc/ci/dox.sh b/libc/ci/dox.sh index 521743e..ce55081 100644 --- a/libc/ci/dox.sh +++ b/libc/ci/dox.sh @@ -6,28 +6,65 @@ set -ex -TARGETS=$(grep html_root_url src/lib.rs | sed 's/.*".*\/\(.*\)"/\1/'| sed 's/)//') +TARGET_DOC_DIR=target/doc +README=README.md +PLATFORM_SUPPORT=platform-support.md -rm -rf target/doc -mkdir -p target/doc +rm -rf $TARGET_DOC_DIR +mkdir -p $TARGET_DOC_DIR -cp ci/landing-page-head.html target/doc/index.html +# List all targets that do currently build successfully: +# shellcheck disable=SC1003 +grep '[\d|\w|-]* \\' ci/build.sh > targets +sed -i.bak 's/ \\//g' targets +grep '^[_a-zA-Z0-9-]*$' targets > tmp && mv tmp targets -for target in $TARGETS; do - echo "documenting ${target}" +# Create a markdown list of supported platforms in $PLATFORM_SUPPORT +rm $PLATFORM_SUPPORT || true - rustdoc -o "target/doc/${target}" --target "${target}" src/lib.rs --cfg cross_platform_docs \ - --crate-name libc +printf '### Platform-specific documentation\n' >> $PLATFORM_SUPPORT - echo "
  • ${target}
  • " \ - >> target/doc/index.html -done +while read -r target; do + echo "documenting ${target}" -cat ci/landing-page-footer.html >> target/doc/index.html + case "${target}" in + *apple*) + # FIXME: + # We can't build docs of apple targets from Linux yet. + continue + ;; + *) + ;; + esac + + rustup target add "${target}" || true + + # If cargo doc fails, then try xargo: + if ! cargo doc --target "${target}" \ + --no-default-features --features extra_traits ; then + xargo doc --target "${target}" \ + --no-default-features --features extra_traits + fi + + cp -r "target/${target}/doc" "${TARGET_DOC_DIR}/${target}" + + echo "* [${target}](${target}/libc/index.html)" >> $PLATFORM_SUPPORT +done < targets + +# Replace
    with the contents of $PLATFORM_SUPPORT +cp $README $TARGET_DOC_DIR +line=$(grep -n '
    ' $README | cut -d ":" -f 1) + +set +x +{ head -n "$((line-1))" $README; cat $PLATFORM_SUPPORT; tail -n "+$((line+1))" $README; } > $TARGET_DOC_DIR/$README +set -x + +# Copy the licenses +cp LICENSE-* $TARGET_DOC_DIR/ # If we're on travis, not a PR, and on the right branch, publish! if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_BRANCH" = "master" ]; then pip install ghp_import --install-option="--prefix=$HOME/.local" - "${HOME}/.local/bin/ghp-import" -n target/doc + "${HOME}/.local/bin/ghp-import" $TARGET_DOC_DIR git push -qf "https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git" gh-pages fi diff --git a/libc/ci/ios/deploy_and_run_on_ios_simulator.rs b/libc/ci/ios/deploy_and_run_on_ios_simulator.rs index 95df52d..2075be6 100644 --- a/libc/ci/ios/deploy_and_run_on_ios_simulator.rs +++ b/libc/ci/ios/deploy_and_run_on_ios_simulator.rs @@ -129,8 +129,11 @@ fn run_app_on_simulator() { let stdout = String::from_utf8_lossy(&output.stdout); let passed = stdout.lines() - .find(|l| l.contains("PASSED")) - .map(|l| l.contains("tests")) + .find(|l| + (l.contains("PASSED") && + l.contains("tests")) || + l.contains("test result: ok") + ) .unwrap_or(false); println!("Shutting down simulator"); diff --git a/libc/ci/landing-page-footer.html b/libc/ci/landing-page-footer.html deleted file mode 100644 index 941cc8d..0000000 --- a/libc/ci/landing-page-footer.html +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/libc/ci/landing-page-head.html b/libc/ci/landing-page-head.html deleted file mode 100644 index fc69fa8..0000000 --- a/libc/ci/landing-page-head.html +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - -