Skip to content

Commit e9affc0

Browse files
Merge #361
361: Update CMake. r=Dylan-DPC a=reitermarkus Also add `curl` to all images. Closes #350. Co-authored-by: Markus Reiter <me@reitermark.us>
2 parents 105a4ae + 81bb1b5 commit e9affc0

File tree

61 files changed

+245
-106
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+245
-106
lines changed

azure-pipelines.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ strategy:
2222
aarch64-unknown-linux-gnu: { TARGET: aarch64-unknown-linux-gnu, CPP: 1, DYLIB: 1, STD: 1, RUN: 1, RUNNERS: qemu-user qemu-system }
2323
arm-unknown-linux-gnueabi: { TARGET: arm-unknown-linux-gnueabi, CPP: 1, DYLIB: 1, STD: 1, RUN: 1 }
2424
arm-unknown-linux-gnueabihf: { TARGET: arm-unknown-linux-gnueabihf, CPP: 1, DYLIB: 1, STD: 1, RUN: 1 }
25-
armv7-unknown-linux-gnueabihf: { TARGET: armv7-unknown-linux-gnueabihf, CPP: 1, DYLIB: 1, STD: 1, RUN: 1, RUNNERS: qemu-user qemu-system }
25+
armv7-unknown-linux-gnueabihf: { TARGET: armv7-unknown-linux-gnueabihf, CPP: 1, DYLIB: 1, STD: 1, RUN: 1, RUNNERS: qemu-user qemu-system }
2626
i586-unknown-linux-gnu: { TARGET: i586-unknown-linux-gnu, CPP: 1, DYLIB: 1, STD: 1, RUN: 1 }
27-
i686-unknown-linux-gnu: { TARGET: i686-unknown-linux-gnu, CPP: 1, DYLIB: 1, STD: 1, RUN: 1, RUNNERS: native qemu-user qemu-system }
27+
i686-unknown-linux-gnu: { TARGET: i686-unknown-linux-gnu, CPP: 1, DYLIB: 1, STD: 1, RUN: 1, RUNNERS: native qemu-user qemu-system }
2828
mips-unknown-linux-gnu: { TARGET: mips-unknown-linux-gnu, CPP: 1, DYLIB: 1, STD: 1, RUN: 1, RUNNERS: qemu-user qemu-system }
2929
mipsel-unknown-linux-gnu: { TARGET: mipsel-unknown-linux-gnu, CPP: 1, DYLIB: 1, STD: 1, RUN: 1, RUNNERS: qemu-user qemu-system }
3030
mips64-unknown-linux-gnuabi64: { TARGET: mips64-unknown-linux-gnuabi64, CPP: 1, DYLIB: 1, STD: 1, RUN: 1 }
@@ -61,9 +61,9 @@ strategy:
6161
x86_64-unknown-netbsd: { TARGET: x86_64-unknown-netbsd, CPP: 1, DYLIB: 1, STD: 1 }
6262
sparcv9-sun-solaris: { TARGET: sparcv9-sun-solaris, CPP: 1, DYLIB: 1, STD: 1 }
6363
x86_64-sun-solaris: { TARGET: x86_64-sun-solaris, CPP: 1, DYLIB: 1, STD: 1 }
64-
asmjs-unknown-emscripten: { TARGET: asmjs-unknown-emscripten, CPP: 1, STD: 1, RUN: 1 }
64+
asmjs-unknown-emscripten: { TARGET: asmjs-unknown-emscripten, STD: 1, RUN: 1 }
6565
# `cargo run` fails with an assertion error (https://github.com/rust-lang/cargo/issues/4689) on `wasm32-unknown-emscripten`.
66-
wasm32-unknown-emscripten: { TARGET: wasm32-unknown-emscripten, CPP: 1, STD: 1 }
66+
wasm32-unknown-emscripten: { TARGET: wasm32-unknown-emscripten, STD: 1 }
6767
thumbv6m-none-eabi: { TARGET: thumbv6m-none-eabi, STD: 1 }
6868
thumbv7em-none-eabi: { TARGET: thumbv7em-none-eabi, STD: 1 }
6969
thumbv7em-none-eabihf: { TARGET: thumbv7em-none-eabihf, STD: 1 }

