2 # Copyright 2016 The Rust Project Developers. See the COPYRIGHT
3 # file at the top-level directory of this distribution and at
4 # http://rust-lang.org/COPYRIGHT.
6 # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
7 # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
8 # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
9 # option. This file may not be copied, modified, or distributed
10 # except according to those terms.
14 script=`cd $(dirname $0) && pwd`/`basename $0`
17 docker_dir="`dirname $script`"
18 ci_dir="`dirname $docker_dir`"
19 src_dir="`dirname $ci_dir`"
20 root_dir="`dirname $src_dir`"
22 source "$ci_dir/shared.sh"
24 travis_fold start build_docker
27 if [ -f "$docker_dir/$image/Dockerfile" ]; then
32 -f "$docker_dir/$image/Dockerfile" \
34 elif [ -f "$docker_dir/disabled/$image/Dockerfile" ]; then
35 if [ -n "$TRAVIS_OS_NAME" ]; then
36 echo Cannot run disabled images on travis!
43 -f "$docker_dir/disabled/$image/Dockerfile" \
46 echo Invalid image: $image
50 travis_fold end build_docker
59 if [ "$SCCACHE_BUCKET" != "" ]; then
60 args="$args --env SCCACHE_BUCKET"
61 args="$args --env SCCACHE_REGION"
62 args="$args --env AWS_ACCESS_KEY_ID"
63 args="$args --env AWS_SECRET_ACCESS_KEY"
64 args="$args --env SCCACHE_ERROR_LOG=/tmp/sccache/sccache.log"
65 args="$args --volume $objdir/tmp:/tmp/sccache"
67 mkdir -p $HOME/.cache/sccache
68 args="$args --env SCCACHE_DIR=/sccache --volume $HOME/.cache/sccache:/sccache"
71 # Run containers as privileged as it should give them access to some more
72 # syscalls such as ptrace and whatnot. In the upgrade to LLVM 5.0 it was
73 # discovered that the leak sanitizer apparently needs these syscalls nowadays so
74 # we'll need `--privileged` for at least the `x86_64-gnu` builder, so this just
75 # goes ahead and sets it for all builders.
76 args="$args --privileged"
80 --volume "$root_dir:/checkout:ro" \
81 --volume "$objdir:/checkout/obj" \
82 --workdir /checkout/obj \
85 --env CARGO_HOME=/cargo \
88 --env LOCAL_USER_ID=`id -u` \
91 --volume "$HOME/.cargo:/cargo" \
92 --volume "$HOME/rustsrc:$HOME/rustsrc" \
96 /checkout/src/ci/run.sh