Skip to content

Commit 96a8306

Browse files
authored
Merge branch 'master' into master
2 parents 779984b + c1187f3 commit 96a8306

File tree

37 files changed

+470
-120
lines changed

37 files changed

+470
-120
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ matrix:
5656
- os: linux
5757
env: TARGET=i686-linux-android
5858
rust: stable
59+
# as of 2017/05/03 x86_64-linux-android are not on stable
60+
- os: linux
61+
env: TARGET=x86_64-linux-android
62+
rust: beta
5963
- os: linux
6064
env: TARGET=x86_64-unknown-linux-musl
6165
rust: stable

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22

33
name = "libc"
4-
version = "0.2.21"
4+
version = "0.2.22"
55
authors = ["The Rust Project Developers"]
66
license = "MIT/Apache-2.0"
77
readme = "README.md"

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,25 @@ We have two automated tests running on [Travis](https://travis-ci.org/rust-lang/
9898
2. Style checker
9999
- `rustc ci/style.rs && ./style src`
100100

101+
### Releasing your change to crates.io
102+
103+
Now that you've done the amazing job of landing your new API or your new
104+
platform in this crate, the next step is to get that sweet, sweet usage from
105+
crates.io! The only next step is to bump the version of libc and then publish
106+
it. If you'd like to get a release out ASAP you can follow these steps:
107+
108+
1. Update the version number in `Cargo.toml`, you'll just be bumping the patch
109+
version number.
110+
2. Run `cargo update` to regenerate the lockfile to encode your version bump in
111+
the lock file. You may pull in some other updated dependencies, that's ok.
112+
3. Send a PR to this repository. It should [look like this][example], but it'd
113+
also be nice to fill out the description with a small rationale for the
114+
release (any rationale is ok though!)
115+
4. Once merged the release will be tagged and published by one of the libc crate
116+
maintainers.
117+
118+
[example]: https://github.com/rust-lang/libc/pull/583
119+
101120
## Platforms and Documentation
102121

103122
The following platforms are currently tested and have documentation available:

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ environment:
77
- TARGET: x86_64-pc-windows-msvc
88
- TARGET: i686-pc-windows-msvc
99
install:
10-
- appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
10+
- appveyor-retry appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
1111
- rustup-init.exe -y --default-host %TARGET%
1212
- set PATH=%PATH%;C:\Users\appveyor\.cargo\bin
1313
- if defined MSYS2_BITS set PATH=%PATH%;C:\msys64\mingw%MSYS2_BITS%\bin

ci/android-install-sdk.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ case "$1" in
3737
abi=x86
3838
;;
3939

40+
x86_64)
41+
abi=x86_64
42+
;;
43+
4044
*)
4145
echo "invalid arch: $1"
4246
exit 1