build-docker-image.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ run() {
99
local dockerfile="Dockerfile.${1}"
1010
local image_name="rustembedded/cross:${1}"
1111

12+
local cache_from_args=()
13+
1214
if docker pull "${image_name}"; then
13-
local cache_from_args=(--cache-from "${image_name}")
15+
cache_from_args=(--cache-from "${image_name}")
1416
fi
1517

1618
docker build ${cache_from_args[@]} --pull -t "${image_name}" -f "${dockerfile}" .
@@ -23,10 +25,12 @@ run() {
2325
fi
2426
}
2527

26-
if [ -z "${1}" ]; then
28+
if [ -z "${@:-}" ]; then
2729
for t in Dockerfile.*; do
2830
run "${t##Dockerfile.}"
2931
done
3032
else
31-
run "${1}"
33+
for image in "${@}"; do
34+
run "${image}"
35+
done
3236
fi

ci/test.sh

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,17 @@ main() {
4141

4242
export QEMU_STRACE=1
4343

44-
# test `cross check`
45-
if [[ ! -z ${STD:-} ]]; then
44+
if (( ${STD:-0} )); then
45+
# test `cross check`
4646
td=$(mktemp -d)
4747
cargo init --lib --name foo $td
4848
pushd $td
4949
echo '#![no_std]' > src/lib.rs
5050
cross check --target $TARGET
5151
popd
5252
rm -rf $td
53-
fi
54-
55-
# `cross build` test for targets where `std` is not available
56-
if [[ -z "${STD:-}" ]]; then
53+
else
54+
# `cross build` test for targets where `std` is not available
5755
td=$(mktemp -d)
5856

5957
git clone \
@@ -99,9 +97,9 @@ EOF
9997
rm -rf $td
10098
fi
10199

102-
if [[ ${RUN:-} ]]; then
100+
if (( ${RUN:-0} )); then
103101
# `cross test` test
104-
if [[ ${DYLIB:-} ]]; then
102+
if (( ${DYLIB:-0} )); then
105103
td=$(mktemp -d)
106104

107105
pushd $td
@@ -151,15 +149,15 @@ EOF
151149
fi
152150

153151
# Test C++ support
154-
if [[ ${CPP:-} ]]; then
152+
if (( ${CPP:-0} )); then
155153
td=$(mktemp -d)
156154

157155
git clone --depth 1 https://github.com/japaric/hellopp $td
158156

159157
pushd $td
160158
cargo update -p gcc
161159
retry cargo fetch
162-
if [[ ${RUN:-} ]]; then
160+
if (( ${RUN:-0} )); then
163161
cross_run --target $TARGET
164162
else
165163
cross build --target $TARGET

docker/Dockerfile.aarch64-linux-android

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ FROM ubuntu:16.04
33
COPY common.sh /
44
RUN /common.sh
55

6+
COPY cmake.sh /
7+
RUN /cmake.sh
8+
69
COPY xargo.sh /
710
RUN /xargo.sh
811

docker/Dockerfile.aarch64-unknown-linux-gnu

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@ FROM ubuntu:16.04
33
COPY common.sh /
44
RUN /common.sh
55

6+
COPY cmake.sh /
7+
RUN /cmake.sh
8+
69
COPY xargo.sh /
710
RUN /xargo.sh
811

9-
COPY cmake.sh /
10-
RUN apt-get purge --auto-remove -y cmake && \
11-
/cmake.sh
12-
1312
RUN apt-get install -y --no-install-recommends \
1413
g++-aarch64-linux-gnu \
1514
libc6-dev-arm64-cross

docker/Dockerfile.aarch64-unknown-linux-musl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ FROM ubuntu:18.04
33
COPY common.sh /
44
RUN /common.sh
55

6+
COPY cmake.sh /
7+
RUN /cmake.sh
8+
69
COPY xargo.sh /
710
RUN /xargo.sh
811

docker/Dockerfile.arm-linux-androideabi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ FROM ubuntu:16.04
33
COPY common.sh /
44
RUN /common.sh
55

6+
COPY cmake.sh /
7+
RUN /cmake.sh
8+
69
COPY xargo.sh /
710
RUN /xargo.sh
811

docker/Dockerfile.arm-unknown-linux-gnueabi

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@ FROM ubuntu:16.04
33
COPY common.sh /
44
RUN /common.sh
55

6+
COPY cmake.sh /
7+
RUN /cmake.sh
8+
69
COPY xargo.sh /
710
RUN /xargo.sh
811

9-
COPY cmake.sh /
10-
RUN apt-get purge --auto-remove -y cmake && \
11-
/cmake.sh
12-
1312
COPY qemu.sh /
1413
RUN apt-get install -y --no-install-recommends \
1514
g++-arm-linux-gnueabi \

docker/Dockerfile.arm-unknown-linux-gnueabihf

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@ FROM ubuntu:16.04
33
COPY common.sh /
44
RUN /common.sh
55

6+
COPY cmake.sh /
7+
RUN /cmake.sh
8+
69
COPY xargo.sh /
710
RUN /xargo.sh
811

9-
COPY cmake.sh /
10-
RUN apt-get purge --auto-remove -y cmake && \
11-
/cmake.sh
12-
1312
RUN mkdir /usr/arm-linux-gnueabihf && \
1413
apt-get install -y --no-install-recommends curl xz-utils && \
1514
cd /usr/arm-linux-gnueabihf && \
16-
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 | \
15+
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 | \
1716
tar --strip-components 1 -xJ && \
1817
apt-get purge --auto-remove -y curl xz-utils
1918

docker/Dockerfile.arm-unknown-linux-musleabi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ FROM ubuntu:18.04
33
COPY common.sh /
44
RUN /common.sh
55

6+
COPY cmake.sh /
7+
RUN /cmake.sh
8+
69
COPY xargo.sh /
710
RUN /xargo.sh
811

0 commit comments

Comments
 (0)