Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 8 pull requests #41881

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
061b56b
Add a link to `park` in the `park_timeout` doc.
May 7, 2017
c158962
Add link to the module doc in `park_timeout`.
May 7, 2017
d9628f9
Add `park` info to `unpark`.
May 7, 2017
5573c47
Better example for `thread::unpark`.
May 7, 2017
c0d475a
fix typo
May 7, 2017
fa0cdaa
Inline `thread::park` documentation.
May 7, 2017
03c9510
Fix typos in `thread::park` documentation.
May 7, 2017
2f6744c
Improve docs on Arc<T> and Send/Sync
steveklabnik Apr 25, 2017
afe74c3
Fix link
May 9, 2017
49f793a
ci: Update android ndk and sdk
malbarbo May 6, 2017
cc4afe0
Improve E0477 error message
GuillaumeGomez May 9, 2017
2e509d2
Add disabled android host builders
malbarbo May 5, 2017
84a40c1
ICH: Handle case of removed FileMaps.
michaelwoerister May 10, 2017
d23a650
compiletest: force GDB to print values in the Rust format.
eddyb May 10, 2017
126feca
Rollup merge of #41536 - steveklabnik:arc-and-send, r=burntsushi
frewsxcv May 10, 2017
2806ba0
Rollup merge of #41809 - gamazeps:thread-docs, r=steveklabnik
frewsxcv May 10, 2017
75dc416
Rollup merge of #41862 - GuillaumeGomez:improve-e0477, r=nagisa
frewsxcv May 10, 2017
e777be9
Rollup merge of #41863 - malbarbo:update-android-builder, r=alexcrichton
frewsxcv May 10, 2017
a038a34
Rollup merge of #41864 - malbarbo:android-docker, r=alexcrichton
frewsxcv May 10, 2017
2357f23
Rollup merge of #41873 - michaelwoerister:fix-filemap-hash-lookup, r=…
frewsxcv May 10, 2017
116deb7
Rollup merge of #41877 - eddyb:gdb-force-rust, r=michaelwoerister
frewsxcv May 10, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions src/ci/docker/android-ndk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/sh
# Copyright 2017 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
# except according to those terms.

set -ex

URL=https://dl.google.com/android/repository

download_ndk() {
mkdir -p /android/ndk
cd /android/ndk
curl -O $URL/$1
unzip -q $1
rm $1
mv android-ndk-* ndk
}

make_standalone_toolchain() {
# See https://developer.android.com/ndk/guides/standalone_toolchain.htm
python2.7 /android/ndk/ndk/build/tools/make_standalone_toolchain.py \
--install-dir /android/ndk/$1-$2 \
--arch $1 \
--api $2
}

remove_ndk() {
rm -rf /android/ndk/ndk
}
58 changes: 38 additions & 20 deletions src/ci/docker/arm-android/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM ubuntu:16.04

RUN dpkg --add-architecture i386 && \
apt-get update && \
RUN apt-get update && \
apt-get install -y --no-install-recommends \
g++ \
make \
Expand All @@ -12,35 +11,54 @@ RUN dpkg --add-architecture i386 && \
git \
cmake \
unzip \
expect \
openjdk-9-jre-headless \
sudo \
libstdc++6:i386 \
xz-utils \
libssl-dev \
pkg-config

WORKDIR /android/
ENV PATH=$PATH:/android/ndk-arm-9/bin:/android/sdk/tools:/android/sdk/platform-tools

COPY install-ndk.sh install-sdk.sh accept-licenses.sh /android/
RUN sh /android/install-ndk.sh
RUN sh /android/install-sdk.sh

RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
dpkg -i dumb-init_*.deb && \
rm dumb-init_*.deb

COPY start-emulator.sh /android/
RUN curl -o /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-29-sccache-x86_64-unknown-linux-musl && \
chmod +x /usr/local/bin/sccache

ENTRYPOINT ["/usr/bin/dumb-init", "--", "/android/start-emulator.sh"]
# Install NDK
COPY install-ndk.sh /tmp
RUN . /tmp/install-ndk.sh && \
download_ndk android-ndk-r13b-linux-x86_64.zip && \
make_standalone_toolchain arm 9 && \
remove_ndk

RUN curl -o /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-02-24-sccache-x86_64-unknown-linux-gnu && \
chmod +x /usr/local/bin/sccache
# Install SDK
RUN dpkg --add-architecture i386 && \
apt-get update && \
apt-get install -y --no-install-recommends \
openjdk-9-jre-headless \
tzdata \
libstdc++6:i386 \
libgl1-mesa-glx \
libpulse0

