Skip to content

Commit

Permalink
Try #361:
Browse files Browse the repository at this point in the history
  • Loading branch information
bors[bot] authored Jan 1, 2020
2 parents 105a4ae + 81bb1b5 commit cd9f053
Show file tree
Hide file tree
Showing 61 changed files with 245 additions and 106 deletions.
8 changes: 4 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down Expand Up @@ -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 }
Expand Down
10 changes: 7 additions & 3 deletions build-docker-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}" .
Expand All @@ -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
18 changes: 8 additions & 10 deletions ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,17 @@ 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
echo '#![no_std]' > src/lib.rs
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 \
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -151,15 +149,15 @@ 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

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
Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile.aarch64-linux-android
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 3 additions & 4 deletions docker/Dockerfile.aarch64-unknown-linux-gnu
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile.aarch64-unknown-linux-musl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile.arm-linux-androideabi
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 3 additions & 4 deletions docker/Dockerfile.arm-unknown-linux-gnueabi
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
9 changes: 4 additions & 5 deletions docker/Dockerfile.arm-unknown-linux-gnueabihf
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile.arm-unknown-linux-musleabi
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile.arm-unknown-linux-musleabihf
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile.armv5te-unknown-linux-musleabi
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile.armv7-linux-androideabi
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 3 additions & 4 deletions docker/Dockerfile.armv7-unknown-linux-gnueabihf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile.armv7-unknown-linux-musleabihf
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
29 changes: 24 additions & 5 deletions docker/Dockerfile.asmjs-unknown-emscripten
Original file line number Diff line number Diff line change
Expand Up @@ -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'
3 changes: 3 additions & 0 deletions docker/Dockerfile.i586-unknown-linux-gnu
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile.i586-unknown-linux-musl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile.i686-linux-android
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 3 additions & 4 deletions docker/Dockerfile.i686-unknown-linux-gnu
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile.i686-unknown-linux-musl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile.mips-unknown-linux-gnu
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile.mips-unknown-linux-musl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile.mips64-unknown-linux-gnuabi64
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions docker/Dockerfile.mips64el-unknown-linux-gnuabi64
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading

0 comments on commit cd9f053

Please sign in to comment.