Enable ccache for Cirrus builds

This commit is contained in:
Tim Wojtulewicz 2022-05-17 10:35:42 -07:00
parent 4d1b9f4a08
commit d48a1b520f
18 changed files with 47 additions and 13 deletions

View file

@ -10,14 +10,14 @@ btest_jobs: &BTEST_JOBS 4
btest_retries: &BTEST_RETRIES 2 btest_retries: &BTEST_RETRIES 2
memory: &MEMORY 12GB memory: &MEMORY 12GB
config: &CONFIG --build-type=release --disable-broker-tests --prefix=$CIRRUS_WORKING_DIR/install 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 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 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 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 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 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 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 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 resources_template: &RESOURCES_TEMPLATE
cpu: *CPUS cpu: *CPUS
@ -54,6 +54,13 @@ ci_template: &CI_TEMPLATE
folder: testing/external/zeek-testing-traces folder: testing/external/zeek-testing-traces
fingerprint_script: echo zeek-testing-traces fingerprint_script: echo zeek-testing-traces
populate_script: ./ci/init-external-repos.sh 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 init_external_repos_script: ./ci/init-external-repos.sh
build_script: ./ci/build.sh build_script: ./ci/build.sh
@ -70,6 +77,8 @@ ci_template: &CI_TEMPLATE
upload_btest_html_results_artifacts: upload_btest_html_results_artifacts:
path: "testing/**/btest-results.html" path: "testing/**/btest-results.html"
type: text/html type: text/html
cache_statistics_script:
ccache --show-stats
env: env:
CIRRUS_WORKING_DIR: /zeek CIRRUS_WORKING_DIR: /zeek
@ -94,6 +103,10 @@ env:
# The repo token used for uploading data to Coveralls.io # The repo token used for uploading data to Coveralls.io
ZEEK_COVERALLS_REPO_TOKEN: ENCRYPTED[7ffd1e041f848f02b62f5abc7fda8a5a8a1561fbb2b46d88cefb67c74408ddeef6ea6f3b279c7953ca14ae9b4d050e2d] ZEEK_COVERALLS_REPO_TOKEN: ENCRYPTED[7ffd1e041f848f02b62f5abc7fda8a5a8a1561fbb2b46d88cefb67c74408ddeef6ea6f3b279c7953ca14ae9b4d050e2d]
CCACHE_BASEDIR: $CIRRUS_WORKING_DIR
CCACHE_DIR: /tmp/ccache
CCACHE_COMPRESS: 1
# Linux EOL timelines: https://linuxlifecycle.com/ # Linux EOL timelines: https://linuxlifecycle.com/
# Fedora (~13 months): https://fedoraproject.org/wiki/Fedora_Release_Life_Cycle # Fedora (~13 months): https://fedoraproject.org/wiki/Fedora_Release_Life_Cycle

View file

@ -1,6 +1,7 @@
FROM alpine:latest FROM alpine:latest
RUN apk add --no-cache \ RUN apk add --no-cache \
ccache \
cmake \ cmake \
make \ make \
g++ \ g++ \

View file

@ -11,7 +11,7 @@ RUN sed -i 's/enabled=1/enabled=0/' /etc/yum/pluginconf.d/fastestmirror.conf
RUN yum -y install \ RUN yum -y install \
https://repo.ius.io/ius-release-el7.rpm \ https://repo.ius.io/ius-release-el7.rpm \
https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.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 && yum clean all && rm -rf /var/cache/yum
RUN yum -y install \ RUN yum -y install \

View file

@ -1,9 +1,11 @@
FROM quay.io/centos/centos:stream8 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 config-manager --set-enabled powertools
RUN dnf -y install \ RUN dnf -y install \
bison \ bison \
ccache \
cmake \ cmake \
diffutils \ diffutils \
flex \ flex \

View file

@ -16,6 +16,7 @@ RUN dnf -y install \
# package versioning conflicts around OpenSSL. # package versioning conflicts around OpenSSL.
RUN dnf -y --nobest install \ RUN dnf -y --nobest install \
bison \ bison \
ccache \
cmake \ cmake \
diffutils \ diffutils \
flex \ flex \

View file

@ -25,6 +25,7 @@ RUN apt-get update && apt-get -y install \
curl \ curl \
wget \ wget \
xz-utils \ xz-utils \
ccache \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
# Install a recent CMake to build Spicy. # Install a recent CMake to build Spicy.
&& mkdir -p "${CMAKE_DIR}" \ && mkdir -p "${CMAKE_DIR}" \

View file

