summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.taskcluster.yml2
-rw-r--r--automation/taskcluster/docker/Dockerfile14
-rw-r--r--automation/taskcluster/docker/setup.sh13
-rw-r--r--automation/taskcluster/graph/linux/_build_base.yml2
-rw-r--r--automation/taskcluster/graph/linux/_test_base.yml2
-rw-r--r--automation/taskcluster/graph/linux/build32-debug.yml4
-rw-r--r--automation/taskcluster/graph/linux/build32-opt.yml4
-rw-r--r--automation/taskcluster/graph/linux/build64-asan.yml2
-rw-r--r--automation/taskcluster/graph/linux/build64-debug.yml4
-rw-r--r--automation/taskcluster/graph/linux/build64-lsan.yml2
-rw-r--r--automation/taskcluster/graph/linux/build64-opt.yml4
-rw-r--r--automation/taskcluster/graph/tools/clang-format.yml2
-rwxr-xr-xautomation/taskcluster/scripts/build.sh14
-rwxr-xr-xautomation/taskcluster/scripts/run_clang_format.sh2
-rwxr-xr-xautomation/taskcluster/scripts/run_tests.sh8
-rw-r--r--automation/taskcluster/scripts/tools.sh16
16 files changed, 54 insertions, 41 deletions
diff --git a/.taskcluster.yml b/.taskcluster.yml
index ed4a35fa0..db0972548 100644
--- a/.taskcluster.yml
+++ b/.taskcluster.yml
@@ -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}}
diff --git a/automation/taskcluster/docker/Dockerfile b/automation/taskcluster/docker/Dockerfile
index 675d858dc..35777c0b7 100644
--- a/automation/taskcluster/docker/Dockerfile
+++ b/automation/taskcluster/docker/Dockerfile
@@ -4,15 +4,15 @@ 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
@@ -20,8 +20,8 @@ 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"]
diff --git a/automation/taskcluster/docker/setup.sh b/automation/taskcluster/docker/setup.sh
index 5edb12bc7..8b094dbb9 100644
--- a/automation/taskcluster/docker/setup.sh
+++ b/automation/taskcluster/docker/setup.sh
@@ -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[@]}
@@ -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
diff --git a/automation/taskcluster/graph/linux/_build_base.yml b/automation/taskcluster/graph/linux/_build_base.yml
index b73d14a9f..a7e1dd547 100644
--- a/automation/taskcluster/graph/linux/_build_base.yml
+++ b/automation/taskcluster/graph/linux/_build_base.yml
@@ -14,7 +14,7 @@ task:
payload:
maxRunTime: 3600
- image: ttaubert/nss-ci:0.0.16
+ image: ttaubert/nss-ci:0.0.17
artifacts:
public:
diff --git a/automation/taskcluster/graph/linux/_test_base.yml b/automation/taskcluster/graph/linux/_test_base.yml
index 329764c0d..1e7c91ad6 100644
--- a/automation/taskcluster/graph/linux/_test_base.yml
+++ b/automation/taskcluster/graph/linux/_test_base.yml
@@ -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"
diff --git a/automation/taskcluster/graph/linux/build32-debug.yml b/automation/taskcluster/graph/linux/build32-debug.yml
index af49e479c..146c5ef90 100644
--- a/automation/taskcluster/graph/linux/build32-debug.yml
+++ b/automation/taskcluster/graph/linux/build32-debug.yml
@@ -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:
diff --git a/automation/taskcluster/graph/linux/build32-opt.yml b/automation/taskcluster/graph/linux/build32-opt.yml
index 29d9aa269..3026ff8ed 100644
--- a/automation/taskcluster/graph/linux/build32-opt.yml
+++ b/automation/taskcluster/graph/linux/build32-opt.yml
@@ -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:
diff --git a/automation/taskcluster/graph/linux/build64-asan.yml b/automation/taskcluster/graph/linux/build64-asan.yml
index 6411c574d..11cd0a3ce 100644
--- a/automation/taskcluster/graph/linux/build64-asan.yml
+++ b/automation/taskcluster/graph/linux/build64-asan.yml
@@ -6,6 +6,8 @@
payload:
env:
+ GCC_VERSION: clang
+ GXX_VERSION: clang++
NSS_ENABLE_TLS_1_3: 1
USE_ASAN: 1
USE_64: 1
diff --git a/automation/taskcluster/graph/linux/build64-debug.yml b/automation/taskcluster/graph/linux/build64-debug.yml
index e38868b8a..e75d0a54c 100644
--- a/automation/taskcluster/graph/linux/build64-debug.yml
+++ b/automation/taskcluster/graph/linux/build64-debug.yml
@@ -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:
diff --git a/automation/taskcluster/graph/linux/build64-lsan.yml b/automation/taskcluster/graph/linux/build64-lsan.yml
index 1f6fb3960..1a9a4eada 100644
--- a/automation/taskcluster/graph/linux/build64-lsan.yml
+++ b/automation/taskcluster/graph/linux/build64-lsan.yml
@@ -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
diff --git a/automation/taskcluster/graph/linux/build64-opt.yml b/automation/taskcluster/graph/linux/build64-opt.yml
index f92393b2c..7217d5248 100644
--- a/automation/taskcluster/graph/linux/build64-opt.yml
+++ b/automation/taskcluster/graph/linux/build64-opt.yml
@@ -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
diff --git a/automation/taskcluster/graph/tools/clang-format.yml b/automation/taskcluster/graph/tools/clang-format.yml
index 1445e9793..fc1ad96fa 100644
--- a/automation/taskcluster/graph/tools/clang-format.yml
+++ b/automation/taskcluster/graph/tools/clang-format.yml
@@ -15,7 +15,7 @@
payload:
maxRunTime: 3600
- image: ttaubert/nss-ci:0.0.16
+ image: ttaubert/nss-ci:0.0.17
command:
- "/bin/bash"
diff --git a/automation/taskcluster/scripts/build.sh b/automation/taskcluster/scripts/build.sh
index f90e002a1..f48cb20dc 100755
--- a/automation/taskcluster/scripts/build.sh
+++ b/automation/taskcluster/scripts/build.sh
@@ -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
@@ -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
diff --git a/automation/taskcluster/scripts/run_clang_format.sh b/automation/taskcluster/scripts/run_clang_format.sh
index 10f045b9f..e0e69e622 100755
--- a/automation/taskcluster/scripts/run_clang_format.sh
+++ b/automation/taskcluster/scripts/run_clang_format.sh
@@ -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
diff --git a/automation/taskcluster/scripts/run_tests.sh b/automation/taskcluster/scripts/run_tests.sh
index a43c0a313..b917a9d48 100755
--- a/automation/taskcluster/scripts/run_tests.sh
+++ b/automation/taskcluster/scripts/run_tests.sh
@@ -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
diff --git a/automation/taskcluster/scripts/tools.sh b/automation/taskcluster/scripts/tools.sh
new file mode 100644
index 000000000..1c2bf103e
--- /dev/null
+++ b/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
+}