Skip to content

Commit cd3fdaf

Browse files
committed
testing: move to new posborne/rust-cross images
The rust-cross image is no longer all-in-one but broken out by architecture class (or platform in the case of android). Signed-off-by: Paul Osborne <[email protected]>
1 parent b69558c commit cd3fdaf

File tree

3 files changed

+31
-42
lines changed

3 files changed

+31
-42
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ preadv_pwritev = []
2020
signalfd = []
2121

2222
[dependencies]
23-
libc = "0.2.8"
23+
libc = { git = "https://github.com/rust-lang/libc.git" }
2424
bitflags = "0.4"
2525
cfg-if = "0.1.0"
2626

ci/run-all.sh

Lines changed: 15 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -6,49 +6,23 @@
66

77
set -e
88

9-
RUST_VERSIONS=${RUST_VERSIONS:-"\
10-
1.6.0 \
11-
1.7.0 \
12-
beta \
13-
nightly"}
14-
15-
# Disabled (not working presently) but with some support in the target
16-
# image:
17-
# - i686-apple-darwin
18-
# - x86_64-apple-darwin
19-
20-
RUST_TARGETS=${RUST_TARGETS:-"\
21-
aarch64-unknown-linux-gnu \
22-
arm-linux-androideabi \
23-
arm-unknown-linux-gnueabi \
24-
arm-unknown-linux-gnueabihf \
25-
i686-unknown-linux-gnu \
26-
mips-unknown-linux-gnu \
27-
mipsel-unknown-linux-gnu \
28-
x86_64-unknown-linux-gnu \
29-
x86_64-unknown-linux-musl"}
30-
31-
DOCKER_IMAGE=${DOCKER_IMAGE:-"posborne/rust-cross"}
32-
339
BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
10+
RUN_DOCKER="${BASE_DIR}/ci/run-docker.sh"
11+
12+
export RUST_VERSION=1.7.0
3413

35-
test_nix() {
36-
version=$1
37-
target=$2
14+
export DOCKER_IMAGE=posborne/rust-cross:base
15+
RUST_TARGET=x86_64-unknown-linux-gnu ${RUN_DOCKER}
16+
RUST_TARGET=x86_64-unknown-linux-musl ${RUN_DOCKER}
3817

39-
docker run -i -t \
40-
-v ${BASE_DIR}:/source \
41-
-e CARGO_TARGET_DIR=/build \
42-
${DOCKER_IMAGE} \
43-
/source/ci/run.sh ${version} ${target}
44-
}
18+
export DOCKER_IMAGE=posborne/rust-cross:arm
19+
RUST_TARGET=aarch64-unknown-linux-gnu ${RUN_DOCKER}
20+
RUST_TARGET=arm-linux-gnueabi test_nix ${RUN_DOCKER}
21+
RUST_TARGET=arm-linux-gnueabihf test_nix ${RUN_DOCKER}
4522

46-
# Ensure up to date (short compared to everything else)
47-
docker pull ${DOCKER_IMAGE}
23+
export DOCKER_IMAGE=posborne/rust-cross:mips
24+
RUST_TARGET=mips-unknown-linux-gnu test_nix ${RUN_DOCKER}
25+
RUST_TARGET=mipsel-unknown-linux-gnu test_nix ${RUN_DOCKER}
4826

49-
# Run tests for each version/target combination
50-
for version in ${RUST_VERSIONS}; do
51-
for target in ${RUST_TARGETS}; do
52-
test_nix $version $target || true
53-
done
54-
done
27+
export DOCKER_IMAGE=posborne/rust-cross:android ${RUN_DOCKER}
28+
RUST_TARGET=arm-linux-androideabi test_nix ${RUN_DOCKER}

ci/run-docker.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
#
3+
# Run the nix tests in a docker container. This script expects the following
4+
# environment variables to be set:
5+
# - DOCKER_IMAGE : Docker image to use for testing (e.g. posborne/rust-cross:arm)
6+
# - RUST_VERSION : Rust Version to test against (e.g. 1.7.0)
7+
# - RUST_TARGET : Target Triple to test
8+
9+
BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
10+
11+
docker run -i -t \
12+
-v ${BASE_DIR}:/source \
13+
-e CARGO_TARGET_DIR=/build \
14+
${DOCKER_IMAGE} \
15+
/source/ci/run.sh ${RUST_VERSION} ${RUST_TARGET}

0 commit comments

Comments
 (0)