ci/android-sysimage.sh

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2+
# file at the top-level directory of this distribution and at
3+
# http://rust-lang.org/COPYRIGHT.
4+
#
5+
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
# option. This file may not be copied, modified, or distributed
9+
# except according to those terms.
10+
11+
set -ex
12+
13+
URL=https://dl.google.com/android/repository/sys-img/android
14+
15+
main() {
16+
local arch=$1
17+
local name=$2
18+
local dest=/system
19+
local td=$(mktemp -d)
20+
21+
apt-get install --no-install-recommends e2tools
22+
23+
pushd $td
24+
curl -O $URL/$name
25+
unzip -q $name
26+
27+
local system=$(find . -name system.img)
28+
mkdir -p $dest/{bin,lib,lib64}
29+
30+
# Extract android linker and libraries to /system
31+
# This allows android executables to be run directly (or with qemu)
32+
if [ $arch = "x86_64" -o $arch = "arm64" ]; then
33+
e2cp -p $system:/bin/linker64 $dest/bin/
34+
e2cp -p $system:/lib64/libdl.so $dest/lib64/
35+
e2cp -p $system:/lib64/libc.so $dest/lib64/
36+
e2cp -p $system:/lib64/libm.so $dest/lib64/
37+
else
38+
e2cp -p $system:/bin/linker $dest/bin/
39+
e2cp -p $system:/lib/libdl.so $dest/lib/
40+
e2cp -p $system:/lib/libc.so $dest/lib/
41+
e2cp -p $system:/lib/libm.so $dest/lib/
42+
fi
43+
44+
# clean up
45+
apt-get purge --auto-remove -y e2tools
46+
47+
popd
48+
49+
rm -rf $td
50+
}
51+
52+
main "${@}"
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM ubuntu:16.04
2+
3+
RUN apt-get update && \
4+
apt-get install -y --no-install-recommends \
5+
ca-certificates \
6+
curl \
7+
gcc \
8+
libc-dev \
9+
python \
10+
unzip
11+
12+
WORKDIR /android/
13+
ENV ANDROID_ARCH=x86_64
14+
COPY android-install-ndk.sh /android/
15+
RUN sh /android/android-install-ndk.sh $ANDROID_ARCH
16+
17+
# We do not run x86_64-linux-android tests on an android emulator.
18+
# See ci/android-sysimage.sh for informations about how tests are run.
19+
COPY android-sysimage.sh /android/
20+
RUN bash /android/android-sysimage.sh x86_64 x86_64-21_r04.zip
21+
22+
ENV PATH=$PATH:/rust/bin:/android/ndk-$ANDROID_ARCH/bin \
23+
CARGO_TARGET_X86_64_LINUX_ANDROID_LINKER=x86_64-linux-android-gcc \
24+
CC_x86_64_linux_android=x86_64-linux-android-gcc \
25+
CXX_x86_64_linux_android=x86_64-linux-android-g++ \
26+
HOME=/tmp

ci/run-docker.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,21 @@ run() {
88
# use -f so we can use ci/ as build context
99
docker build -t libc -f ci/docker/$1/Dockerfile ci/
1010
mkdir -p target
11+
if [ -w /dev/kvm ]; then
12+
kvm="--volume /dev/kvm:/dev/kvm"
13+
fi
1114
docker run \
1215
--user `id -u`:`id -g` \
1316
--rm \
1417
--volume $HOME/.cargo:/cargo \
18+
$kvm \
1519
--env CARGO_HOME=/cargo \
1620
--volume `rustc --print sysroot`:/rust:ro \
1721
--volume `pwd`:/checkout:ro \
1822
--volume `pwd`/target:/checkout/target \
1923
--env CARGO_TARGET_DIR=/checkout/target \
2024
--workdir /checkout \
2125
--privileged \
22-
--interactive \
23-
--tty \
2426
libc \
2527
ci/run.sh $1
2628
}

ci/run.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,20 @@ case "$TARGET" in
105105
esac
106106

107107
case "$TARGET" in
108+
# Android emulator for x86_64 does not work on travis (missing hardware
109+
# acceleration). Tests are run on case *). See ci/android-sysimage.sh for
110+
# informations about how tests are run.
108111
arm-linux-androideabi | aarch64-linux-android | i686-linux-android)
109112
# set SHELL so android can detect a 64bits system, see
110113
# http://stackoverflow.com/a/41789144
111114
# https://issues.jenkins-ci.org/browse/JENKINS-26930?focusedCommentId=230791&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-230791
112115
export SHELL=/bin/dash
113116
arch=$(echo $TARGET | cut -d- -f1)
114-
emulator @$arch -no-window -no-accel &
117+
accel="-no-accel"
118+
if emulator -accel-check; then
119+
accel=""
120+
fi
121+
emulator @$arch -no-window $accel &
115122
adb wait-for-device
116123
adb push $CARGO_TARGET_DIR/$TARGET/debug/libc-test /data/local/tmp/libc-test
117124
adb shell /data/local/tmp/libc-test 2>&1 | tee /tmp/out

0 commit comments

Comments
 (0)