Commit 5f5721aa authored by Ondřej Surý's avatar Ondřej Surý
Browse files

Adjust the GitLab CI jobs to match the new images

The custom builds (oot, asan, tsan) were mostly built using Debian sid
amd64 image.  The problem was that this image broke too easily, because
it's Debian "unstable" after all.

This commit introduces "base_image" that should be most stable with
extra bits on top (clang, coccinelle, cppcheck, ...).  Currently, that
would be Debian buster amd64.

Other changes introduced by this commit:

* Change the default clang version to 10
* Run both ASAN and TSAN with both gcc and clang compilers
* Remove Clang Debian stretch i386 job
parent d07c3d6c
...@@ -17,9 +17,9 @@ variables: ...@@ -17,9 +17,9 @@ variables:
MAKE_COMMAND: make MAKE_COMMAND: make
CONFIGURE: ./configure CONFIGURE: ./configure
CLANG: clang-9 CLANG: clang-10
SCAN_BUILD: scan-build-9 SCAN_BUILD: scan-build-10
SYMBOLIZER: /usr/lib/llvm-9/bin/llvm-symbolizer SYMBOLIZER: /usr/lib/llvm-10/bin/llvm-symbolizer
ASAN_SYMBOLIZER_PATH: "$SYMBOLIZER" ASAN_SYMBOLIZER_PATH: "$SYMBOLIZER"
CLANG_FORMAT: clang-format-10 CLANG_FORMAT: clang-format-10
...@@ -148,6 +148,12 @@ stages: ...@@ -148,6 +148,12 @@ stages:
image: "$CI_REGISTRY_IMAGE:ubuntu-bionic-i386" image: "$CI_REGISTRY_IMAGE:ubuntu-bionic-i386"
<<: *linux_i386 <<: *linux_i386
# Base image
# This is a meta image that is used as a base for non-specific jobs
.base: &base_image
<<: *debian_buster_amd64_image
### Job Templates ### Job Templates
.default-triggering-rules: &default_triggering_rules .default-triggering-rules: &default_triggering_rules
...@@ -168,12 +174,12 @@ stages: ...@@ -168,12 +174,12 @@ stages:
.precheck: &precheck_job .precheck: &precheck_job
<<: *default_triggering_rules <<: *default_triggering_rules
<<: *debian_sid_amd64_image <<: *base_image
stage: precheck stage: precheck
.autoconf: &autoconf_job .autoconf: &autoconf_job
<<: *release_branch_triggering_rules <<: *release_branch_triggering_rules
<<: *debian_sid_amd64_image <<: *base_image
stage: precheck stage: precheck
script: script:
- autoreconf -fi - autoreconf -fi
...@@ -207,7 +213,7 @@ stages: ...@@ -207,7 +213,7 @@ stages:
- test -z "${RUN_MAKE_INSTALL}" || make install - test -z "${RUN_MAKE_INSTALL}" || make install
- test -z "${RUN_MAKE_INSTALL}" || sh util/check-make-install - test -z "${RUN_MAKE_INSTALL}" || sh util/check-make-install
needs: needs:
- job: autoreconf:sid:amd64 - job: autoreconf
artifacts: true artifacts: true
artifacts: artifacts:
untracked: true untracked: true
...@@ -237,7 +243,7 @@ stages: ...@@ -237,7 +243,7 @@ stages:
- 'Set-Item -path "Env:CL" -value "/MP$([Math]::Truncate($BUILD_PARALLEL_JOBS/2))"' - 'Set-Item -path "Env:CL" -value "/MP$([Math]::Truncate($BUILD_PARALLEL_JOBS/2))"'
- '& msbuild.exe /maxCpuCount:2 /t:Build /p:Configuration=$VSCONF bind9.sln' - '& msbuild.exe /maxCpuCount:2 /t:Build /p:Configuration=$VSCONF bind9.sln'
needs: needs:
- job: autoreconf:sid:amd64 - job: autoreconf
artifacts: false artifacts: false
artifacts: artifacts:
untracked: true untracked: true
...@@ -355,10 +361,10 @@ stages: ...@@ -355,10 +361,10 @@ stages:
# Jobs in the precheck stage # Jobs in the precheck stage
autoreconf:sid:amd64: autoreconf:
<<: *autoconf_job <<: *autoconf_job
misc:sid:amd64: misc:
<<: *precheck_job <<: *precheck_job
script: script:
- sh util/check-ans-prereq.sh - sh util/check-ans-prereq.sh
...@@ -386,24 +392,23 @@ misc:sid:amd64: ...@@ -386,24 +392,23 @@ misc:sid:amd64:
expire_in: "1 day" expire_in: "1 day"
when: on_failure when: on_failure
💾:sid:amd64: clang-format:
<<: *precheck_job <<: *precheck_job
needs: [] needs: []
script: script:
- if [ -r .clang-format ]; then "${CLANG_FORMAT}" -i -style=file $(git ls-files '*.c' '*.h'); fi - if [ -r .clang-format ]; then "${CLANG_FORMAT}" -i -style=file $(git ls-files '*.c' '*.h'); fi
- if test "$(git status --porcelain | grep -Ev '\?\?' | wc -l)" -gt "0"; then git status --short; exit 1; fi - if test "$(git status --porcelain | grep -Ev '\?\?' | wc -l)" -gt "0"; then git status --short; exit 1; fi
🐞:sid:amd64: coccinelle:
<<: *precheck_job <<: *precheck_job
<<: *debian_buster_amd64_image
needs: [] needs: []
script: script:
- util/check-cocci - util/check-cocci
- if test "$(git status --porcelain | grep -Ev '\?\?' | wc -l)" -gt "0"; then git status --short; exit 1; fi - if test "$(git status --porcelain | grep -Ev '\?\?' | wc -l)" -gt "0"; then git status --short; exit 1; fi
tarball-create:sid:amd64: tarball-create:
stage: precheck stage: precheck
<<: *debian_sid_amd64_image <<: *base_image
script: script:
- source version - source version
- export BIND_DIRECTORY="bind-${MAJORVER}.${MINORVER}.${PATCHVER}${RELEASETYPE}${RELEASEVER}" - export BIND_DIRECTORY="bind-${MAJORVER}.${MINORVER}.${PATCHVER}${RELEASETYPE}${RELEASEVER}"
...@@ -420,27 +425,27 @@ tarball-create:sid:amd64: ...@@ -420,27 +425,27 @@ tarball-create:sid:amd64:
# Jobs for doc builds on Debian Sid (amd64) # Jobs for doc builds on Debian Sid (amd64)
docs:sid:amd64: docs:
<<: *release_branch_triggering_rules <<: *release_branch_triggering_rules
<<: *debian_sid_amd64_image <<: *base_image
stage: docs stage: docs
script: script:
- ./configure || cat config.log - ./configure || cat config.log
- make -C doc/misc docbook - make -C doc/misc docbook
- make -C doc/arm Bv9ARM.html - make -C doc/arm Bv9ARM.html
needs: needs:
- job: autoreconf:sid:amd64 - job: autoreconf
artifacts: true artifacts: true
artifacts: artifacts:
paths: paths:
- doc/arm/ - doc/arm/
expire_in: "1 month" expire_in: "1 month"
push:docs:sid:amd64: push:docs:
<<: *debian_sid_amd64_image <<: *base_image
stage: push stage: push
needs: needs:
- job: docs:sid:amd64 - job: docs
artifacts: false artifacts: false
script: script:
- curl -X POST -F token=$GITLAB_PAGES_DOCS_TRIGGER_TOKEN -F ref=master $GITLAB_PAGES_DOCS_TRIGGER_URL - curl -X POST -F token=$GITLAB_PAGES_DOCS_TRIGGER_TOKEN -F ref=master $GITLAB_PAGES_DOCS_TRIGGER_URL
...@@ -600,9 +605,9 @@ unit:gcc:buster:amd64: ...@@ -600,9 +605,9 @@ unit:gcc:buster:amd64:
-o scan-build.reports \ -o scan-build.reports \
make -j${BUILD_PARALLEL_JOBS:-1} all V=1 make -j${BUILD_PARALLEL_JOBS:-1} all V=1
scan-build:buster:amd64: scan-build:
<<: *default_triggering_rules <<: *default_triggering_rules
<<: *debian_buster_amd64_image <<: *base_image
stage: postcheck stage: postcheck
variables: variables:
CC: "${CLANG}" CC: "${CLANG}"
...@@ -613,7 +618,7 @@ scan-build:buster:amd64: ...@@ -613,7 +618,7 @@ scan-build:buster:amd64:
- *configure - *configure
- *scan_build - *scan_build
needs: needs:
- job: autoreconf:sid:amd64 - job: autoreconf
artifacts: true artifacts: true
artifacts: artifacts:
paths: paths:
...@@ -647,8 +652,8 @@ unit:gcc:sid:amd64: ...@@ -647,8 +652,8 @@ unit:gcc:sid:amd64:
- job: gcc:sid:amd64 - job: gcc:sid:amd64
artifacts: true artifacts: true
cppcheck:gcc:sid:amd64: cppcheck:
<<: *debian_sid_amd64_image <<: *base_image
<<: *cppcheck_job <<: *cppcheck_job
needs: needs:
- job: gcc:sid:amd64 - job: gcc:sid:amd64
...@@ -656,55 +661,55 @@ cppcheck:gcc:sid:amd64: ...@@ -656,55 +661,55 @@ cppcheck:gcc:sid:amd64:
# Job for out-of-tree GCC build on Debian Sid (amd64) # Job for out-of-tree GCC build on Debian Sid (amd64)
oot:sid:amd64: out-of-tree:
variables: variables:
CC: gcc CC: gcc
CFLAGS: "${CFLAGS_COMMON} -O3" CFLAGS: "${CFLAGS_COMMON} -Og"
CONFIGURE: ../configure CONFIGURE: ../configure
EXTRA_CONFIGURE: "--enable-dnstap --with-libidn2" EXTRA_CONFIGURE: "--enable-dnstap --with-libidn2"
RUN_MAKE_INSTALL: 1 RUN_MAKE_INSTALL: 1
OOT_BUILD_WORKSPACE: workspace OOT_BUILD_WORKSPACE: workspace
<<: *debian_sid_amd64_image <<: *base_image
<<: *build_job <<: *build_job
# Jobs for tarball GCC builds on Debian Sid (amd64) # Jobs for tarball GCC builds on Debian Sid (amd64)
tarball:sid:amd64: tarball:
variables: variables:
CC: gcc CC: gcc
EXTRA_CONFIGURE: "--enable-dnstap --with-libidn2" EXTRA_CONFIGURE: "--enable-dnstap --with-libidn2"
RUN_MAKE_INSTALL: 1 RUN_MAKE_INSTALL: 1
<<: *debian_sid_amd64_image <<: *base_image
<<: *build_job <<: *build_job
before_script: before_script:
- tar --extract --file bind-*.tar.${TARBALL_EXTENSION} - tar --extract --file bind-*.tar.${TARBALL_EXTENSION}
- rm -f bind-*.tar.${TARBALL_EXTENSION} - rm -f bind-*.tar.${TARBALL_EXTENSION}
- cd bind-* - cd bind-*
needs: needs:
- job: tarball-create:sid:amd64 - job: tarball-create
artifacts: true artifacts: true
only: only:
- tags - tags
system:tarball:sid:amd64: system:tarball:
<<: *debian_sid_amd64_image <<: *base_image
<<: *system_test_job <<: *system_test_job
before_script: before_script:
- cd bind-* - cd bind-*
- *setup_interfaces - *setup_interfaces
needs: needs:
- job: tarball:sid:amd64 - job: tarball
artifacts: true artifacts: true
only: only:
- tags - tags
unit:tarball:sid:amd64: unit:tarball:
<<: *debian_sid_amd64_image <<: *base_image
<<: *unit_test_job <<: *unit_test_job
before_script: before_script:
- cd bind-* - cd bind-*
needs: needs:
- job: tarball:sid:amd64 - job: tarball
artifacts: true artifacts: true
only: only:
- tags - tags
...@@ -714,8 +719,8 @@ unit:tarball:sid:amd64: ...@@ -714,8 +719,8 @@ unit:tarball:sid:amd64:
gcc:sid:arm64: gcc:sid:arm64:
variables: variables:
CC: gcc CC: gcc
CFLAGS: "${CFLAGS_COMMON} -O2" CFLAGS: "${CFLAGS_COMMON} -Og"
EXTRA_CONFIGURE: "--enable-dnstap --with-libidn2" EXTRA_CONFIGURE: "--with-libidn2"
<<: *debian_sid_arm64_image <<: *debian_sid_arm64_image
<<: *build_job <<: *build_job
...@@ -739,7 +744,7 @@ gcc:sid:i386: ...@@ -739,7 +744,7 @@ gcc:sid:i386:
variables: variables:
CC: gcc CC: gcc
CFLAGS: "${CFLAGS_COMMON}" CFLAGS: "${CFLAGS_COMMON}"
EXTRA_CONFIGURE: "--enable-dnstap --with-libidn2 --without-python" EXTRA_CONFIGURE: "--with-libidn2 --without-python"
<<: *debian_sid_i386_image <<: *debian_sid_i386_image
<<: *build_job <<: *build_job
...@@ -853,56 +858,83 @@ unit:gcc:bionic:amd64: ...@@ -853,56 +858,83 @@ unit:gcc:bionic:amd64:
- job: gcc:bionic:amd64 - job: gcc:bionic:amd64
artifacts: true artifacts: true
# Jobs for GCC builds with ASAN enabled on Debian Sid (amd64) # Jobs for builds with ASAN enabled
asan:sid:amd64: gcc:asan:
variables: variables:
CC: gcc CC: gcc
CFLAGS: "${CFLAGS_COMMON} -fsanitize=address,undefined -DISC_MEM_USE_INTERNAL_MALLOC=0" CFLAGS: "${CFLAGS_COMMON} -fsanitize=address,undefined -DISC_MEM_USE_INTERNAL_MALLOC=0"
LDFLAGS: "-fsanitize=address,undefined" LDFLAGS: "-fsanitize=address,undefined"
EXTRA_CONFIGURE: "--with-libidn2" EXTRA_CONFIGURE: "--with-libidn2"
<<: *debian_sid_amd64_image <<: *base_image
<<: *build_job <<: *build_job
system:asan:sid:amd64: system:gcc:asan:
variables: variables:
ASAN_OPTIONS: ${ASAN_OPTIONS_COMMON} ASAN_OPTIONS: ${ASAN_OPTIONS_COMMON}
<<: *debian_sid_amd64_image <<: *base_image
<<: *system_test_job <<: *system_test_job
needs: needs:
- job: asan:sid:amd64 - job: gcc:asan
artifacts: true artifacts: true
unit:asan:sid:amd64: unit:gcc:asan:
variables: variables:
ASAN_OPTIONS: ${ASAN_OPTIONS_COMMON} ASAN_OPTIONS: ${ASAN_OPTIONS_COMMON}
<<: *debian_sid_amd64_image <<: *base_image
<<: *unit_test_job
needs:
- job: gcc:asan
artifacts: true
clang:asan:
variables:
CC: ${CLANG}
CFLAGS: "${CFLAGS_COMMON} -fsanitize=address,undefined -DISC_MEM_USE_INTERNAL_MALLOC=0"
LDFLAGS: "-fsanitize=address,undefined"
EXTRA_CONFIGURE: "--with-libidn2"
<<: *base_image
<<: *build_job
system:clang:asan:
variables:
ASAN_OPTIONS: ${ASAN_OPTIONS_COMMON}
<<: *base_image
<<: *system_test_job
needs:
- job: gcc:asan
artifacts: true
unit:clang:asan:
variables:
ASAN_OPTIONS: ${ASAN_OPTIONS_COMMON}
<<: *base_image
<<: *unit_test_job <<: *unit_test_job
needs: needs:
- job: asan:sid:amd64 - job: gcc:asan
artifacts: true artifacts: true
# Jobs for GCC builds with TSAN enabled on Debian Sid (amd64) # Jobs for builds with TSAN enabled
tsan:buster:amd64: gcc:tsan:
<<: *debian_buster_amd64_image <<: *base_image
<<: *build_job <<: *build_job
variables: variables:
CC: "${CLANG}" CC: gcc
CFLAGS: "${CFLAGS_COMMON} -fsanitize=thread -DISC_MEM_USE_INTERNAL_MALLOC=0" CFLAGS: "${CFLAGS_COMMON} -fsanitize=thread -DISC_MEM_USE_INTERNAL_MALLOC=0"
LDFLAGS: "-fsanitize=thread" LDFLAGS: "-fsanitize=thread"
EXTRA_CONFIGURE: "--with-libidn2 --enable-pthread-rwlock" EXTRA_CONFIGURE: "--with-libidn2 --enable-pthread-rwlock"
system:tsan:buster:amd64: system:gcc:tsan:
variables: variables:
TSAN_OPTIONS: "second_deadlock_stack=1 history_size=7 log_exe_name=true log_path=tsan external_symbolizer_path=$SYMBOLIZER exitcode=0" TSAN_OPTIONS: "second_deadlock_stack=1 history_size=7 log_exe_name=true log_path=tsan external_symbolizer_path=$SYMBOLIZER exitcode=0"
before_script: before_script:
- *setup_interfaces - *setup_interfaces
- echo $TSAN_OPTIONS - echo $TSAN_OPTIONS
<<: *debian_buster_amd64_image <<: *base_image
<<: *system_test_job <<: *system_test_job
needs: needs:
- job: tsan:buster:amd64 - job: gcc:tsan
artifacts: true artifacts: true
allow_failure: true allow_failure: true
after_script: after_script:
...@@ -915,16 +947,16 @@ system:tsan:buster:amd64: ...@@ -915,16 +947,16 @@ system:tsan:buster:amd64:
- tsan/ - tsan/
when: on_failure when: on_failure
unit:tsan:buster:amd64: unit:gcc:tsan:
variables: variables:
TSAN_OPTIONS: "second_deadlock_stack=1 history_size=7 log_exe_name=true log_path=tsan external_symbolizer_path=$SYMBOLIZER" TSAN_OPTIONS: "second_deadlock_stack=1 history_size=7 log_exe_name=true log_path=tsan external_symbolizer_path=$SYMBOLIZER"
before_script: before_script:
- echo $TSAN_OPTIONS - echo $TSAN_OPTIONS
- lib/isc/tests/result_test - lib/isc/tests/result_test
<<: *debian_buster_amd64_image <<: *base_image
<<: *unit_test_job <<: *unit_test_job
needs: needs:
- job: tsan:buster:amd64 - job: gcc:tsan
artifacts: true artifacts: true
allow_failure: true allow_failure: true
after_script: after_script:
...@@ -939,56 +971,89 @@ unit:tsan:buster:amd64: ...@@ -939,56 +971,89 @@ unit:tsan:buster:amd64:
- kyua_html/ - kyua_html/
when: on_failure when: on_failure
rwlock:sid:amd64: clang:tsan:
<<: *base_image
<<: *build_job
variables: variables:
CC: gcc CC: "${CLANG}"
CFLAGS: "${CFLAGS_COMMON} -Wall -Wextra -O2 -g -DISC_MEM_USE_INTERNAL_MALLOC=0" CFLAGS: "${CFLAGS_COMMON} -fsanitize=thread -DISC_MEM_USE_INTERNAL_MALLOC=0"
LDFLAGS: "-fsanitize=thread"
EXTRA_CONFIGURE: "--with-libidn2 --enable-pthread-rwlock" EXTRA_CONFIGURE: "--with-libidn2 --enable-pthread-rwlock"
<<: *debian_sid_amd64_image
<<: *build_job
system:rwlock:sid:amd64: system:clang:tsan:
<<: *debian_sid_amd64_image variables:
TSAN_OPTIONS: "second_deadlock_stack=1 history_size=7 log_exe_name=true log_path=tsan external_symbolizer_path=$SYMBOLIZER exitcode=0"
before_script:
- *setup_interfaces
- echo $TSAN_OPTIONS
<<: *base_image
<<: *system_test_job <<: *system_test_job
needs: needs:
- job: rwlock:sid:amd64 - job: clang:tsan
artifacts: true artifacts: true
allow_failure: true
after_script:
- find bin -name 'tsan.*' -exec python3 util/parse_tsan.py {} \;
artifacts:
expire_in: "1 day"
paths:
- bin/tests/system/*/tsan.*
- bin/tests/system/*/*/tsan.*
- tsan/
when: on_failure
unit:rwlock:sid:amd64: unit:clang:tsan:
<<: *debian_sid_amd64_image variables:
TSAN_OPTIONS: "second_deadlock_stack=1 history_size=7 log_exe_name=true log_path=tsan external_symbolizer_path=$SYMBOLIZER"
before_script:
- echo $TSAN_OPTIONS
- lib/isc/tests/result_test
<<: *base_image
<<: *unit_test_job <<: *unit_test_job
needs: needs:
- job: rwlock:sid:amd64 - job: clang:tsan
artifacts: true artifacts: true
allow_failure: true
after_script:
- find lib -name 'tsan.*' -exec python3 util/parse_tsan.py {} \;
artifacts:
expire_in: "1 day"
paths:
- lib/*/tests/tsan.*
- tsan/
- kyua.log
- kyua.results
- kyua_html/
when: on_failure
# Jobs for mutex-based atomics on Debian SID (amd64) # Jobs for mutex-based atomics on Debian SID (amd64)
mutexatomics:sid:amd64: mutexatomics:
variables: variables:
CC: gcc CC: gcc
CFLAGS: "${CFLAGS_COMMON} -DISC_MEM_USE_INTERNAL_MALLOC=0" CFLAGS: "${CFLAGS_COMMON} -DISC_MEM_USE_INTERNAL_MALLOC=0"
EXTRA_CONFIGURE: "--with-libidn2 --enable-mutex-atomics" EXTRA_CONFIGURE: "--with-libidn2 --enable-mutex-atomics"
<<: *debian_sid_amd64_image <<: *base_image
<<: *build_job <<: *build_job
system:mutexatomics:sid:amd64: system:mutexatomics:
<<: *debian_sid_amd64_image <<: *base_image
<<: *system_test_job <<: *system_test_job
needs: needs:
- job: mutexatomics:sid:amd64 - job: mutexatomics
artifacts: true artifacts: true
unit:mutexatomics:sid:amd64: unit:mutexatomics:
<<: *debian_sid_amd64_image <<: *base_image
<<: *unit_test_job <<: *unit_test_job
needs: needs:
- job: mutexatomics:sid:amd64 - job: mutexatomics
artifacts: true artifacts: true
# Jobs for Clang builds on Debian Stretch (amd64) # Jobs for Clang builds on Debian Stretch (amd64)