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

[beta] next #40046

Merged
merged 19 commits into from
Mar 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ matrix:
fast_finish: true
include:
# Linux builders, all docker images
- env: IMAGE=android DEPLOY=1
- env: IMAGE=arm-android
- env: IMAGE=cross DEPLOY=1
- env: IMAGE=linux-tested-targets DEPLOY=1
- env: IMAGE=dist-android DEPLOY=1
- env: IMAGE=dist-arm-linux DEPLOY=1
- env: IMAGE=dist-armv7-aarch64-linux DEPLOY=1
- env: IMAGE=dist-freebsd DEPLOY=1
Expand Down
2 changes: 1 addition & 1 deletion mk/main.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ CFG_RELEASE_NUM=1.16.0
# An optional number to put after the label, e.g. '.2' -> '-beta.2'
# NB Make sure it starts with a dot to conform to semver pre-release
# versions (section 9)
CFG_PRERELEASE_VERSION=.2
CFG_PRERELEASE_VERSION=.3

ifeq ($(CFG_RELEASE_CHANNEL),stable)
# This is the normal semver version string, e.g. "0.12.0", "0.12.0-nightly"
Expand Down
6 changes: 3 additions & 3 deletions src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,14 +438,14 @@ def main():
rb.use_vendored_sources = '\nvendor = true' in rb.config_toml or \
'CFG_ENABLE_VENDOR' in rb.config_mk

if 'SUDO_USER' in os.environ:
if os.environ['USER'] != os.environ['SUDO_USER']:
if 'SUDO_USER' in os.environ and not rb.use_vendored_sources:
if os.environ.get('USER') != os.environ['SUDO_USER']:
rb.use_vendored_sources = True
print('info: looks like you are running this command under `sudo`')
print(' and so in order to preserve your $HOME this will now')
print(' use vendored sources by default. Note that if this')
print(' does not work you should run a normal build first')
print(' before running a command like `sudo make intall`')
print(' before running a command like `sudo make install`')

if rb.use_vendored_sources:
if not os.path.exists('.cargo'):
Expand Down
4 changes: 0 additions & 4 deletions src/bootstrap/sanity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,6 @@ $ pacman -R cmake && pacman -S mingw-w64-x86_64-cmake
");
}
}

if target.contains("arm-linux-android") {
need_cmd("adb".as_ref());
}
}

for host in build.flags.host.iter() {
Expand Down
46 changes: 46 additions & 0 deletions src/ci/docker/arm-android/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
FROM ubuntu:16.04

RUN dpkg --add-architecture i386 && \
apt-get update && \
apt-get install -y --no-install-recommends \
g++ \
make \
file \
curl \
ca-certificates \
python2.7 \
git \
cmake \
unzip \
expect \
openjdk-9-jre \
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/

ENTRYPOINT ["/usr/bin/dumb-init", "--", "/android/start-emulator.sh"]

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

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

ENV SCRIPT python2.7 ../x.py test --target arm-linux-androideabi
33 changes: 33 additions & 0 deletions src/ci/docker/arm-android/install-ndk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/sh
# Copyright 2016 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

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
}

# 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

rm -rf ./android-ndk-r11c-linux-x86_64.zip ./android-ndk-r11c
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,13 @@ RUN dpkg --add-architecture i386 && \
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/
COPY install-ndk.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/

ENTRYPOINT ["/usr/bin/dumb-init", "--", "/android/start-emulator.sh"]
ENTRYPOINT ["/usr/bin/dumb-init", "--"]

ENV SCCACHE_DIGEST=7237e38e029342fa27b7ac25412cb9d52554008b12389727320bd533fd7f05b6a96d55485f305caf95e5c8f5f97c3313e10012ccad3e752aba2518f3522ba783
RUN curl -L https://api.pub.build.mozilla.org/tooltool/sha512/$SCCACHE_DIGEST | \
Expand All @@ -49,8 +45,4 @@ ENV RUST_CONFIGURE_ARGS \
--i686-linux-android-ndk=/android/ndk-x86-9 \
--aarch64-linux-android-ndk=/android/ndk-aarch64

# Just a smoke test in dist to see if this works for now, we should expand this
# to all the targets above eventually.
ENV SCRIPT \
python2.7 ../x.py test --target arm-linux-androideabi && \
python2.7 ../x.py dist --target $TARGETS
ENV SCRIPT python2.7 ../x.py dist --target $TARGETS
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@

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
}

# Prep the Android NDK
#
# See https://github.com/servo/servo/wiki/Building-for-Android
Expand All @@ -28,7 +22,6 @@ bash android-ndk-r11c/build/tools/make-standalone-toolchain.sh \
--install-dir=/android/ndk-arm-9 \
--ndk-dir=/android/android-ndk-r11c \
--arch=arm
cpgdb ndk-arm-9 arm-linux-androideabi
bash android-ndk-r11c/build/tools/make-standalone-toolchain.sh \
--platform=android-21 \
--toolchain=aarch64-linux-android-4.9 \
Expand Down
Loading