@ -3,6 +3,7 @@ FROM debian:11
ENV DEBIAN_FRONTEND="noninteractive" TZ="America/Los_Angeles" ENV DEBIAN_FRONTEND="noninteractive" TZ="America/Los_Angeles"
RUN apt-get update && apt-get -y install \ RUN apt-get update && apt-get -y install \
ccache \
git \ git \
cmake \ cmake \
make \ make \

View file

@ -11,6 +11,7 @@ ENV CMAKE_VERSION "3.19.1"
ENV PATH "${CMAKE_DIR}/bin:${PATH}" ENV PATH "${CMAKE_DIR}/bin:${PATH}"
RUN apt-get update && apt-get -y install \ RUN apt-get update && apt-get -y install \
ccache \
git \ git \
clang-11 \ clang-11 \
make \ 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/cc cc /usr/bin/clang-11 100
RUN update-alternatives --install /usr/bin/c++ c++ /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++ ENV CXXFLAGS=-stdlib=libc++

View file

@ -11,6 +11,7 @@ ENV CMAKE_VERSION "3.19.1"
ENV PATH "${CMAKE_DIR}/bin:${PATH}" ENV PATH "${CMAKE_DIR}/bin:${PATH}"
RUN apt-get update && apt-get -y install \ RUN apt-get update && apt-get -y install \
ccache \
git \ git \
clang-11 \ clang-11 \
make \ make \
@ -36,7 +37,10 @@ RUN apt-get update && apt-get -y install \
&& mkdir -p "${CMAKE_DIR}" \ && 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 && 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 CC=/usr/bin/clang-11
ENV CXX=/usr/bin/clang++-11 ENV CXX=/usr/bin/clang++-11

View file

@ -1,6 +1,7 @@
FROM fedora:34 FROM fedora:34
RUN dnf -y install \ RUN dnf -y install \
ccache \
bison \ bison \
cmake \ cmake \
diffutils \ diffutils \

View file

@ -1,6 +1,7 @@
FROM fedora:35 FROM fedora:35
RUN dnf -y install \ RUN dnf -y install \
ccache \
bison \ bison \
cmake \ cmake \
diffutils \ diffutils \

View file

@ -6,7 +6,7 @@ set -e
set -x set -x
env ASSUME_ALWAYS_YES=YES pkg bootstrap 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 pkg upgrade -y curl
pyver=$(python3 -c 'import sys; print(f"py{sys.version_info[0]}{sys.version_info[1]}")') pyver=$(python3 -c 'import sys; print(f"py{sys.version_info[0]}{sys.version_info[1]}")')
pkg install -y $pyver-sqlite3 $pyver-pip pkg install -y $pyver-sqlite3 $pyver-pip

View file

@ -7,4 +7,4 @@ set -x
brew update brew update
brew upgrade cmake openssl@1.1 brew upgrade cmake openssl@1.1
brew install swig bison flex brew install swig bison flex ccache

View file

@ -3,6 +3,7 @@ FROM ubuntu:20.04
ENV DEBIAN_FRONTEND="noninteractive" TZ="America/Los_Angeles" ENV DEBIAN_FRONTEND="noninteractive" TZ="America/Los_Angeles"
RUN apt-get update && apt-get -y install \ RUN apt-get update && apt-get -y install \
ccache \
git \ git \
cmake \ cmake \
make \ make \

View file

@ -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 \ RUN zypper addrepo https://download.opensuse.org/repositories/openSUSE:Leap:15.2:Update/standard/openSUSE:Leap:15.2:Update.repo \
&& zypper refresh \ && zypper refresh \
&& zypper in -y \ && zypper in -y \
ccache \
cmake \ cmake \
make \ make \
gcc9 \ gcc9 \

View file

@ -29,6 +29,7 @@ RUN apt-get update && apt-get -y install \
ruby \ ruby \
bc \ bc \
lcov \ lcov \
ccache \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
# Recent CMake. # Recent CMake.
&& mkdir -p "${CMAKE_DIR}" \ && mkdir -p "${CMAKE_DIR}" \

View file

@ -3,6 +3,7 @@ FROM ubuntu:20.04
ENV DEBIAN_FRONTEND="noninteractive" TZ="America/Los_Angeles" ENV DEBIAN_FRONTEND="noninteractive" TZ="America/Los_Angeles"
RUN apt-get update && apt-get -y install \ RUN apt-get update && apt-get -y install \
ccache \
git \ git \
cmake \ cmake \
make \ make \

View file

@ -4,6 +4,7 @@ ENV DEBIAN_FRONTEND="noninteractive" TZ="America/Los_Angeles"
RUN apt-get update && apt-get -y install \ RUN apt-get update && apt-get -y install \
git \ git \
ccache \
cmake \ cmake \
make \ make \
gcc \ gcc \