Skip to content

Commit 28a4967

Browse files
committed
Build qemu earlier in Dockerfile.
1 parent c3fe624 commit 28a4967

6 files changed

+27
-26
lines changed

docker/Dockerfile.aarch64-linux-android

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ RUN /cmake.sh
1010
COPY xargo.sh /
1111
RUN /xargo.sh
1212

13+
COPY qemu.sh /
14+
RUN /qemu.sh aarch64
15+
1316
ARG ANDROID_NDK=r21d
1417
ARG ANDROID_SDK=28
1518
ARG ANDROID_VERSION=9.0.0_r1
@@ -21,9 +24,6 @@ ENV PATH=$PATH:/android-ndk/bin
2124
COPY android-system.sh /
2225
RUN /android-system.sh arm64
2326

24-
COPY qemu.sh /
25-
RUN /qemu.sh aarch64
26-
2727
RUN cp /android-ndk/sysroot/usr/lib/aarch64-linux-android/$ANDROID_SDK/libz.so /system/lib/
2828

2929
COPY android-runner /

docker/Dockerfile.arm-linux-androideabi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ RUN /cmake.sh
1010
COPY xargo.sh /
1111
RUN /xargo.sh
1212

13+
COPY qemu.sh /
14+
RUN /qemu.sh arm
15+
1316
ARG ANDROID_NDK=r21d
1417
ARG ANDROID_SDK=28
1518
ARG ANDROID_VERSION=9.0.0_r1
@@ -21,9 +24,6 @@ ENV PATH=$PATH:/android-ndk/bin
2124
COPY android-system.sh /
2225
RUN /android-system.sh arm
2326

24-
COPY qemu.sh /
25-
RUN /qemu.sh arm
26-
2727
RUN cp /android-ndk/sysroot/usr/lib/arm-linux-androideabi/$ANDROID_SDK/libz.so /system/lib/
2828

2929
COPY android-runner /

docker/Dockerfile.armv7-linux-androideabi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ RUN /cmake.sh
1010
COPY xargo.sh /
1111
RUN /xargo.sh
1212

13+
COPY qemu.sh /
14+
RUN /qemu.sh arm
15+
1316
ARG ANDROID_NDK=r21d
1417
ARG ANDROID_SDK=28
1518
ARG ANDROID_VERSION=9.0.0_r1
@@ -21,9 +24,6 @@ ENV PATH=$PATH:/android-ndk/bin
2124
COPY android-system.sh /
2225
RUN /android-system.sh arm
2326

24-
COPY qemu.sh /
25-
RUN /qemu.sh arm
26-
2727
RUN cp /android-ndk/sysroot/usr/lib/arm-linux-androideabi/$ANDROID_SDK/libz.so /system/lib/
2828

2929
COPY android-runner /

docker/Dockerfile.i686-linux-android

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@ RUN /cmake.sh
1010
COPY xargo.sh /
1111
RUN /xargo.sh
1212

13+
# We could supposedly directly run i686 binaries like we do for x86_64, but
14+
# doing so generates an assertion failure:
15+
# ... assertion failed: signal(libc::SIGPIPE, libc::SIG_IGN) != libc::SIG_ERR
16+
# ... src/libstd/sys/unix/mod.rs
17+
# fatal runtime error: failed to initiate panic, error 5
18+
#
19+
# Running with qemu works as expected. it also ensures that're we're
20+
# running on a CPU common 32-bit x86 systems.
21+
COPY qemu.sh /
22+
RUN /qemu.sh i386
23+
1324
ARG ANDROID_NDK=r21d
1425
ARG ANDROID_SDK=28
1526
ARG ANDROID_VERSION=9.0.0_r1
@@ -21,16 +32,6 @@ ENV PATH=$PATH:/android-ndk/bin
2132
COPY android-system.sh /
2233
RUN /android-system.sh x86
2334

24-
# We could supposedly directly run i686 binaries like we do for x86_64, but
25-
# doing so generates an assertion failure:
26-
# ... assertion failed: signal(libc::SIGPIPE, libc::SIG_IGN) != libc::SIG_ERR
27-
# ... src/libstd/sys/unix/mod.rs
28-
# fatal runtime error: failed to initiate panic, error 5
29-
#
30-
# Running with qemu works as expected
31-
COPY qemu.sh /
32-
RUN /qemu.sh i386
33-
3435
RUN cp /android-ndk/sysroot/usr/lib/i686-linux-android/$ANDROID_SDK/libz.so /system/lib/
3536

3637
COPY android-runner /

docker/Dockerfile.thumbv7neon-linux-androideabi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ RUN /cmake.sh
1010
COPY xargo.sh /
1111
RUN /xargo.sh
1212

13+
COPY qemu.sh /
14+
RUN /qemu.sh arm
15+
1316
ARG ANDROID_NDK=r21d
1417
ARG ANDROID_SDK=28
1518
ARG ANDROID_VERSION=9.0.0_r1
@@ -21,9 +24,6 @@ ENV PATH=$PATH:/android-ndk/bin
2124
COPY android-system.sh /
2225
RUN /android-system.sh arm
2326

24-
COPY qemu.sh /
25-
RUN /qemu.sh arm
26-
2727
RUN cp /android-ndk/sysroot/usr/lib/arm-linux-androideabi/$ANDROID_SDK/libz.so /system/lib/
2828

2929
COPY android-runner /

docker/Dockerfile.x86_64-linux-android

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ RUN /cmake.sh
1010
COPY xargo.sh /
1111
RUN /xargo.sh
1212

13+
# Using qemu allows older host cpus (without sse4) to execute the target binaries
14+
COPY qemu.sh /
15+
RUN /qemu.sh x86_64
16+
1317
ARG ANDROID_NDK=r21d
1418
ARG ANDROID_SDK=28
1519
ARG ANDROID_VERSION=9.0.0_r1
@@ -21,10 +25,6 @@ ENV PATH=$PATH:/android-ndk/bin
2125
COPY android-system.sh /
2226
RUN /android-system.sh x86_64
2327

24-
# Using qemu allows older host cpus (without sse4) to execute the target binaries
25-
COPY qemu.sh /
26-
RUN /qemu.sh x86_64
27-
2828
RUN cp /android-ndk/sysroot/usr/lib/x86_64-linux-android/$ANDROID_SDK/libz.so /system/lib/
2929

3030
COPY android-runner /

0 commit comments

Comments
 (0)