This commit is contained in:
Alex Crichton 2015-09-17 17:45:10 -07:00
parent d13e1e4bda
commit d9962f4bd1
7 changed files with 68 additions and 3 deletions

View File

@ -1,3 +1,7 @@
# This is a Dockerfile for building the image that is used to build Android
# binaries and run tests within. This will install the NDK, SDK, and set up an
# emulator to run tests in.
FROM ubuntu:latest
RUN mkdir /build

45
ci/README.md Normal file
View File

@ -0,0 +1,45 @@
The goal of the libc crate is to have CI running everywhere to have the
strongest guarantees about the definitions that this library contains, and as a
result the CI is pretty complicated and also pretty large! Hopefully this can
serve as a guide through the sea of scripts in this directory and elsewhere in
this project.
First up, let's talk about the files in this directory:
* `Dockerfile-android`, `android-accept-licenses.sh` -- these two files are
used to build the Docker image that the android CI builder uses. The
`Dockerfile` just installs the Android SDK, NDK, a Rust nightly, Rust target
libraries for Android, and sets up an emulator to run tests in. You can build
a new image with this command (from the root of the project):
docker build -t alexcrichton/rust-libc-test -f ci/Dockerfile-android .
When building a new image contact @alexcrichton to push it to the docker hub
and have libc start using it. This hasn't needed to happen yet, so the process
may be a little involved.
The script here, `android-accept-licenses.sh` is just a helper used to accept
the licenses of the SDK of Android while the docker image is being created.
* `msys2.ps1` - a PowerShell script which is used to install MSYS2 on the
AppVeyor bots. As of this writing MSYS2 isn't installed by default, and this
script will install the right version/arch of msys2 in preparation of using
the contained C compiler to compile C shims.
* `run-travis.sh` - a shell script run by all Travis builders, this is
responsible for setting up the rest of the environment such as installing new
packages, downloading Rust target libraries, etc.
* `run.sh` - the actual script which runs tests for a particular architecture.
Called from the `run-travis.sh` script this will run all tests for the target
specified.
* `cargo-config` - Cargo configuration of linkers to use copied into place by
the `run-travis.sh` script before builds are run.
* `dox.sh` - script called from `run-travis.sh` on only the linux 64-bit nightly
Travis bots to build documentation for this crate.
* `landing-page-*.html` - used by `dox.sh` to generate a landing page for all
architectures' documentation.

View File

@ -1,3 +1,5 @@
# Configuration of which linkers to call on Travis for various architectures
[target.arm-linux-androideabi]
linker = "arm-linux-androideabi-gcc"

View File

@ -1,14 +1,18 @@
#!/bin/sh
# Builds documentation for all target triples that we have a registered URL for
# in liblibc. This scrapes the list of triples to document from `src/lib.rs`
# which has a bunch of `html_root_url` directives we pick up.
set -e
TARGETS=`grep html_root_url src/lib.rs | sed 's/.*".*\/\(.*\)"/\1/'`
rm -rf target/doc
mkdir -p target/doc
cp ci/landing-page-head.html target/doc/index.html
TARGETS=`grep html_root_url src/lib.rs | sed 's/.*".*\/\(.*\)"/\1/'`
for target in $TARGETS; do
echo documenting $target
@ -21,7 +25,8 @@ done
cat ci/landing-page-footer.html >> target/doc/index.html
if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_BRANCH" = "autotest" ]; then
# If we're on travis, not a PR, and on the right branch, publish!
if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_BRANCH" = "master" ]; then
pip install ghp-import --user $USER
$HOME/.local/bin/ghp-import -n target/doc
git push -qf https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages

View File

@ -1,3 +1,5 @@
# Installs MSYS2 on AppVeyor builders
If (!${env:MSYS2_ARCH}) {
Exit 0
}

View File

@ -1,3 +1,7 @@
# Entry point for all travis builds, this will set up the Travis environment by
# downloading any dependencies. It will then execute the `run.sh` script to
# build and execute all tests.
set -ex
if [ "$TRAVIS_OS_NAME" = "linux" ]; then

View File

@ -1,5 +1,8 @@
#!/bin/sh
# Builds and runs tests for a particular target passed as an argument to this
# script.
set -ex
TARGET=$1