COPY install-sdk.sh /tmp
RUN . /tmp/install-sdk.sh && \
download_sdk tools_r25.2.5-linux.zip && \
download_sysimage armeabi-v7a 18 && \
create_avd armeabi-v7a 18

# Setup env
ENV PATH=$PATH:/android/sdk/tools
ENV PATH=$PATH:/android/sdk/platform-tools

ENV TARGETS=arm-linux-androideabi

ENV RUST_CONFIGURE_ARGS \
--target=arm-linux-androideabi \
--arm-linux-androideabi-ndk=/android/ndk-arm-9
--target=$TARGETS \
--arm-linux-androideabi-ndk=/android/ndk/arm-9

ENV SCRIPT python2.7 ../x.py test --target $TARGETS --verbose

ENV SCRIPT python2.7 ../x.py test --target arm-linux-androideabi
# Entrypoint
COPY start-emulator.sh /android/
ENTRYPOINT ["/usr/bin/dumb-init", "--", "/android/start-emulator.sh"]
15 changes: 0 additions & 15 deletions src/ci/docker/arm-android/accept-licenses.sh

This file was deleted.

36 changes: 19 additions & 17 deletions src/ci/docker/arm-android/install-ndk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,25 @@

set -ex

cpgdb() {
cp android-ndk-r11c/prebuilt/linux-x86_64/bin/gdb /android/$1/bin/$2-gdb
cp android-ndk-r11c/prebuilt/linux-x86_64/bin/gdb-orig /android/$1/bin/gdb-orig
cp -r android-ndk-r11c/prebuilt/linux-x86_64/share /android/$1/share
URL=https://dl.google.com/android/repository

download_ndk() {
mkdir -p /android/ndk
cd /android/ndk
curl -O $URL/$1
unzip -q $1
rm $1
mv android-ndk-* ndk
}

# Prep the Android NDK
#
# See https://github.com/servo/servo/wiki/Building-for-Android
curl -O https://dl.google.com/android/repository/android-ndk-r11c-linux-x86_64.zip
unzip -q android-ndk-r11c-linux-x86_64.zip
bash android-ndk-r11c/build/tools/make-standalone-toolchain.sh \
--platform=android-9 \
--toolchain=arm-linux-androideabi-4.9 \
--install-dir=/android/ndk-arm-9 \
--ndk-dir=/android/android-ndk-r11c \
--arch=arm
cpgdb ndk-arm-9 arm-linux-androideabi
make_standalone_toolchain() {
# See https://developer.android.com/ndk/guides/standalone_toolchain.html
python2.7 /android/ndk/ndk/build/tools/make_standalone_toolchain.py \
--install-dir /android/ndk/$1-$2 \
--arch $1 \
--api $2
}

rm -rf ./android-ndk-r11c-linux-x86_64.zip ./android-ndk-r11c
remove_ndk() {
rm -rf /android/ndk/ndk
}
50 changes: 33 additions & 17 deletions src/ci/docker/arm-android/install-sdk.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
# Copyright 2016 The Rust Project Developers. See the COPYRIGHT
# Copyright 2017 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
Expand All @@ -11,23 +11,39 @@

set -ex

# Prep the SDK and emulator
#
# Note that the update process requires that we accept a bunch of licenses, and
# we can't just pipe `yes` into it for some reason, so we take the same strategy
# located in https://github.com/appunite/docker by just wrapping it in a script
# which apparently magically accepts the licenses.
URL=https://dl.google.com/android/repository

download_sdk() {
mkdir -p /android/sdk
cd /android/sdk
curl -O $URL/$1
unzip -q $1
rm -rf $1
}

download_sysimage() {
# See https://developer.android.com/studio/tools/help/android.html
abi=$1
api=$2

filter="platform-tools,android-$api"
filter="$filter,sys-img-$abi-android-$api"

mkdir sdk
curl https://dl.google.com/android/android-sdk_r24.4-linux.tgz | \
tar xzf - -C sdk --strip-components=1
# Keep printing yes to accept the licenses
while true; do echo yes; sleep 10; done | \
/android/sdk/tools/android update sdk -a --no-ui \
--filter "$filter"
}

filter="platform-tools,android-18"
filter="$filter,sys-img-armeabi-v7a-android-18"
create_avd() {
# See https://developer.android.com/studio/tools/help/android.html
abi=$1
api=$2

./accept-licenses.sh "android - update sdk -a --no-ui --filter $filter"
echo no | \
/android/sdk/tools/android create avd \
--name $abi-$api \
--target android-$api \
--abi $abi
}

echo "no" | android create avd \
--name arm-18 \
--target android-18 \
--abi armeabi-v7a
9 changes: 8 additions & 1 deletion src/ci/docker/arm-android/start-emulator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,12 @@ set -ex
# Setting SHELL to a file instead on a symlink helps android
# emulator identify the system
export SHELL=/bin/bash
nohup nohup emulator @arm-18 -no-window -partition-size 2047 0<&- &>/dev/null &

# Using the default qemu2 engine makes time::tests::since_epoch fails because
# the emulator date is set to unix epoch (in armeabi-v7a-18 image). Using
# classic engine the emulator starts with the current date and the tests run
# fine. If another image is used, this need to be evaluated again.
nohup nohup emulator @armeabi-v7a-18 \
-engine classic -no-window -partition-size 2047 0<&- &>/dev/null &

exec "$@"
49 changes: 49 additions & 0 deletions src/ci/docker/disabled/dist-aarch64-android/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
FROM ubuntu:16.04

RUN apt-get update && \
apt-get install -y --no-install-recommends \
g++ \
make \
file \
curl \
ca-certificates \
python2.7 \
git \
cmake \
unzip \
sudo \
xz-utils \
libssl-dev \
pkg-config

RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
dpkg -i dumb-init_*.deb && \
rm dumb-init_*.deb

RUN curl -o /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-29-sccache-x86_64-unknown-linux-musl && \
chmod +x /usr/local/bin/sccache

ENTRYPOINT ["/usr/bin/dumb-init", "--"]

COPY android-ndk.sh /
RUN . /android-ndk.sh && \
download_ndk android-ndk-r13b-linux-x86_64.zip && \
make_standalone_toolchain arm64 21 && \
remove_ndk

ENV PATH=$PATH:/android/ndk/arm64-21/bin

ENV DEP_Z_ROOT=/android/ndk/arm64-21/sysroot/usr/

ENV HOSTS=aarch64-linux-android

ENV RUST_CONFIGURE_ARGS \
--host=$HOSTS \
--target=$HOSTS \
--aarch64-linux-android-ndk=/android/ndk/arm64-21 \
--disable-rpath \
--enable-extended \
--enable-cargo-openssl-static

ENV SCRIPT python2.7 ../x.py dist --target $HOSTS --host $HOSTS
65 changes: 65 additions & 0 deletions src/ci/docker/disabled/dist-armv7-android/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
FROM ubuntu:16.04

RUN apt-get update && \
apt-get install -y --no-install-recommends \
g++ \
make \
file \
curl \
ca-certificates \
python2.7 \
git \
cmake \
unzip \
sudo \
xz-utils \
libssl-dev \
pkg-config

RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \
dpkg -i dumb-init_*.deb && \
rm dumb-init_*.deb

RUN curl -o /usr/local/bin/sccache \
https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-04-29-sccache-x86_64-unknown-linux-musl && \
chmod +x /usr/local/bin/sccache

ENTRYPOINT ["/usr/bin/dumb-init", "--"]

COPY android-ndk.sh /
RUN . /android-ndk.sh && \
download_ndk android-ndk-r13b-linux-x86_64.zip && \
make_standalone_toolchain arm 9 && \
make_standalone_toolchain arm 21 && \
remove_ndk

ENV PATH=$PATH:/android/ndk/arm-9/bin

ENV DEP_Z_ROOT=/android/ndk/arm-9/sysroot/usr/

ENV HOSTS=armv7-linux-androideabi

ENV RUST_CONFIGURE_ARGS \
--host=$HOSTS \
--target=$HOSTS \
--armv7-linux-androideabi-ndk=/android/ndk/arm \
--disable-rpath \
--enable-extended \
--enable-cargo-openssl-static

# We support api level 9, but api level 21 is required to build llvm. To
# overcome this problem we use a ndk with api level 21 to build llvm and then
# switch to a ndk with api level 9 to complete the build. When the linker is
# invoked there are missing symbols (like sigsetempty, not available with api
# level 9), the default linker behavior is to generate an error, to allow the
# build to finish we use --warn-unresolved-symbols. Note that the missing
# symbols does not affect std, only the compiler (llvm) and cargo (openssl).
RUN chmod 777 /android/ndk && \
ln -s /android/ndk/arm-21 /android/ndk/arm

ENV SCRIPT \
python2.7 ../x.py build src/llvm --host $HOSTS --target $HOSTS && \
(export RUSTFLAGS="\"-C link-arg=-Wl,--warn-unresolved-symbols\""; \
rm /android/ndk/arm && \
ln -s /android/ndk/arm-9 /android/ndk/arm && \
python2.7 ../x.py dist --host $HOSTS --target $HOSTS)
Loading