Skip to content

Commit f33efca

Browse files
committed
Try to fix s390x test
1 parent 5772e9c commit f33efca

File tree

5 files changed

+15
-86
lines changed

5 files changed

+15
-86
lines changed

.travis.yml

Lines changed: 0 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -29,80 +29,7 @@ env:
2929
secure: "e2/3QjgRN9atOuSHp22TrYG7QVKcYUWY48Hi9b60w+r1+BhPkTseIJLte7WefRhdXtqpjjUJTooKDhnurFOeHaCT+nmBgiv+FPU893sBl4bhesY4m0vgUJVbNZcs6lTImYekWVb+aqjGdgV/XAgCw7c3kPmrZV0MzGDWL64Xaps="
3030
matrix:
3131
include:
32-
# 1.0.0 compat
33-
- env: TARGET=x86_64-unknown-linux-gnu NO_ADD=1
34-
rust: 1.0.0
35-
script: rm -f Cargo.lock && cargo build
36-
install:
37-
38-
# build documentation
39-
- env: TARGET=x86_64-unknown-linux-gnu NO_ADD=1
40-
rust: nightly
41-
script: sh ci/dox.sh
42-
43-
# stable compat
44-
- env: TARGET=x86_64-unknown-linux-gnu NO_ADD=1
45-
- env: TARGET=i686-unknown-linux-gnu
46-
- os: osx
47-
env: TARGET=x86_64-apple-darwin NO_ADD=1
48-
osx_image: xcode8.3
49-
- os: osx
50-
env: TARGET=i686-apple-darwin
51-
osx_image: xcode8.3
52-
- env: TARGET=arm-linux-androideabi
53-
- env: TARGET=aarch64-linux-android
54-
- env: TARGET=i686-linux-android
55-
- env: TARGET=x86_64-linux-android
56-
- env: TARGET=x86_64-unknown-linux-musl
57-
- env: TARGET=i686-unknown-linux-musl
58-
- env: TARGET=arm-unknown-linux-gnueabihf
59-
- env: TARGET=arm-unknown-linux-musleabihf
60-
- env: TARGET=aarch64-unknown-linux-gnu
61-
- env: TARGET=aarch64-unknown-linux-musl
62-
rust: beta
63-
- os: osx
64-
osx_image: xcode8.2
65-
env: TARGET=i386-apple-ios
66-
CARGO_TARGET_I386_APPLE_IOS_RUNNER=$HOME/runtest
67-
RUSTFLAGS=-Clink-arg=-mios-simulator-version-min=7.0
68-
before_install:
69-
rustc ./ci/ios/deploy_and_run_on_ios_simulator.rs -o $HOME/runtest
70-
- os: osx
71-
osx_image: xcode8.2
72-
env: TARGET=x86_64-apple-ios
73-
CARGO_TARGET_X86_64_APPLE_IOS_RUNNER=$HOME/runtest
74-
RUSTFLAGS=-Clink-arg=-mios-simulator-version-min=7.0
75-
before_install:
76-
rustc ./ci/ios/deploy_and_run_on_ios_simulator.rs -o $HOME/runtest
77-
- env: TARGET=x86_64-rumprun-netbsd
78-
- env: TARGET=powerpc-unknown-linux-gnu
79-
- env: TARGET=powerpc64-unknown-linux-gnu
80-
- env: TARGET=mips-unknown-linux-musl
81-
- env: TARGET=mipsel-unknown-linux-musl
82-
- env: TARGET=mips64-unknown-linux-gnuabi64
83-
- env: TARGET=mips-unknown-linux-gnu
8432
- env: TARGET=s390x-unknown-linux-gnu
85-
- env: TARGET=asmjs-unknown-emscripten
86-
- env: TARGET=wasm32-unknown-emscripten
87-
88-
# beta
89-
- env: TARGET=x86_64-unknown-linux-gnu NO_ADD=1
90-
rust: beta
91-
- os: osx
92-
env: TARGET=x86_64-apple-darwin NO_ADD=1
93-
osx_image: xcode8.3
94-
rust: beta
95-
96-
# nightly
97-
- env: TARGET=x86_64-unknown-linux-gnu NO_ADD=1
98-
rust: nightly
99-
- os: osx
100-
env: TARGET=x86_64-apple-darwin NO_ADD=1
101-
osx_image: xcode8.3
102-
rust: nightly
103-
104-
# QEMU based targets that compile in an emulator
105-
- env: TARGET=x86_64-unknown-freebsd
10633

10734
notifications:
10835
email:

ci/docker/s390x-unknown-linux-gnu/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,17 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
55
gcc libc6-dev \
66
gcc-s390x-linux-gnu libc6-dev-s390x-cross \
77
debian-archive-keyring debootstrap cpio \
8-
binfmt-support qemu-user-static qemu-system-s390x \
9-
sshpass openssh-client
8+
qemu-system-s390x \
9+
sshpass openssh-client \
10+
sudo
1011

1112
COPY linux-image.sh /
12-
RUN bash linux-image.sh "" s390x stretch
1313

1414
RUN cd / && curl -LO https://github.com/qemu/qemu/raw/master/pc-bios/s390-ccw.img
1515

1616
ARG USERID
1717
RUN adduser --uid $USERID --disabled-login --gecos cross cross
18+
RUN echo "cross ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/cross
1819

1920
COPY test-runner-s390x /
2021
ENV CARGO_TARGET_S390X_UNKNOWN_LINUX_GNU_LINKER=s390x-linux-gnu-gcc \

ci/linux-image.sh

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,7 @@ qemu-debootstrap \
1616
$params \
1717
$suite \
1818
$dest \
19-
$mirror || true
20-
21-
# HACK: debootstrap calls mount, but mount cannot be executed inside a docker
22-
# container, so qemu-debootstrap fails. We replace mount with true and continue
23-
# the bootstrap process. We restore mount after the bootstrap.
24-
rm -f $dest/var/lib/dpkg/status
25-
mv $dest/bin/mount /mount.bak
26-
cp $dest/bin/true $dest/bin/mount
27-
chroot $dest /debootstrap/debootstrap --second-stage || cat $dest//debootstrap/debootstrap.log && false
28-
mv -f /mount.bak $dest/bin/mount
19+
$mirror || cat $dest/debootstrap/debootstrap.log && false
2920

3021
# ssh
3122
chroot $dest adduser --disabled-password --gecos "" cross

ci/run-docker.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ run() {
1313
fi
1414
docker run \
1515
--user `id -u`:`id -g` \
16+
--privileged \
1617
--rm \
1718
--init \
1819
--volume $HOME/.cargo:/cargo \

ci/run.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,13 @@ if [ "$QEMU" != "" ]; then
6868
exec grep "^PASSED .* tests" $CARGO_TARGET_DIR/out.log
6969
fi
7070

71+
if [ "$TARGET" = "s390x-unknown-linux-gnu" ]; then
72+
sudo apt-get install -y --no-install-recommends binfmt-support
73+
sudo mount
74+
sudo mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc || true
75+
sudo apt-get install -y --no-install-recommends qemu-user-static
76+
sudo mount
77+
sudo bash /linux-image.sh "" s390x stretch
78+
fi
79+
7180
exec cargo test --manifest-path libc-test/Cargo.toml --target $TARGET

0 commit comments

Comments
 (0)