Skip to content

Commit 2995f55

Browse files
committed
Use the standard android slave docker image
1 parent d5c4e55 commit 2995f55

File tree

6 files changed

+23
-107
lines changed

6 files changed

+23
-107
lines changed

ci/Dockerfile-android

Lines changed: 0 additions & 68 deletions
This file was deleted.

ci/README.md

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,6 @@ this project.
88

99
First up, let's talk about the files in this directory:
1010

11-
* `Dockerfile-android`, `android-accept-licenses.sh` -- these two files are
12-
used to build the Docker image that the android CI builder uses. The
13-
`Dockerfile` just installs the Android SDK, NDK, a Rust nightly, Rust target
14-
libraries for Android, and sets up an emulator to run tests in. You can build
15-
a new image with this command (from the root of the project):
16-
17-
docker build -t alexcrichton/rust-libc-test -f ci/Dockerfile-android .
18-
19-
When building a new image contact @alexcrichton to push it to the docker hub
20-
and have libc start using it. This hasn't needed to happen yet, so the process
21-
may be a little involved.
22-
23-
The script here, `android-accept-licenses.sh` is just a helper used to accept
24-
the licenses of the SDK of Android while the docker image is being created.
25-
2611
* `msys2.ps1` - a PowerShell script which is used to install MSYS2 on the
2712
AppVeyor bots. As of this writing MSYS2 isn't installed by default, and this
2813
script will install the right version/arch of msys2 in preparation of using
@@ -67,16 +52,17 @@ builds are run on stable/beta/nightly, but are the only ones that do so.
6752

6853
The remaining architectures look like:
6954

70-
* Android runs in a docker image with an emulator, the NDK, and the SDK already
71-
set up (see `Dockerfile-android`). The entire build happens within the docker
72-
image.
55+
* Android runs in a [docker image][android-docker] with an emulator, the NDK,
56+
and the SDK already set up. The entire build happens within the docker image.
7357
* The MIPS, ARM, and AArch64 builds all use QEMU to run the generated binary to
7458
actually verify the tests pass.
7559
* The MUSL build just has to download a MUSL compiler and target libraries and
7660
then otherwise runs tests normally.
7761
* iOS builds need an extra linker flag currently, but beyond that they're built
7862
as standard as everything else.
7963

64+
[android-docker]: https://github.com/rust-lang/rust-buildbot/blob/master/slaves/android/Dockerfile
65+
8066
Hopefully that's at least somewhat of an introduction to everything going on
8167
here, and feel free to ping @alexcrichton with questions!
8268

ci/android-accept-licenses.sh

Lines changed: 0 additions & 14 deletions
This file was deleted.

ci/run-travis.sh

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,23 @@ esac
4646

4747
case "$TARGET" in
4848
# Pull a pre-built docker image for testing android, then run tests entirely
49-
#d within that image.
49+
# within that image. Note that this is using the same rustc installation that
50+
# travis has (sharing it via `-v`) and otherwise the tests run entirely within
51+
# the container.
5052
arm-linux-androideabi)
51-
docker pull alexcrichton/rust-libc-test
52-
exec docker run -v `pwd`:/clone -t alexcrichton/rust-libc-test \
53-
sh ci/run.sh $TARGET
53+
script="
54+
cp -r /checkout/* .
55+
mkdir .cargo
56+
cp ci/cargo-config .cargo/config
57+
sh ci/run.sh $TARGET
58+
"
59+
exec docker run \
60+
--entrypoint bash \
61+
-v $HOME/rust:/usr/local:ro \
62+
-v `pwd`:/checkout:ro \
63+
-e LD_LIBRARY_PATH=/usr/local/lib \
64+
-it alexcrichton/rust-slave-android:2015-10-21 \
65+
-c "$script"
5466
;;
5567

5668
x86_64-unknown-linux-musl)

ci/run.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ esac
1919

2020
case "$TARGET" in
2121
arm-linux-androideabi)
22-
emulator @test -no-window &
22+
emulator @arm-18 -no-window &
2323
adb wait-for-device
24-
adb push /root/target/$TARGET/debug/libc-test /data/libc-test
24+
adb push libc-test/target/$TARGET/debug/libc-test /data/libc-test
2525
adb shell /data/libc-test
2626
;;
2727

src/unix/notbsd/android/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ extern {
200200
flags: ::c_int) -> ::c_int;
201201
pub fn mprotect(addr: *const ::c_void, len: ::size_t, prot: ::c_int)
202202
-> ::c_int;
203-
pub fn sysconf(name: ::c_int) -> ::c_int;
203+
pub fn sysconf(name: ::c_int) -> ::c_long;
204204
pub fn usleep(secs: ::c_ulong) -> ::c_int;
205205
pub fn recvfrom(socket: ::c_int, buf: *mut ::c_void, len: ::size_t,
206206
flags: ::c_uint, addr: *const ::sockaddr,

0 commit comments

Comments
 (0)