Skip to content

Commit

Permalink
Bug 1246801 - Use docker image v0.0.17, use clang-3.8 for ASan/LSan r…
Browse files Browse the repository at this point in the history
…uns r=me
  • Loading branch information
Tim Taubert committed Jun 30, 2016
1 parent 8c63fea commit 8bed34e
Show file tree
Hide file tree
Showing 16 changed files with 54 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .taskcluster.yml
Expand Up @@ -57,7 +57,7 @@ tasks:
- "tc-treeherder.v2.nss.{{revision}}.{{pushlog_id}}"

payload:
image: "ttaubert/nss-ci:0.0.16"
image: "ttaubert/nss-ci:0.0.17"

env:
TC_OWNER: {{owner}}
Expand Down
14 changes: 7 additions & 7 deletions automation/taskcluster/docker/Dockerfile
Expand Up @@ -4,24 +4,24 @@ MAINTAINER Tim Taubert <ttaubert@mozilla.com>
RUN useradd -d /home/worker -s /bin/bash -m worker
WORKDIR /home/worker

# Install non-build specific dependencies.
ADD setup.sh /tmp/setup.sh
RUN bash /tmp/setup.sh

# Add build and test scripts.
ADD bin /home/worker/bin
RUN chmod +x /home/worker/bin/*

# Set variables usually configured at login.
# Install dependencies.
ADD setup.sh /tmp/setup.sh
RUN bash /tmp/setup.sh

# Env variables.
ENV HOME /home/worker
ENV SHELL /bin/bash
ENV USER worker
ENV LOGNAME worker
ENV HOSTNAME taskcluster-worker
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8
env HOST localhost
env DOMSUF localdomain
ENV HOST localhost
ENV DOMSUF localdomain

# Set a default command for debugging.
CMD ["/bin/bash", "--login"]
13 changes: 5 additions & 8 deletions automation/taskcluster/docker/setup.sh
Expand Up @@ -22,12 +22,6 @@ apt-get -y update
export DEBIAN_FRONTEND=noninteractive
apt-get install -y --no-install-recommends curl apt-utils

# clang(-format)-3.8
apt_packages+=('clang-3.8')
apt_packages+=('clang-format-3.8')
curl http://llvm.org/apt/llvm-snapshot.gpg.key | apt-key add -
echo "deb http://llvm.org/apt/xenial/ llvm-toolchain-xenial-3.8 main" > /etc/apt/sources.list.d/docker.list

# Install the first round of packages.
apt-get -y update
apt-get install -y --no-install-recommends ${apt_packages[@]}
Expand All @@ -48,9 +42,12 @@ apt-get install -y --no-install-recommends ${apt_packages[@]}
# 32-bit builds
ln -s /usr/include/x86_64-linux-gnu/zconf.h /usr/include

# Install clang-3.8 into /usr/local/.
curl http://llvm.org/releases/3.8.0/clang+llvm-3.8.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz | tar xJv -C /usr/local --strip-components=1

# Compiler options.
update-alternatives --install /usr/bin/gcc gcc /usr/bin/clang-3.8 5
update-alternatives --install /usr/bin/g++ g++ /usr/bin/clang++-3.8 5
update-alternatives --install /usr/bin/gcc gcc /usr/local/bin/clang 5
update-alternatives --install /usr/bin/g++ g++ /usr/local/bin/clang++ 5
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 10
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 10
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 20
Expand Down
2 changes: 1 addition & 1 deletion automation/taskcluster/graph/linux/_build_base.yml
Expand Up @@ -14,7 +14,7 @@ task:

payload:
maxRunTime: 3600
image: ttaubert/nss-ci:0.0.16
image: ttaubert/nss-ci:0.0.17

artifacts:
public:
Expand Down
2 changes: 1 addition & 1 deletion automation/taskcluster/graph/linux/_test_base.yml
Expand Up @@ -14,7 +14,7 @@ task:

payload:
maxRunTime: 3600
image: ttaubert/nss-ci:0.0.16
image: ttaubert/nss-ci:0.0.17

command:
- "/bin/bash"
Expand Down
4 changes: 2 additions & 2 deletions automation/taskcluster/graph/linux/build32-debug.yml
Expand Up @@ -60,8 +60,8 @@
payload:
env:
NSS_ENABLE_TLS_1_3: 1
GCC_VERSION: clang-3.8
GXX_VERSION: clang++-3.8
GCC_VERSION: clang
GXX_VERSION: clang++

extra:
treeherder:
Expand Down
4 changes: 2 additions & 2 deletions automation/taskcluster/graph/linux/build32-opt.yml
Expand Up @@ -65,8 +65,8 @@
payload:
env:
NSS_ENABLE_TLS_1_3: 1
GCC_VERSION: clang-3.8
GXX_VERSION: clang++-3.8
GCC_VERSION: clang
GXX_VERSION: clang++
BUILD_OPT: 1

extra:
Expand Down
2 changes: 2 additions & 0 deletions automation/taskcluster/graph/linux/build64-asan.yml
Expand Up @@ -6,6 +6,8 @@

payload:
env:
GCC_VERSION: clang
GXX_VERSION: clang++
NSS_ENABLE_TLS_1_3: 1
USE_ASAN: 1
USE_64: 1
Expand Down
4 changes: 2 additions & 2 deletions automation/taskcluster/graph/linux/build64-debug.yml
Expand Up @@ -66,8 +66,8 @@
payload:
env:
NSS_ENABLE_TLS_1_3: 1
GCC_VERSION: clang-3.8
GXX_VERSION: clang++-3.8
GCC_VERSION: clang
GXX_VERSION: clang++
USE_64: 1

extra:
Expand Down
2 changes: 2 additions & 0 deletions automation/taskcluster/graph/linux/build64-lsan.yml
Expand Up @@ -6,6 +6,8 @@

payload:
env:
GCC_VERSION: clang
GXX_VERSION: clang++
NSS_DISABLE_ARENA_FREE_LIST: 1
NSS_DISABLE_UNLOAD: 1
NSS_ENABLE_TLS_1_3: 1
Expand Down
4 changes: 2 additions & 2 deletions automation/taskcluster/graph/linux/build64-opt.yml
Expand Up @@ -67,8 +67,8 @@
payload:
env:
NSS_ENABLE_TLS_1_3: 1
GCC_VERSION: clang-3.8
GXX_VERSION: clang++-3.8
GCC_VERSION: clang
GXX_VERSION: clang++
BUILD_OPT: 1
USE_64: 1

Expand Down
2 changes: 1 addition & 1 deletion automation/taskcluster/graph/tools/clang-format.yml
Expand Up @@ -15,7 +15,7 @@

payload:
maxRunTime: 3600
image: ttaubert/nss-ci:0.0.16
image: ttaubert/nss-ci:0.0.17

command:
- "/bin/bash"
Expand Down
14 changes: 6 additions & 8 deletions automation/taskcluster/scripts/build.sh
Expand Up @@ -3,12 +3,10 @@
set -v -e -x

if [ $(id -u) = 0 ]; then
# Switch compilers.
GCC=${GCC_VERSION:-gcc-5}
GXX=${GXX_VERSION:-g++-5}
source $(dirname $0)/tools.sh

update-alternatives --set gcc "/usr/bin/$GCC"
update-alternatives --set g++ "/usr/bin/$GXX"
# Set compiler.
switch_compilers

# Drop privileges by re-running this script.
exec su worker $0
Expand All @@ -20,13 +18,13 @@ if [ ! -d "nspr" ]; then
fi

# Build.
cd nss && make nss_build_all
cd nss && make nss_build_all && cd ..

# Generate certificates.
cd tests && NSS_TESTS=cert NSS_CYCLES="standard pkix sharedb" ./all.sh
NSS_TESTS=cert NSS_CYCLES="standard pkix sharedb" $(dirname $0)/run_tests.sh

# Reset test counter so that test runs pick up our certificates.
cd && echo 1 > tests_results/security/localhost
echo 1 > tests_results/security/localhost

# Package.
mkdir artifacts
Expand Down
2 changes: 1 addition & 1 deletion automation/taskcluster/scripts/run_clang_format.sh
Expand Up @@ -13,7 +13,7 @@ fi

STATUS=0
for i in $(find $1 -type f -name '*.[ch]' -print); do
if ! clang-format-3.8 $i | diff -Naur $i -; then
if ! clang-format $i | diff -Naur $i -; then
echo "Sorry, $i is not formatted properly. Please use clang-format 3.8 on your patch before landing."
STATUS=1
fi
Expand Down
8 changes: 3 additions & 5 deletions automation/taskcluster/scripts/run_tests.sh
Expand Up @@ -3,12 +3,10 @@
set -v -e -x

if [ $(id -u) = 0 ]; then
# Switch compilers.
GCC=${GCC_VERSION:-gcc-5}
GXX=${GXX_VERSION:-g++-5}
source $(dirname $0)/tools.sh

update-alternatives --set gcc "/usr/bin/$GCC"
update-alternatives --set g++ "/usr/bin/$GXX"
# Set compiler.
switch_compilers

# Stupid Docker.
echo "127.0.0.1 localhost.localdomain" >> /etc/hosts
Expand Down
16 changes: 16 additions & 0 deletions automation/taskcluster/scripts/tools.sh
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

set -v -e -x

switch_compilers() {
GCC=`which ${GCC_VERSION:-gcc-5}`
GXX=`which ${GXX_VERSION:-g++-5}`

if [ -e "$GCC" ] && [ -e "$GXX" ]; then
update-alternatives --set gcc $GCC
update-alternatives --set g++ $GXX
else
echo "Unknown compiler $GCC_VERSION/$GXX_VERSION."
exit 1
fi
}

0 comments on commit 8bed34e

Please sign in to comment.