Skip to content

Commit 926300a

Browse files
committed
Auto merge of #1927 - JohnTitor:android-ci, r=JohnTitor
Fix aarch64-linux-android target CI
2 parents 582c5cf + e228df9 commit 926300a

File tree

8 files changed

+22
-46
lines changed

8 files changed

+22
-46
lines changed

ci/android-install-ndk.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@
33
set -ex
44

55
NDK=android-ndk-r21d
6-
wget --tries=20 https://dl.google.com/android/repository/${NDK}-linux-x86_64.zip
6+
wget --tries=20 -q https://dl.google.com/android/repository/${NDK}-linux-x86_64.zip
77
unzip -q ${NDK}-linux-x86_64.zip
88

99
case "$1" in
1010
arm)
1111
arch=arm
12-
api=24
12+
api=28
1313
;;
1414
armv7)
1515
arch=arm
16-
api=24
16+
api=28
1717
;;
1818
aarch64)
1919
arch=arm64
20-
api=24
20+
api=28
2121
;;
2222
i686)
2323
arch=x86

ci/android-install-sdk.sh

+7-7
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ set -ex
99
# located in https://github.com/appunite/docker by just wrapping it in a script
1010
# which apparently magically accepts the licenses.
1111

12-
SDK=4333796
13-
mkdir sdk
14-
wget --tries=20 https://dl.google.com/android/repository/sdk-tools-linux-${SDK}.zip
15-
unzip -q -d sdk sdk-tools-linux-${SDK}.zip
12+
SDK=6609375
13+
mkdir -p sdk/cmdline-tools
14+
wget -q --tries=20 https://dl.google.com/android/repository/commandlinetools-linux-${SDK}_latest.zip
15+
unzip -q -d sdk/cmdline-tools commandlinetools-linux-${SDK}_latest.zip
1616

1717
case "$1" in
1818
arm | armv7)
@@ -51,14 +51,14 @@ echo '#Fri Nov 03 10:11:27 CET 2017 count=0' >> /root/.android/repositories.cfg
5151
#
5252
# | grep -v = || true removes the progress bar output from the sdkmanager
5353
# which produces an insane amount of output.
54-
yes | ./sdk/tools/bin/sdkmanager --licenses --no_https | grep -v = || true
55-
yes | ./sdk/tools/bin/sdkmanager --no_https \
54+
yes | ./sdk/cmdline-tools/tools/bin/sdkmanager --licenses --no_https | grep -v = || true
55+
yes | ./sdk/cmdline-tools/tools/bin/sdkmanager --no_https \
5656
"emulator" \
5757
"platform-tools" \
5858
"platforms;android-${api}" \
5959
"${image}" | grep -v = || true
6060

6161
echo "no" |
62-
./sdk/tools/bin/avdmanager create avd \
62+
./sdk/cmdline-tools/tools/bin/avdmanager create avd \
6363
--name "${1}" \
6464
--package "${image}" | grep -v = || true

