diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b59ac32dc..113e210f2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -22,9 +22,9 @@ strategy: aarch64-unknown-linux-gnu: { TARGET: aarch64-unknown-linux-gnu, CPP: 1, DYLIB: 1, STD: 1, RUN: 1, RUNNERS: qemu-user qemu-system } arm-unknown-linux-gnueabi: { TARGET: arm-unknown-linux-gnueabi, CPP: 1, DYLIB: 1, STD: 1, RUN: 1 } arm-unknown-linux-gnueabihf: { TARGET: arm-unknown-linux-gnueabihf, CPP: 1, DYLIB: 1, STD: 1, RUN: 1 } - armv7-unknown-linux-gnueabihf: { TARGET: armv7-unknown-linux-gnueabihf, CPP: 1, DYLIB: 1, STD: 1, RUN: 1, RUNNERS: qemu-user qemu-system } + armv7-unknown-linux-gnueabihf: { TARGET: armv7-unknown-linux-gnueabihf, CPP: 1, DYLIB: 1, STD: 1, RUN: 1, RUNNERS: qemu-user qemu-system } i586-unknown-linux-gnu: { TARGET: i586-unknown-linux-gnu, CPP: 1, DYLIB: 1, STD: 1, RUN: 1 } - i686-unknown-linux-gnu: { TARGET: i686-unknown-linux-gnu, CPP: 1, DYLIB: 1, STD: 1, RUN: 1, RUNNERS: native qemu-user qemu-system } + i686-unknown-linux-gnu: { TARGET: i686-unknown-linux-gnu, CPP: 1, DYLIB: 1, STD: 1, RUN: 1, RUNNERS: native qemu-user qemu-system } mips-unknown-linux-gnu: { TARGET: mips-unknown-linux-gnu, CPP: 1, DYLIB: 1, STD: 1, RUN: 1, RUNNERS: qemu-user qemu-system } mipsel-unknown-linux-gnu: { TARGET: mipsel-unknown-linux-gnu, CPP: 1, DYLIB: 1, STD: 1, RUN: 1, RUNNERS: qemu-user qemu-system } mips64-unknown-linux-gnuabi64: { TARGET: mips64-unknown-linux-gnuabi64, CPP: 1, DYLIB: 1, STD: 1, RUN: 1 } @@ -61,9 +61,9 @@ strategy: x86_64-unknown-netbsd: { TARGET: x86_64-unknown-netbsd, CPP: 1, DYLIB: 1, STD: 1 } sparcv9-sun-solaris: { TARGET: sparcv9-sun-solaris, CPP: 1, DYLIB: 1, STD: 1 } x86_64-sun-solaris: { TARGET: x86_64-sun-solaris, CPP: 1, DYLIB: 1, STD: 1 } - asmjs-unknown-emscripten: { TARGET: asmjs-unknown-emscripten, CPP: 1, STD: 1, RUN: 1 } + asmjs-unknown-emscripten: { TARGET: asmjs-unknown-emscripten, STD: 1, RUN: 1 } # `cargo run` fails with an assertion error (https://github.com/rust-lang/cargo/issues/4689) on `wasm32-unknown-emscripten`. - wasm32-unknown-emscripten: { TARGET: wasm32-unknown-emscripten, CPP: 1, STD: 1 } + wasm32-unknown-emscripten: { TARGET: wasm32-unknown-emscripten, STD: 1 } thumbv6m-none-eabi: { TARGET: thumbv6m-none-eabi, STD: 1 } thumbv7em-none-eabi: { TARGET: thumbv7em-none-eabi, STD: 1 } thumbv7em-none-eabihf: { TARGET: thumbv7em-none-eabihf, STD: 1 } diff --git a/build-docker-image.sh b/build-docker-image.sh index 68cf604fb..cbb2b162e 100755 --- a/build-docker-image.sh +++ b/build-docker-image.sh @@ -9,8 +9,10 @@ run() { local dockerfile="Dockerfile.${1}" local image_name="rustembedded/cross:${1}" + local cache_from_args=() + if docker pull "${image_name}"; then - local cache_from_args=(--cache-from "${image_name}") + cache_from_args=(--cache-from "${image_name}") fi docker build ${cache_from_args[@]} --pull -t "${image_name}" -f "${dockerfile}" . @@ -23,10 +25,12 @@ run() { fi } -if [ -z "${1}" ]; then +if [ -z "${@:-}" ]; then for t in Dockerfile.*; do run "${t##Dockerfile.}" done else - run "${1}" + for image in "${@}"; do + run "${image}" + done fi diff --git a/ci/test.sh b/ci/test.sh index 54fb5ddab..7081bd5df 100755 --- a/ci/test.sh +++ b/ci/test.sh @@ -41,8 +41,8 @@ main() { export QEMU_STRACE=1 - # test `cross check` - if [[ ! -z ${STD:-} ]]; then + if (( ${STD:-0} )); then + # test `cross check` td=$(mktemp -d) cargo init --lib --name foo $td pushd $td @@ -50,10 +50,8 @@ main() { cross check --target $TARGET popd rm -rf $td - fi - - # `cross build` test for targets where `std` is not available - if [[ -z "${STD:-}" ]]; then + else + # `cross build` test for targets where `std` is not available td=$(mktemp -d) git clone \ @@ -99,9 +97,9 @@ EOF rm -rf $td fi - if [[ ${RUN:-} ]]; then + if (( ${RUN:-0} )); then # `cross test` test - if [[ ${DYLIB:-} ]]; then + if (( ${DYLIB:-0} )); then td=$(mktemp -d) pushd $td @@ -151,7 +149,7 @@ EOF fi # Test C++ support - if [[ ${CPP:-} ]]; then + if (( ${CPP:-0} )); then td=$(mktemp -d) git clone --depth 1 https://github.com/japaric/hellopp $td @@ -159,7 +157,7 @@ EOF pushd $td cargo update -p gcc retry cargo fetch - if [[ ${RUN:-} ]]; then + if (( ${RUN:-0} )); then cross_run --target $TARGET else cross build --target $TARGET diff --git a/docker/Dockerfile.aarch64-linux-android b/docker/Dockerfile.aarch64-linux-android index 3a2d9025a..a9f2cbe89 100644 --- a/docker/Dockerfile.aarch64-linux-android +++ b/docker/Dockerfile.aarch64-linux-android @@ -3,6 +3,9 @@ FROM ubuntu:16.04 COPY common.sh / RUN /common.sh +COPY cmake.sh / +RUN /cmake.sh + COPY xargo.sh / RUN /xargo.sh diff --git a/docker/Dockerfile.aarch64-unknown-linux-gnu b/docker/Dockerfile.aarch64-unknown-linux-gnu index bc4fb2ff4..7d031c440 100644 --- a/docker/Dockerfile.aarch64-unknown-linux-gnu +++ b/docker/Dockerfile.aarch64-unknown-linux-gnu @@ -3,13 +3,12 @@ FROM ubuntu:16.04 COPY common.sh / RUN /common.sh +COPY cmake.sh / +RUN /cmake.sh + COPY xargo.sh / RUN /xargo.sh -COPY cmake.sh / -RUN apt-get purge --auto-remove -y cmake && \ - /cmake.sh - RUN apt-get install -y --no-install-recommends \ g++-aarch64-linux-gnu \ libc6-dev-arm64-cross diff --git a/docker/Dockerfile.aarch64-unknown-linux-musl b/docker/Dockerfile.aarch64-unknown-linux-musl index 017e522a8..507de85d6 100644 --- a/docker/Dockerfile.aarch64-unknown-linux-musl +++ b/docker/Dockerfile.aarch64-unknown-linux-musl @@ -3,6 +3,9 @@ FROM ubuntu:18.04 COPY common.sh / RUN /common.sh +COPY cmake.sh / +RUN /cmake.sh + COPY xargo.sh / RUN /xargo.sh diff --git a/docker/Dockerfile.arm-linux-androideabi b/docker/Dockerfile.arm-linux-androideabi index 16cd3a712..cab598385 100644 --- a/docker/Dockerfile.arm-linux-androideabi +++ b/docker/Dockerfile.arm-linux-androideabi @@ -3,6 +3,9 @@ FROM ubuntu:16.04 COPY common.sh / RUN /common.sh +COPY cmake.sh / +RUN /cmake.sh + COPY xargo.sh / RUN /xargo.sh diff --git a/docker/Dockerfile.arm-unknown-linux-gnueabi b/docker/Dockerfile.arm-unknown-linux-gnueabi index a1db2b6b5..f6d8fef9e 100644 --- a/docker/Dockerfile.arm-unknown-linux-gnueabi +++ b/docker/Dockerfile.arm-unknown-linux-gnueabi @@ -3,13 +3,12 @@ FROM ubuntu:16.04 COPY common.sh / RUN /common.sh +COPY cmake.sh / +RUN /cmake.sh + COPY xargo.sh / RUN /xargo.sh -COPY cmake.sh / -RUN apt-get purge --auto-remove -y cmake && \ - /cmake.sh - COPY qemu.sh / RUN apt-get install -y --no-install-recommends \ g++-arm-linux-gnueabi \ diff --git a/docker/Dockerfile.arm-unknown-linux-gnueabihf b/docker/Dockerfile.arm-unknown-linux-gnueabihf index 99c862fe5..d442fd565 100644 --- a/docker/Dockerfile.arm-unknown-linux-gnueabihf +++ b/docker/Dockerfile.arm-unknown-linux-gnueabihf @@ -3,17 +3,16 @@ FROM ubuntu:16.04 COPY common.sh / RUN /common.sh +COPY cmake.sh / +RUN /cmake.sh + COPY xargo.sh / RUN /xargo.sh -COPY cmake.sh / -RUN apt-get purge --auto-remove -y cmake && \ - /cmake.sh - RUN mkdir /usr/arm-linux-gnueabihf && \ apt-get install -y --no-install-recommends curl xz-utils && \ cd /usr/arm-linux-gnueabihf && \ - curl -L https://releases.linaro.org/components/toolchain/binaries/latest-7/arm-linux-gnueabihf/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf.tar.xz | \ + curl -L https://releases.linaro.org/components/toolchain/binaries/7.5-2019.12/arm-linux-gnueabihf/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf.tar.xz | \ tar --strip-components 1 -xJ && \ apt-get purge --auto-remove -y curl xz-utils diff --git a/docker/Dockerfile.arm-unknown-linux-musleabi b/docker/Dockerfile.arm-unknown-linux-musleabi index 296d49668..ada77066a 100644 --- a/docker/Dockerfile.arm-unknown-linux-musleabi +++ b/docker/Dockerfile.arm-unknown-linux-musleabi @@ -3,6 +3,9 @@ FROM ubuntu:18.04 COPY common.sh / RUN /common.sh +COPY cmake.sh / +RUN /cmake.sh + COPY xargo.sh / RUN /xargo.sh diff --git a/docker/Dockerfile.arm-unknown-linux-musleabihf b/docker/Dockerfile.arm-unknown-linux-musleabihf index 41e899e9c..32ac20a60 100644 --- a/docker/Dockerfile.arm-unknown-linux-musleabihf +++ b/docker/Dockerfile.arm-unknown-linux-musleabihf @@ -3,6 +3,9 @@ FROM ubuntu:18.04 COPY common.sh / RUN /common.sh +COPY cmake.sh / +RUN /cmake.sh + COPY xargo.sh / RUN /xargo.sh diff --git a/docker/Dockerfile.armv5te-unknown-linux-musleabi b/docker/Dockerfile.armv5te-unknown-linux-musleabi index 3824207b2..e63546610 100644 --- a/docker/Dockerfile.armv5te-unknown-linux-musleabi +++ b/docker/Dockerfile.armv5te-unknown-linux-musleabi @@ -3,6 +3,9 @@ FROM ubuntu:18.04 COPY common.sh / RUN /common.sh +COPY cmake.sh / +RUN /cmake.sh + COPY xargo.sh / RUN /xargo.sh diff --git a/docker/Dockerfile.armv7-linux-androideabi b/docker/Dockerfile.armv7-linux-androideabi index 11ffd5882..90f72b675 100644 --- a/docker/Dockerfile.armv7-linux-androideabi +++ b/docker/Dockerfile.armv7-linux-androideabi @@ -3,6 +3,9 @@ FROM ubuntu:16.04 COPY common.sh / RUN /common.sh +COPY cmake.sh / +RUN /cmake.sh + COPY xargo.sh / RUN /xargo.sh diff --git a/docker/Dockerfile.armv7-unknown-linux-gnueabihf b/docker/Dockerfile.armv7-unknown-linux-gnueabihf index a02154e75..deb56affb 100644 --- a/docker/Dockerfile.armv7-unknown-linux-gnueabihf +++ b/docker/Dockerfile.armv7-unknown-linux-gnueabihf @@ -3,13 +3,12 @@ FROM ubuntu:16.04 COPY common.sh / RUN /common.sh +COPY cmake.sh / +RUN /cmake.sh + COPY xargo.sh / RUN /xargo.sh -COPY cmake.sh / -RUN apt-get purge --auto-remove -y cmake && \ - /cmake.sh - RUN apt-get install -y --no-install-recommends \ g++-arm-linux-gnueabihf \ libc6-dev-armhf-cross diff --git a/docker/Dockerfile.armv7-unknown-linux-musleabihf b/docker/Dockerfile.armv7-unknown-linux-musleabihf index df265e681..ed95d5083 100644 --- a/docker/Dockerfile.armv7-unknown-linux-musleabihf +++ b/docker/Dockerfile.armv7-unknown-linux-musleabihf @@ -3,6 +3,9 @@ FROM ubuntu:18.04 COPY common.sh / RUN /common.sh +COPY cmake.sh / +RUN /cmake.sh + COPY xargo.sh / RUN /xargo.sh diff --git a/docker/Dockerfile.asmjs-unknown-emscripten b/docker/Dockerfile.asmjs-unknown-emscripten index cf9b8246b..79cf71a4a 100644 --- a/docker/Dockerfile.asmjs-unknown-emscripten +++ b/docker/Dockerfile.asmjs-unknown-emscripten @@ -3,12 +3,31 @@ FROM ubuntu:16.04 COPY common.sh / RUN /common.sh -RUN apt-get install -y --no-install-recommends python +COPY cmake.sh / +RUN /cmake.sh -COPY emscripten.sh / -RUN /emscripten.sh +COPY xargo.sh / +RUN /xargo.sh -COPY emscripten-entry.sh / -ENTRYPOINT ["/emscripten-entry.sh"] +COPY --from=trzeci/emscripten:1.38.46-upstream /emsdk_portable /emsdk_portable + +ENV EMSDK /emsdk_portable +ENV EMSCRIPTEN=${EMSDK}/emscripten/sdk + +ENV EM_DATA ${EMSDK}/.data +ENV EM_CONFIG ${EMSDK}/.emscripten +ENV EM_CACHE ${EM_DATA}/cache +ENV EM_PORTS ${EM_DATA}/ports + +ENV PATH="${EMSDK}:${EMSDK}/emscripten/sdk:${EMSDK}/llvm/clang/bin:${EMSDK}/node/current/bin:${EMSDK}/binaryen/bin:${PATH}" + +ENTRYPOINT ["/emsdk_portable/entrypoint"] + +RUN apt-get update && apt-get install -y --no-install-recommends \ + libxml2 \ + python ENV CARGO_TARGET_ASMJS_UNKNOWN_EMSCRIPTEN_RUNNER=node + +# Prevent 'wasm2js does not support source maps yet' error. +ENV RUSTFLAGS='-C debuginfo=0' diff --git a/docker/Dockerfile.i586-unknown-linux-gnu b/docker/Dockerfile.i586-unknown-linux-gnu index e7fb7a585..67db7de36 100644 --- a/docker/Dockerfile.i586-unknown-linux-gnu +++ b/docker/Dockerfile.i586-unknown-linux-gnu @@ -3,6 +3,9 @@ FROM ubuntu:16.04 COPY common.sh / RUN /common.sh +COPY cmake.sh / +RUN /cmake.sh + COPY xargo.sh / RUN /xargo.sh diff --git a/docker/Dockerfile.i586-unknown-linux-musl b/docker/Dockerfile.i586-unknown-linux-musl index 5014f3e0e..204ba3782 100644 --- a/docker/Dockerfile.i586-unknown-linux-musl +++ b/docker/Dockerfile.i586-unknown-linux-musl @@ -3,6 +3,9 @@ FROM ubuntu:18.04 COPY common.sh / RUN /common.sh +COPY cmake.sh / +RUN /cmake.sh + COPY xargo.sh / RUN /xargo.sh diff --git a/docker/Dockerfile.i686-linux-android b/docker/Dockerfile.i686-linux-android index fa3cdefe8..445b1982e 100644 --- a/docker/Dockerfile.i686-linux-android +++ b/docker/Dockerfile.i686-linux-android @@ -3,6 +3,9 @@ FROM ubuntu:16.04 COPY common.sh / RUN /common.sh +COPY cmake.sh / +RUN /cmake.sh + COPY xargo.sh / RUN /xargo.sh diff --git a/docker/Dockerfile.i686-unknown-linux-gnu b/docker/Dockerfile.i686-unknown-linux-gnu index 414d798fc..7ee1bd874 100644 --- a/docker/Dockerfile.i686-unknown-linux-gnu +++ b/docker/Dockerfile.i686-unknown-linux-gnu @@ -3,13 +3,12 @@ FROM ubuntu:16.04 COPY common.sh / RUN /common.sh +COPY cmake.sh / +RUN /cmake.sh + COPY xargo.sh / RUN /xargo.sh -COPY cmake.sh / -RUN apt-get purge --auto-remove -y cmake && \ - /cmake.sh - RUN apt-get install -y --no-install-recommends \ g++-multilib diff --git a/docker/Dockerfile.i686-unknown-linux-musl b/docker/Dockerfile.i686-unknown-linux-musl index c6d3ed18d..d0d2c57e6 100644 --- a/docker/Dockerfile.i686-unknown-linux-musl +++ b/docker/Dockerfile.i686-unknown-linux-musl @@ -3,6 +3,9 @@ FROM ubuntu:18.04 COPY common.sh / RUN /common.sh +COPY cmake.sh / +RUN /cmake.sh + COPY xargo.sh / RUN /xargo.sh diff --git a/docker/Dockerfile.mips-unknown-linux-gnu b/docker/Dockerfile.mips-unknown-linux-gnu index 0419ae202..b8e030e95 100644 --- a/docker/Dockerfile.mips-unknown-linux-gnu +++ b/docker/Dockerfile.mips-unknown-linux-gnu @@ -3,6 +3,9 @@ FROM ubuntu:16.04 COPY common.sh / RUN /common.sh +COPY cmake.sh / +RUN /cmake.sh + COPY xargo.sh / RUN /xargo.sh diff --git a/docker/Dockerfile.mips-unknown-linux-musl b/docker/Dockerfile.mips-unknown-linux-musl index 04257bd96..bc23ce1ce 100644 --- a/docker/Dockerfile.mips-unknown-linux-musl +++ b/docker/Dockerfile.mips-unknown-linux-musl @@ -3,6 +3,9 @@ FROM ubuntu:18.04 COPY common.sh / RUN /common.sh +COPY cmake.sh / +RUN /cmake.sh + COPY xargo.sh / RUN /xargo.sh diff --git a/docker/Dockerfile.mips64-unknown-linux-gnuabi64 b/docker/Dockerfile.mips64-unknown-linux-gnuabi64 index b06f33d26..d329ebb35 100644 --- a/docker/Dockerfile.mips64-unknown-linux-gnuabi64 +++ b/docker/Dockerfile.mips64-unknown-linux-gnuabi64 @@ -3,6 +3,9 @@ FROM ubuntu:16.04 COPY common.sh / RUN /common.sh +COPY cmake.sh / +RUN /cmake.sh + COPY xargo.sh / RUN /xargo.sh diff --git a/docker/Dockerfile.mips64el-unknown-linux-gnuabi64 b/docker/Dockerfile.mips64el-unknown-linux-gnuabi64 index a94311451..0cc4a36c6 100644 --- a/docker/Dockerfile.mips64el-unknown-linux-gnuabi64 +++ b/docker/Dockerfile.mips64el-unknown-linux-gnuabi64 @@ -3,6 +3,9 @@ FROM ubuntu:16.04 COPY common.sh / RUN /common.sh +COPY cmake.sh / +RUN /cmake.sh + COPY xargo.sh / RUN /xargo.sh diff --git a/docker/Dockerfile.mipsel-unknown-linux-gnu b/docker/Dockerfile.mipsel-unknown-linux-gnu index 941df0eb6..98882ee96 100644 --- a/docker/Dockerfile.mipsel-unknown-linux-gnu +++ b/docker/Dockerfile.mipsel-unknown-linux-gnu @@ -3,6 +3,9 @@ FROM ubuntu:16.04 COPY common.sh / RUN /common.sh +COPY cmake.sh / +RUN /cmake.sh + COPY xargo.sh / RUN /xargo.sh diff --git a/docker/Dockerfile.mipsel-unknown-linux-musl b/docker/Dockerfile.mipsel-unknown-linux-musl index c6ee462bd..b0cabb17c 100644 --- a/docker/Dockerfile.mipsel-unknown-linux-musl +++ b/docker/Dockerfile.mipsel-unknown-linux-musl @@ -3,6 +3,9 @@ FROM ubuntu:18.04 COPY common.sh / RUN /common.sh +COPY cmake.sh / +RUN /cmake.sh + COPY xargo.sh / RUN /xargo.sh diff --git a/docker/Dockerfile.powerpc-unknown-linux-gnu b/docker/Dockerfile.powerpc-unknown-linux-gnu index d8fad1fb0..a14772e55 100644 --- a/docker/Dockerfile.powerpc-unknown-linux-gnu +++ b/docker/Dockerfile.powerpc-unknown-linux-gnu @@ -3,13 +3,12 @@ FROM ubuntu:16.04 COPY common.sh / RUN /common.sh +COPY cmake.sh / +RUN /cmake.sh + COPY xargo.sh / RUN /xargo.sh -COPY cmake.sh / -RUN apt-get purge --auto-remove -y cmake && \ - /cmake.sh - RUN apt-get install -y --no-install-recommends \ g++-powerpc-linux-gnu \ libc6-dev-powerpc-cross diff --git a/docker/Dockerfile.powerpc64-unknown-linux-gnu b/docker/Dockerfile.powerpc64-unknown-linux-gnu index babf3bf7d..8ca72e816 100644 --- a/docker/Dockerfile.powerpc64-unknown-linux-gnu +++ b/docker/Dockerfile.powerpc64-unknown-linux-gnu @@ -3,6 +3,9 @@ FROM ubuntu:16.04 COPY common.sh / RUN /common.sh +COPY cmake.sh / +RUN /cmake.sh + COPY xargo.sh / RUN /xargo.sh diff --git a/docker/Dockerfile.powerpc64le-unknown-linux-gnu b/docker/Dockerfile.powerpc64le-unknown-linux-gnu index a209f92e8..4c8ef0a20 100644 --- a/docker/Dockerfile.powerpc64le-unknown-linux-gnu +++ b/docker/Dockerfile.powerpc64le-unknown-linux-gnu @@ -3,6 +3,9 @@ FROM ubuntu:16.04 COPY common.sh / RUN /common.sh +COPY cmake.sh / +RUN /cmake.sh + COPY xargo.sh / RUN /xargo.sh diff --git a/docker/Dockerfile.s390x-unknown-linux-gnu b/docker/Dockerfile.s390x-unknown-linux-gnu index 122d79d32..04405d002 100644 --- a/docker/Dockerfile.s390x-unknown-linux-gnu +++ b/docker/Dockerfile.s390x-unknown-linux-gnu @@ -3,6 +3,9 @@ FROM ubuntu:16.04 COPY common.sh / RUN /common.sh +COPY cmake.sh / +RUN /cmake.sh + COPY xargo.sh / RUN /xargo.sh diff --git a/docker/Dockerfile.sparc64-unknown-linux-gnu b/docker/Dockerfile.sparc64-unknown-linux-gnu index bf89c936b..f423473ef 100644 --- a/docker/Dockerfile.sparc64-unknown-linux-gnu +++ b/docker/Dockerfile.sparc64-unknown-linux-gnu @@ -3,6 +3,9 @@ FROM ubuntu:16.04 COPY common.sh / RUN /common.sh +COPY cmake.sh / +RUN /cmake.sh + COPY xargo.sh / RUN /xargo.sh diff --git a/docker/Dockerfile.sparcv9-sun-solaris b/docker/Dockerfile.sparcv9-sun-solaris index c58a541b1..3ff9a3863 100644 --- a/docker/Dockerfile.sparcv9-sun-solaris +++ b/docker/Dockerfile.sparcv9-sun-solaris @@ -3,6 +3,9 @@ FROM ubuntu:16.04 COPY common.sh / RUN /common.sh +COPY cmake.sh / +RUN /cmake.sh + COPY xargo.sh / RUN /xargo.sh diff --git a/docker/Dockerfile.thumbv6m-none-eabi b/docker/Dockerfile.thumbv6m-none-eabi index 5907ba7d1..85da4a4ad 100644 --- a/docker/Dockerfile.thumbv6m-none-eabi +++ b/docker/Dockerfile.thumbv6m-none-eabi @@ -3,6 +3,9 @@ FROM ubuntu:16.04 COPY common.sh / RUN /common.sh +COPY cmake.sh / +RUN /cmake.sh + COPY xargo.sh / RUN /xargo.sh diff --git a/docker/Dockerfile.thumbv7em-none-eabi b/docker/Dockerfile.thumbv7em-none-eabi index 09f86ce17..3cd744f44 100644 --- a/docker/Dockerfile.thumbv7em-none-eabi +++ b/docker/Dockerfile.thumbv7em-none-eabi @@ -3,6 +3,9 @@ FROM ubuntu:16.04 COPY common.sh / RUN /common.sh +COPY cmake.sh / +RUN /cmake.sh + COPY xargo.sh / RUN /xargo.sh diff --git a/docker/Dockerfile.thumbv7em-none-eabihf b/docker/Dockerfile.thumbv7em-none-eabihf index 48e3c8d16..e3eec0335 100644 --- a/docker/Dockerfile.thumbv7em-none-eabihf +++ b/docker/Dockerfile.thumbv7em-none-eabihf @@ -3,6 +3,9 @@ FROM ubuntu:16.04 COPY common.sh / RUN /common.sh +COPY cmake.sh / +RUN /cmake.sh + COPY xargo.sh / RUN /xargo.sh diff --git a/docker/Dockerfile.thumbv7m-none-eabi b/docker/Dockerfile.thumbv7m-none-eabi index e6f715b13..bb92ad7a9 100644 --- a/docker/Dockerfile.thumbv7m-none-eabi +++ b/docker/Dockerfile.thumbv7m-none-eabi @@ -3,6 +3,9 @@ FROM ubuntu:16.04 COPY common.sh / RUN /common.sh +COPY cmake.sh / +RUN /cmake.sh + COPY xargo.sh / RUN /xargo.sh diff --git a/docker/Dockerfile.wasm32-unknown-emscripten b/docker/Dockerfile.wasm32-unknown-emscripten index a8b5210be..b7deb01b2 100644 --- a/docker/Dockerfile.wasm32-unknown-emscripten +++ b/docker/Dockerfile.wasm32-unknown-emscripten @@ -3,13 +3,29 @@ FROM ubuntu:16.04 COPY common.sh / RUN /common.sh -RUN apt-get install -y --no-install-recommends python +COPY cmake.sh / +RUN /cmake.sh -COPY emscripten.sh / -RUN /emscripten.sh +COPY xargo.sh / +RUN /xargo.sh -COPY emscripten-entry.sh / -ENTRYPOINT ["/emscripten-entry.sh"] +COPY --from=trzeci/emscripten:1.38.46-upstream /emsdk_portable /emsdk_portable + +ENV EMSDK /emsdk_portable +ENV EMSCRIPTEN=${EMSDK}/emscripten/sdk + +ENV EM_DATA ${EMSDK}/.data +ENV EM_CONFIG ${EMSDK}/.emscripten +ENV EM_CACHE ${EM_DATA}/cache +ENV EM_PORTS ${EM_DATA}/ports + +ENV PATH="${EMSDK}:${EMSDK}/emscripten/sdk:${EMSDK}/llvm/clang/bin:${EMSDK}/node/current/bin:${EMSDK}/binaryen/bin:${PATH}" + +ENTRYPOINT ["/emsdk_portable/entrypoint"] + +RUN apt-get update && apt-get install -y --no-install-recommends \ + libxml2 \ + python COPY node-wasm /usr/local/bin/ ENV CARGO_TARGET_WASM32_UNKNOWN_EMSCRIPTEN_RUNNER=node-wasm diff --git a/docker/Dockerfile.x86_64-linux-android b/docker/Dockerfile.x86_64-linux-android index be961ccc4..7558f4383 100644 --- a/docker/Dockerfile.x86_64-linux-android +++ b/docker/Dockerfile.x86_64-linux-android @@ -3,6 +3,9 @@ FROM ubuntu:16.04 COPY common.sh / RUN /common.sh +COPY cmake.sh / +RUN /cmake.sh + COPY xargo.sh / RUN /xargo.sh diff --git a/docker/Dockerfile.x86_64-pc-windows-gnu b/docker/Dockerfile.x86_64-pc-windows-gnu index e136f6299..8c3eacf3a 100644 --- a/docker/Dockerfile.x86_64-pc-windows-gnu +++ b/docker/Dockerfile.x86_64-pc-windows-gnu @@ -3,6 +3,9 @@ FROM ubuntu:18.04 COPY common.sh / RUN /common.sh +COPY cmake.sh / +RUN /cmake.sh + COPY xargo.sh / RUN /xargo.sh diff --git a/docker/Dockerfile.x86_64-sun-solaris b/docker/Dockerfile.x86_64-sun-solaris index 7251c031d..b8b240b18 100644 --- a/docker/Dockerfile.x86_64-sun-solaris +++ b/docker/Dockerfile.x86_64-sun-solaris @@ -3,6 +3,9 @@ FROM ubuntu:16.04 COPY common.sh / RUN /common.sh +COPY cmake.sh / +RUN /cmake.sh + COPY xargo.sh / RUN /xargo.sh diff --git a/docker/Dockerfile.x86_64-unknown-dragonfly b/docker/Dockerfile.x86_64-unknown-dragonfly index 0be058a75..2f7193a77 100644 --- a/docker/Dockerfile.x86_64-unknown-dragonfly +++ b/docker/Dockerfile.x86_64-unknown-dragonfly @@ -3,6 +3,9 @@ FROM ubuntu:16.04 COPY common.sh / RUN /common.sh +COPY cmake.sh / +RUN /cmake.sh + COPY xargo.sh / RUN /xargo.sh diff --git a/docker/Dockerfile.x86_64-unknown-linux-gnu b/docker/Dockerfile.x86_64-unknown-linux-gnu index a0fde9d10..5faa687e2 100644 --- a/docker/Dockerfile.x86_64-unknown-linux-gnu +++ b/docker/Dockerfile.x86_64-unknown-linux-gnu @@ -3,16 +3,11 @@ FROM ubuntu:16.04 COPY common.sh / RUN /common.sh -COPY xargo.sh / -RUN /xargo.sh - COPY cmake.sh / -RUN apt-get purge --auto-remove -y cmake && \ - /cmake.sh +RUN /cmake.sh -RUN apt-get install -y --no-install-recommends \ - g++ \ - zlib1g-dev +COPY xargo.sh / +RUN /xargo.sh COPY qemu.sh / RUN /qemu.sh x86_64 softmmu diff --git a/docker/Dockerfile.x86_64-unknown-linux-musl b/docker/Dockerfile.x86_64-unknown-linux-musl index 7bc8b1565..291358e4e 100644 --- a/docker/Dockerfile.x86_64-unknown-linux-musl +++ b/docker/Dockerfile.x86_64-unknown-linux-musl @@ -3,6 +3,9 @@ FROM ubuntu:18.04 COPY common.sh / RUN /common.sh +COPY cmake.sh / +RUN /cmake.sh + COPY xargo.sh / RUN /xargo.sh diff --git a/docker/Dockerfile.x86_64-unknown-netbsd b/docker/Dockerfile.x86_64-unknown-netbsd index 3c8964fa4..44d3d9cd1 100644 --- a/docker/Dockerfile.x86_64-unknown-netbsd +++ b/docker/Dockerfile.x86_64-unknown-netbsd @@ -3,6 +3,9 @@ FROM ubuntu:16.04 COPY common.sh / RUN /common.sh +COPY cmake.sh / +RUN /cmake.sh + COPY xargo.sh / RUN /xargo.sh diff --git a/docker/android-ndk.sh b/docker/android-ndk.sh index bfce054ba..526ce7555 100755 --- a/docker/android-ndk.sh +++ b/docker/android-ndk.sh @@ -35,8 +35,9 @@ main() { --arch $arch \ --api $api - # clean up - apt-get purge --auto-remove -y ${purge_list[@]} + if (( ${#purge_list[@]} )); then + apt-get purge --auto-remove -y ${purge_list[@]} + fi popd popd diff --git a/docker/android-system.sh b/docker/android-system.sh index 9b3f83ce5..6f747c3e2 100755 --- a/docker/android-system.sh +++ b/docker/android-system.sh @@ -116,8 +116,9 @@ EOF echo "127.0.0.1 localhost" > /system/etc/hosts - # clean up - apt-get purge --auto-remove -y ${purge_list[@]} + if (( ${#purge_list[@]} )); then + apt-get purge --auto-remove -y ${purge_list[@]} + fi popd diff --git a/docker/cmake.sh b/docker/cmake.sh index c4a04dcac..e51a11038 100755 --- a/docker/cmake.sh +++ b/docker/cmake.sh @@ -4,12 +4,14 @@ set -x set -euo pipefail main() { - local version=3.5.1 + local version=3.16.2 local dependencies=( curl g++ + libssl-dev make + zlib1g-dev ) apt-get update @@ -27,6 +29,7 @@ main() { curl https://cmake.org/files/v${version%.*}/cmake-$version.tar.gz | \ tar --strip-components 1 -xz + ./bootstrap make -j$(nproc) make install @@ -34,7 +37,9 @@ main() { # clean up popd - apt-get purge --auto-remove -y ${purge_list[@]} + if (( ${#purge_list[@]} )); then + apt-get purge --auto-remove -y ${purge_list[@]} + fi rm -rf $td rm $0 diff --git a/docker/common.sh b/docker/common.sh index 05efd82ff..3b6beb966 100755 --- a/docker/common.sh +++ b/docker/common.sh @@ -10,9 +10,10 @@ apt-get install -y --no-install-recommends \ automake \ binutils \ ca-certificates \ - cmake \ + curl \ file \ gcc \ + g++ \ git \ libc6-dev \ libtool \ diff --git a/docker/dragonfly.sh b/docker/dragonfly.sh index 11dac522d..8d2b7e738 100755 --- a/docker/dragonfly.sh +++ b/docker/dragonfly.sh @@ -140,7 +140,9 @@ EOF # clean up popd - apt-get purge --auto-remove -y ${purge_list[@]} + if (( ${#purge_list[@]} )); then + apt-get purge --auto-remove -y ${purge_list[@]} + fi rm -rf $td rm $0 diff --git a/docker/dropbear.sh b/docker/dropbear.sh index e31e0777b..865273648 100755 --- a/docker/dropbear.sh +++ b/docker/dropbear.sh @@ -48,8 +48,9 @@ main() { make -j$(nproc) PROGRAMS=dbclient cp dbclient /usr/local/bin/ - # Clean up - apt-get purge --auto-remove -y ${purge_list[@]} + if (( ${#purge_list[@]} )); then + apt-get purge --auto-remove -y ${purge_list[@]} + fi popd diff --git a/docker/emscripten-entry.sh b/docker/emscripten-entry.sh deleted file mode 100755 index ed6cdb5f3..000000000 --- a/docker/emscripten-entry.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -export HOME=/emsdk-portable/ - -source /emsdk-portable/emsdk_env.sh &> /dev/null - -exec "$@" diff --git a/docker/emscripten.sh b/docker/emscripten.sh index c0ce0faae..5b89c9305 100755 --- a/docker/emscripten.sh +++ b/docker/emscripten.sh @@ -6,9 +6,9 @@ set -euo pipefail main() { local dependencies=( ca-certificates - cmake curl git + libxml2 python ) @@ -25,14 +25,11 @@ main() { git clone https://github.com/emscripten-core/emsdk.git /emsdk-portable cd /emsdk-portable - export HOME=/emsdk-portable/ - - ./emsdk install sdk-1.38.15-64bit - ./emsdk activate sdk-1.38.15-64bit + ./emsdk install 1.38.46-upstream + ./emsdk activate 1.38.46-upstream # Compile and cache libc - source ./emsdk_env.sh - echo "main(){}" > a.c + echo 'int main() {}' > a.c emcc a.c emcc -s BINARYEN=1 a.c echo -e "#include \n void hello(){ std::cout << std::endl; }" > a.cpp @@ -41,11 +38,11 @@ main() { rm -f a.* # Make emsdk usable by any user - chmod a+rw -R /emsdk-portable/ - find /emsdk-portable/ -executable -print0 | xargs -0 chmod a+x + chmod a+rwX -R "${EMSDK}" - # Clean up - apt-get purge --auto-remove -y ${purge_list[@]} + if (( ${#purge_list[@]} )); then + apt-get purge --auto-remove -y ${purge_list[@]} + fi rm $0 } diff --git a/docker/freebsd.sh b/docker/freebsd.sh index ef72fc38f..f711a3003 100755 --- a/docker/freebsd.sh +++ b/docker/freebsd.sh @@ -107,7 +107,9 @@ main() { # clean up popd - apt-get purge --auto-remove -y ${purge_list[@]} + if (( ${#purge_list[@]} )); then + apt-get purge --auto-remove -y ${purge_list[@]} + fi rm -rf $td rm $0 diff --git a/docker/linux-image.sh b/docker/linux-image.sh index 7aedd4f24..bfcff709b 100755 --- a/docker/linux-image.sh +++ b/docker/linux-image.sh @@ -54,7 +54,7 @@ main() { # there is no stable port arch=ppc64 # https://packages.debian.org/en/sid/linux-image-powerpc64 - kernel=5.3.0-2-powerpc64 + kernel=5.4.0-1-powerpc64 debsource="deb http://ftp.ports.debian.org/debian-ports unreleased main" debsource="$debsource\ndeb http://ftp.ports.debian.org/debian-ports unstable main" # sid version of dropbear requires these dependencies @@ -71,7 +71,7 @@ main() { sparc64) # there is no stable port # https://packages.debian.org/en/sid/linux-image-sparc64 - kernel=5.3.0-2-sparc64 + kernel=5.4.0-1-sparc64 debsource="deb http://ftp.ports.debian.org/debian-ports unreleased main" debsource="$debsource\ndeb http://ftp.ports.debian.org/debian-ports unstable main" # sid version of dropbear requires these dependencies @@ -248,7 +248,11 @@ EOF # can fail if arch is used (amd64 and/or i386) dpkg --remove-architecture $arch || true apt-get update - apt-get purge --auto-remove -y ${purge_list[@]} + + if (( ${#purge_list[@]} )); then + apt-get purge --auto-remove -y ${purge_list[@]} + fi + ls -lh /qemu } diff --git a/docker/mingw.sh b/docker/mingw.sh index 777d80734..15569c14d 100644 --- a/docker/mingw.sh +++ b/docker/mingw.sh @@ -18,16 +18,15 @@ main() { $(apt-cache showsrc gcc-mingw-w64-i686 | grep Build | cut -d: -f2 | tr , '\n' | cut -d' ' -f2 | sort | uniq) ) + apt-get update local purge_list=() for dep in ${dependencies[@]}; do if ! dpkg -L $dep > /dev/null; then + apt-get install -y --no-install-recommends $dep purge_list+=( $dep ) fi done - apt-get update - apt-get install -y --no-install-recommends ${purge_list[@]} - pushd $td apt-get source gcc-mingw-w64-i686 @@ -118,8 +117,9 @@ EOF # Replace installed mingw packages with the new ones dpkg -i ../g*-mingw-w64-i686*.deb ../gcc-mingw-w64-base*.deb - # Clean up - apt-get purge --auto-remove -y ${purge_list[@]} + if (( ${#purge_list[@]} )); then + apt-get purge --auto-remove -y ${purge_list[@]} + fi popd diff --git a/docker/musl.sh b/docker/musl.sh index 73deaa9b3..f900d9c85 100755 --- a/docker/musl.sh +++ b/docker/musl.sh @@ -48,8 +48,9 @@ main() { OUTPUT=/usr/local/ \ "$@" - # clean up - apt-get purge --auto-remove -y ${purge_list[@]} + if (( ${#purge_list[@]} )); then + apt-get purge --auto-remove -y ${purge_list[@]} + fi popd diff --git a/docker/netbsd.sh b/docker/netbsd.sh index 5ba291892..31894626b 100755 --- a/docker/netbsd.sh +++ b/docker/netbsd.sh @@ -111,7 +111,9 @@ main() { # clean up popd - apt-get purge --auto-remove -y ${purge_list[@]} + if (( ${#purge_list[@]} )); then + apt-get purge --auto-remove -y ${purge_list[@]} + fi rm -rf $td rm $0 diff --git a/docker/qemu.sh b/docker/qemu.sh index 69f3dac5d..c8b3984a8 100755 --- a/docker/qemu.sh +++ b/docker/qemu.sh @@ -88,8 +88,9 @@ main() { # in /usr/bin. Create an appropriate symlink ln -s /usr/local/bin/qemu-$arch /usr/bin/qemu-$arch-static - # Clean up - apt-get purge --auto-remove -y ${purge_list[@]} + if (( ${#purge_list[@]} )); then + apt-get purge --auto-remove -y ${purge_list[@]} + fi popd diff --git a/docker/solaris.sh b/docker/solaris.sh index bb521a64c..75afa5086 100755 --- a/docker/solaris.sh +++ b/docker/solaris.sh @@ -133,7 +133,9 @@ EOF # clean up popd - apt-get purge --auto-remove -y ${purge_list[@]} + if (( ${#purge_list[@]} )); then + apt-get purge --auto-remove -y ${purge_list[@]} + fi rm -rf $td rm $0 diff --git a/docker/xargo.sh b/docker/xargo.sh index 9717c581a..6d631122a 100755 --- a/docker/xargo.sh +++ b/docker/xargo.sh @@ -29,7 +29,10 @@ main() { rm -r "${RUSTUP_HOME}" "${CARGO_HOME}" - apt-get purge --auto-remove -y ${purge_list[@]} + if (( ${#purge_list[@]} )); then + apt-get purge --auto-remove -y ${purge_list[@]} + fi + rm $0 }