diff --git a/.cirrus.yml b/.cirrus.yml index bba95d8282..ed32f258f1 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -10,14 +10,14 @@ btest_jobs: &BTEST_JOBS 4 btest_retries: &BTEST_RETRIES 2 memory: &MEMORY 12GB -config: &CONFIG --build-type=release --disable-broker-tests --prefix=$CIRRUS_WORKING_DIR/install -static_config: &STATIC_CONFIG --build-type=release --disable-broker-tests --enable-static-broker --enable-static-binpac --prefix=$CIRRUS_WORKING_DIR/install -asan_sanitizer_config: &ASAN_SANITIZER_CONFIG --build-type=debug --disable-broker-tests --sanitizers=address --enable-fuzzers --enable-coverage --disable-spicy -ubsan_sanitizer_config: &UBSAN_SANITIZER_CONFIG --build-type=debug --disable-broker-tests --sanitizers=undefined --enable-fuzzers --disable-spicy -tsan_sanitizer_config: &TSAN_SANITIZER_CONFIG --build-type=debug --disable-broker-tests --sanitizers=thread --enable-fuzzers --disable-spicy -mobile_ipv6_config: &MOBILE_IPV6_CONFIG --build-type=release --enable-mobile-ipv6 --disable-broker-tests --prefix=$CIRRUS_WORKING_DIR/install -openssl30_config: &OPENSSL30_CONFIG --build-type=release --disable-broker-tests --with-openssl=/opt/openssl --prefix=$CIRRUS_WORKING_DIR/install -homebrew_flex_bison_config: &HOMEBREW_FLEX_BISON_CONFIG --with-flex=/usr/local/opt/flex/bin/flex --with-bison=/usr/local/opt/bison/bin/bison +config: &CONFIG --build-type=release --disable-broker-tests --prefix=$CIRRUS_WORKING_DIR/install --ccache +static_config: &STATIC_CONFIG --build-type=release --disable-broker-tests --enable-static-broker --enable-static-binpac --prefix=$CIRRUS_WORKING_DIR/install --ccache +asan_sanitizer_config: &ASAN_SANITIZER_CONFIG --build-type=debug --disable-broker-tests --sanitizers=address --enable-fuzzers --enable-coverage --disable-spicy --ccache +ubsan_sanitizer_config: &UBSAN_SANITIZER_CONFIG --build-type=debug --disable-broker-tests --sanitizers=undefined --enable-fuzzers --disable-spicy --ccache +tsan_sanitizer_config: &TSAN_SANITIZER_CONFIG --build-type=debug --disable-broker-tests --sanitizers=thread --enable-fuzzers --disable-spicy --ccache +mobile_ipv6_config: &MOBILE_IPV6_CONFIG --build-type=release --enable-mobile-ipv6 --disable-broker-tests --prefix=$CIRRUS_WORKING_DIR/install --ccache +openssl30_config: &OPENSSL30_CONFIG --build-type=release --disable-broker-tests --with-openssl=/opt/openssl --prefix=$CIRRUS_WORKING_DIR/install --ccache +homebrew_flex_bison_config: &HOMEBREW_FLEX_BISON_CONFIG --with-flex=/usr/local/opt/flex/bin/flex --with-bison=/usr/local/opt/bison/bin/bison --ccache resources_template: &RESOURCES_TEMPLATE cpu: *CPUS @@ -54,6 +54,13 @@ ci_template: &CI_TEMPLATE folder: testing/external/zeek-testing-traces fingerprint_script: echo zeek-testing-traces populate_script: ./ci/init-external-repos.sh + + always: + ccache_cache: + folder: /tmp/ccache + fingerprint_script: echo $CIRRUS_TASK_NAME-$CIRRUS_OS + reupload_on_changes: true + init_external_repos_script: ./ci/init-external-repos.sh build_script: ./ci/build.sh @@ -70,6 +77,8 @@ ci_template: &CI_TEMPLATE upload_btest_html_results_artifacts: path: "testing/**/btest-results.html" type: text/html + cache_statistics_script: + ccache --show-stats env: CIRRUS_WORKING_DIR: /zeek @@ -94,6 +103,10 @@ env: # The repo token used for uploading data to Coveralls.io ZEEK_COVERALLS_REPO_TOKEN: ENCRYPTED[7ffd1e041f848f02b62f5abc7fda8a5a8a1561fbb2b46d88cefb67c74408ddeef6ea6f3b279c7953ca14ae9b4d050e2d] + CCACHE_BASEDIR: $CIRRUS_WORKING_DIR + CCACHE_DIR: /tmp/ccache + CCACHE_COMPRESS: 1 + # Linux EOL timelines: https://linuxlifecycle.com/ # Fedora (~13 months): https://fedoraproject.org/wiki/Fedora_Release_Life_Cycle diff --git a/ci/alpine/Dockerfile b/ci/alpine/Dockerfile index dcbbbe9146..61890c41d6 100644 --- a/ci/alpine/Dockerfile +++ b/ci/alpine/Dockerfile @@ -1,6 +1,7 @@ FROM alpine:latest RUN apk add --no-cache \ + ccache \ cmake \ make \ g++ \ diff --git a/ci/centos-7/Dockerfile b/ci/centos-7/Dockerfile index 7928da7727..2b03584eab 100644 --- a/ci/centos-7/Dockerfile +++ b/ci/centos-7/Dockerfile @@ -11,7 +11,7 @@ RUN sed -i 's/enabled=1/enabled=0/' /etc/yum/pluginconf.d/fastestmirror.conf RUN yum -y install \ https://repo.ius.io/ius-release-el7.rpm \ https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \ - && yum -y install git224 \ + && yum -y install git224 ccache \ && yum clean all && rm -rf /var/cache/yum RUN yum -y install \ diff --git a/ci/centos-stream-8/Dockerfile b/ci/centos-stream-8/Dockerfile index c2b6b4d3aa..b1d950e63c 100644 --- a/ci/centos-stream-8/Dockerfile +++ b/ci/centos-stream-8/Dockerfile @@ -1,9 +1,11 @@ FROM quay.io/centos/centos:stream8 +RUN dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm RUN dnf config-manager --set-enabled powertools RUN dnf -y install \ bison \ + ccache \ cmake \ diffutils \ flex \ diff --git a/ci/centos-stream-9/Dockerfile b/ci/centos-stream-9/Dockerfile index 80aecc25e5..435df82a66 100644 --- a/ci/centos-stream-9/Dockerfile +++ b/ci/centos-stream-9/Dockerfile @@ -16,6 +16,7 @@ RUN dnf -y install \ # package versioning conflicts around OpenSSL. RUN dnf -y --nobest install \ bison \ + ccache \ cmake \ diffutils \ flex \ diff --git a/ci/debian-10/Dockerfile b/ci/debian-10/Dockerfile index 77d0c7deec..4dfeaef799 100644 --- a/ci/debian-10/Dockerfile +++ b/ci/debian-10/Dockerfile @@ -25,6 +25,7 @@ RUN apt-get update && apt-get -y install \ curl \ wget \ xz-utils \ + ccache \ && rm -rf /var/lib/apt/lists/* \ # Install a recent CMake to build Spicy. && mkdir -p "${CMAKE_DIR}" \ diff --git a/ci/debian-11/Dockerfile b/ci/debian-11/Dockerfile index 584fde914c..007fefb9d6 100644 --- a/ci/debian-11/Dockerfile +++ b/ci/debian-11/Dockerfile @@ -3,6 +3,7 @@ FROM debian:11 ENV DEBIAN_FRONTEND="noninteractive" TZ="America/Los_Angeles" RUN apt-get update && apt-get -y install \ + ccache \ git \ cmake \ make \ diff --git a/ci/debian-9-32bit/Dockerfile b/ci/debian-9-32bit/Dockerfile index 6f63995a8d..b321ac3b86 100644 --- a/ci/debian-9-32bit/Dockerfile +++ b/ci/debian-9-32bit/Dockerfile @@ -11,6 +11,7 @@ ENV CMAKE_VERSION "3.19.1" ENV PATH "${CMAKE_DIR}/bin:${PATH}" RUN apt-get update && apt-get -y install \ + ccache \ git \ clang-11 \ make \ @@ -39,6 +40,9 @@ RUN apt-get update && apt-get -y install \ RUN update-alternatives --install /usr/bin/cc cc /usr/bin/clang-11 100 RUN update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-11 100 -RUN pip3 install junit2html +# junit2html >= 31.0.0 requires jinj2 >= 3.0 which requires python >= 3.7 which is +# a higher version of python3 than debian 9 provides. Fix the version of junit2html +# to the last version before they required the newer jinja2. +RUN pip3 install junit2html==30.0.6 ENV CXXFLAGS=-stdlib=libc++ diff --git a/ci/debian-9/Dockerfile b/ci/debian-9/Dockerfile index 27b16db3b0..b3eb66593d 100644 --- a/ci/debian-9/Dockerfile +++ b/ci/debian-9/Dockerfile @@ -11,6 +11,7 @@ ENV CMAKE_VERSION "3.19.1" ENV PATH "${CMAKE_DIR}/bin:${PATH}" RUN apt-get update && apt-get -y install \ + ccache \ git \ clang-11 \ make \ @@ -36,7 +37,10 @@ RUN apt-get update && apt-get -y install \ && mkdir -p "${CMAKE_DIR}" \ && curl -sSL "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz" | tar xzf - -C "${CMAKE_DIR}" --strip-components 1 -RUN pip3 install junit2html +# junit2html >= 31.0.0 requires jinj2 >= 3.0 which requires python >= 3.7 which is +# a higher version of python3 than debian 9 provides. Fix the version of junit2html +# to the last version before they required the newer jinja2. +RUN pip3 install junit2html==30.0.6 ENV CC=/usr/bin/clang-11 ENV CXX=/usr/bin/clang++-11 diff --git a/ci/fedora-34/Dockerfile b/ci/fedora-34/Dockerfile index 4dfec4e8ab..10f4ae3aaa 100644 --- a/ci/fedora-34/Dockerfile +++ b/ci/fedora-34/Dockerfile @@ -1,6 +1,7 @@ FROM fedora:34 RUN dnf -y install \ + ccache \ bison \ cmake \ diffutils \ diff --git a/ci/fedora-35/Dockerfile b/ci/fedora-35/Dockerfile index a168642ff3..e242fb95a7 100644 --- a/ci/fedora-35/Dockerfile +++ b/ci/fedora-35/Dockerfile @@ -1,6 +1,7 @@ FROM fedora:35 RUN dnf -y install \ + ccache \ bison \ cmake \ diffutils \ diff --git a/ci/freebsd/prepare.sh b/ci/freebsd/prepare.sh index a4bd907afd..104be1d13b 100755 --- a/ci/freebsd/prepare.sh +++ b/ci/freebsd/prepare.sh @@ -6,7 +6,7 @@ set -e set -x env ASSUME_ALWAYS_YES=YES pkg bootstrap -pkg install -y bash git cmake swig bison python3 base64 flex +pkg install -y bash git cmake swig bison python3 base64 flex ccache pkg upgrade -y curl pyver=$(python3 -c 'import sys; print(f"py{sys.version_info[0]}{sys.version_info[1]}")') pkg install -y $pyver-sqlite3 $pyver-pip diff --git a/ci/macos/prepare.sh b/ci/macos/prepare.sh index 98a772aed9..7c09587593 100755 --- a/ci/macos/prepare.sh +++ b/ci/macos/prepare.sh @@ -7,4 +7,4 @@ set -x brew update brew upgrade cmake openssl@1.1 -brew install swig bison flex +brew install swig bison flex ccache diff --git a/ci/openssl-3.0/Dockerfile b/ci/openssl-3.0/Dockerfile index 321afae31d..cb276c1e0d 100644 --- a/ci/openssl-3.0/Dockerfile +++ b/ci/openssl-3.0/Dockerfile @@ -3,6 +3,7 @@ FROM ubuntu:20.04 ENV DEBIAN_FRONTEND="noninteractive" TZ="America/Los_Angeles" RUN apt-get update && apt-get -y install \ + ccache \ git \ cmake \ make \ diff --git a/ci/opensuse-leap-15.3/Dockerfile b/ci/opensuse-leap-15.3/Dockerfile index 1ffdbfa1f5..3e4708f66b 100644 --- a/ci/opensuse-leap-15.3/Dockerfile +++ b/ci/opensuse-leap-15.3/Dockerfile @@ -3,6 +3,7 @@ FROM opensuse/leap:15.3 RUN zypper addrepo https://download.opensuse.org/repositories/openSUSE:Leap:15.2:Update/standard/openSUSE:Leap:15.2:Update.repo \ && zypper refresh \ && zypper in -y \ + ccache \ cmake \ make \ gcc9 \ diff --git a/ci/ubuntu-18.04/Dockerfile b/ci/ubuntu-18.04/Dockerfile index cb1dec0d5f..2b9f7f43ad 100644 --- a/ci/ubuntu-18.04/Dockerfile +++ b/ci/ubuntu-18.04/Dockerfile @@ -29,6 +29,7 @@ RUN apt-get update && apt-get -y install \ ruby \ bc \ lcov \ + ccache \ && rm -rf /var/lib/apt/lists/* \ # Recent CMake. && mkdir -p "${CMAKE_DIR}" \ diff --git a/ci/ubuntu-20.04/Dockerfile b/ci/ubuntu-20.04/Dockerfile index 74cf7b571e..0b9d46a13a 100644 --- a/ci/ubuntu-20.04/Dockerfile +++ b/ci/ubuntu-20.04/Dockerfile @@ -3,6 +3,7 @@ FROM ubuntu:20.04 ENV DEBIAN_FRONTEND="noninteractive" TZ="America/Los_Angeles" RUN apt-get update && apt-get -y install \ + ccache \ git \ cmake \ make \ diff --git a/ci/ubuntu-21.10/Dockerfile b/ci/ubuntu-21.10/Dockerfile index 4a51a122e9..a36f196323 100644 --- a/ci/ubuntu-21.10/Dockerfile +++ b/ci/ubuntu-21.10/Dockerfile @@ -4,6 +4,7 @@ ENV DEBIAN_FRONTEND="noninteractive" TZ="America/Los_Angeles" RUN apt-get update && apt-get -y install \ git \ + ccache \ cmake \ make \ gcc \