ci/android-sysimage.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ main() {
1414
apt-get install --no-install-recommends e2tools
1515

1616
pushd "${td}"
17-
wget --tries=5 "${URL}/${name}"
17+
wget -q --tries=5 "${URL}/${name}"
1818
unzip -q "${name}"
1919

2020
local system

ci/docker/aarch64-linux-android/Dockerfile

+4-3
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,17 @@ WORKDIR /android/
1919
COPY android* /android/
2020

2121
ENV ANDROID_ARCH=aarch64
22-
ENV PATH=$PATH:/android/ndk-$ANDROID_ARCH/bin:/android/sdk/tools:/android/sdk/platform-tools
22+
ENV PATH=$PATH:/android/ndk-$ANDROID_ARCH/bin:/android/sdk/cmdline-tools/tools:/android/sdk/platform-tools
2323

2424
RUN sh /android/android-install-ndk.sh $ANDROID_ARCH
2525
RUN sh /android/android-install-sdk.sh $ANDROID_ARCH
2626
RUN mv /root/.android /tmp
2727
RUN chmod 777 -R /tmp/.android
28-
RUN chmod 755 /android/sdk/tools/* /android/sdk/emulator/qemu/linux-x86_64/*
28+
RUN chmod 755 /android/sdk/cmdline-tools/tools/* /android/sdk/emulator/qemu/linux-x86_64/*
29+
RUN ls -a /android/sdk/platform-tools
2930

3031
ENV PATH=$PATH:/rust/bin \
31-
CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=aarch64-linux-android-gcc \
32+
CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=aarch64-linux-android28-clang \
3233
CARGO_TARGET_AARCH64_LINUX_ANDROID_RUNNER=/tmp/runtest \
3334
HOME=/tmp
3435

ci/docker/arm-linux-androideabi/Dockerfile

+3-2
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@ WORKDIR /android/
1919
COPY android* /android/
2020

2121
ENV ANDROID_ARCH=arm
22-
ENV PATH=$PATH:/android/ndk-$ANDROID_ARCH/bin:/android/sdk/tools:/android/sdk/platform-tools
22+
ENV PATH=$PATH:/android/ndk-$ANDROID_ARCH/bin:/android/sdk/cmdline-tools/tools:/android/sdk/platform-tools
2323

2424
RUN sh /android/android-install-ndk.sh $ANDROID_ARCH
2525
RUN sh /android/android-install-sdk.sh $ANDROID_ARCH
2626
RUN mv /root/.android /tmp
2727
RUN chmod 777 -R /tmp/.android
28-
RUN chmod 755 /android/sdk/tools/* /android/sdk/emulator/qemu/linux-x86_64/*
28+
RUN chmod 755 /android/sdk/cmdline-tools/tools/* /android/sdk/emulator/qemu/linux-x86_64/*
29+
RUN ls -a /android/sdk/platform-tools
2930

3031
ENV PATH=$PATH:/rust/bin \
3132
CARGO_TARGET_ARM_LINUX_ANDROIDEABI_LINKER=arm-linux-androideabi-gcc \

ci/docker/i686-linux-android/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ WORKDIR /android/
2020
COPY android* /android/
2121

2222
ENV ANDROID_ARCH=i686
23-
ENV PATH=$PATH:/android/ndk-$ANDROID_ARCH/bin:/android/sdk/tools:/android/sdk/platform-tools
23+
ENV PATH=$PATH:/android/ndk-$ANDROID_ARCH/bin:/android/sdk/cmdline-tools/tools:/android/sdk/cmdline-tools/platform-tools
2424

2525
RUN sh /android/android-install-ndk.sh $ANDROID_ARCH
2626
RUN sh /android/android-install-sdk.sh $ANDROID_ARCH
2727
RUN mv /root/.android /tmp
2828
RUN chmod 777 -R /tmp/.android
29-
RUN chmod 755 /android/sdk/tools/* /android/sdk/emulator/qemu/linux-x86_64/*
29+
RUN chmod 755 /android/sdk/cmdline-tools/tools/* /android/sdk/emulator/qemu/linux-x86_64/*
3030

3131
ENV PATH=$PATH:/rust/bin \
3232
CARGO_TARGET_I686_LINUX_ANDROID_LINKER=i686-linux-android-gcc \

libc-test/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ path = ".."
99
default-features = false
1010

1111
[build-dependencies]
12-
cc = "1.0"
12+
cc = "=1.0.52"
1313
# FIXME: Use fork ctest until the maintainer gets back.
1414
ctest2 = "0.3"
1515

libc-test/build.rs

-26
Original file line numberDiff line numberDiff line change
@@ -1370,7 +1370,6 @@ fn test_android(target: &str) {
13701370
t => panic!("unsupported target: {}", t),
13711371
};
13721372
let x86 = target.contains("i686") || target.contains("x86_64");
1373-
let aarch64 = target.contains("aarch64");
13741373

13751374
let mut cfg = ctest_cfg();
13761375
cfg.define("_GNU_SOURCE", None);
@@ -1592,31 +1591,6 @@ fn test_android(target: &str) {
15921591
// test the XSI version below.
15931592
"strerror_r" => true,
15941593

1595-
// FIXME: Somehow we cannot find these fns on aarch64.
1596-
// https://github.com/rust-lang/libc/issues/1765
1597-
"lockf"
1598-
| "preadv64"
1599-
| "pwritev64"
1600-
| "openpty"
1601-
| "forkpty"
1602-
| "login_tty"
1603-
| "getifaddrs"
1604-
| "freeifaddrs"
1605-
| "sethostname"
1606-
| "getgrgid_r"
1607-
| "getgrnam_r"
1608-
| "sigtimedwait"
1609-
| "fmemopen"
1610-
| "open_memstream"
1611-
| "open_wmemstream"
1612-
| "clock_getcpuclockid"
1613-
| "process_vm_readv"
1614-
| "process_vm_writev"
1615-
if aarch64 =>
1616-
{
1617-
true
1618-
}
1619-
16201594
_ => false,
16211595
}
16221596
});

0 commit comments

Comments
 (0)