From: Remi Gacogne Date: Wed, 15 Dec 2021 17:00:17 +0000 (+0100) Subject: dnsdist: First attempt at buiding a 'thin' version with features disabled X-Git-Tag: auth-4.7.0-alpha1~103^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e3d6cf059ad9f5f512cba79ebd707df9a2bdd15e;p=thirdparty%2Fpdns.git dnsdist: First attempt at buiding a 'thin' version with features disabled --- diff --git a/.github/workflows/build-and-test-all.yml b/.github/workflows/build-and-test-all.yml index 8ba449dfca..29e5bef10c 100644 --- a/.github/workflows/build-and-test-all.yml +++ b/.github/workflows/build-and-test-all.yml @@ -99,6 +99,10 @@ jobs: strategy: matrix: sanitizers: [ubsan+asan, tsan] + features: [least, full] + exclude: + - sanitizers: tsan + features: least env: UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1:suppressions=${{ github.workspace }}/build-scripts/UBSan.supp" ASAN_OPTIONS: detect_leaks=0 @@ -120,14 +124,14 @@ jobs: uses: actions/cache@v2 with: path: ~/.ccache - key: dnsdist-${{ matrix.sanitizers }}-ccache-${{ steps.get-stamp.outputs.stamp }} - restore-keys: dnsdist-${{ matrix.sanitizers }}-ccache- + key: dnsdist-${{ matrix.features }}-${{ matrix.sanitizers }}-ccache-${{ steps.get-stamp.outputs.stamp }} + restore-keys: dnsdist-${{ matrix.features }}-${{ matrix.sanitizers }}-ccache- - run: ../../build-scripts/gh-actions-setup-inv # this runs apt update+upgrade - run: inv apt-fresh - run: inv install-clang - run: inv install-dnsdist-build-deps - run: inv ci-autoconf - - run: inv ci-dnsdist-configure + - run: inv ci-dnsdist-configure ${{ matrix.features }} - run: inv ci-dnsdist-make - run: inv ci-dnsdist-run-unit-tests - run: inv ci-make-install @@ -135,7 +139,7 @@ jobs: - name: Store the binaries uses: actions/upload-artifact@v2 # this takes 30 seconds, maybe we want to tar with: - name: dnsdist-${{ matrix.sanitizers }} + name: dnsdist-${{ matrix.features }}-${{ matrix.sanitizers }} path: /opt/dnsdist retention-days: 1 @@ -373,7 +377,7 @@ jobs: - name: Fetch the binaries uses: actions/download-artifact@v2 with: - name: dnsdist-${{ matrix.sanitizers }} + name: dnsdist-full-${{ matrix.sanitizers }} path: /opt/dnsdist - run: build-scripts/gh-actions-setup-inv # this runs apt update+upgrade - run: inv install-clang-runtime diff --git a/tasks.py b/tasks.py index 0edc6c3f01..be2ba451da 100644 --- a/tasks.py +++ b/tasks.py @@ -277,27 +277,69 @@ def ci_rec_configure(c): raise UnexpectedExit(res) @task -def ci_dnsdist_configure(c): +def ci_dnsdist_configure(c, features): + additional_flags = '' + if features == 'full': + features_set = '--enable-dnstap \ + --enable-dnscrypt \ + --enable-dns-over-tls \ + --enable-dns-over-https \ + --enable-systemd \ + --prefix=/opt/dnsdist \ + --with-gnutls \ + --with-libsodium \ + --with-lua=luajit \ + --with-libcap \ + --with-nghttp2 \ + --with-re2 ' + else: + features_set = '--disable-dnstap \ + --disable-dnscrypt \ + --disable-ipcipher \ + --disable-systemd \ + --without-cdb \ + --without-ebpf \ + --without-gnutls \ + --without-libedit \ + --without-libsodium \ + --without-lmdb \ + --without-net-snmp \ + --without-re2 ' + additional_flags = '-DDISABLE_COMPLETION \ + -DDISABLE_PROMETHEUS \ + -DDISABLE_PROTOBUF \ + -DDISABLE_BUILTIN_HTML \ + -DDISABLE_CARBON \ + -DDISABLE_SECPOLL \ + -DDISABLE_DEPRECATED_DYNBLOCK \ + -DDISABLE_LUA_WEB_HANDLERS \ + -DDISABLE_NON_FFI_DQ_BINDINGS \ + -DDISABLE_POLICIES_BINDINGS \ + -DDISABLE_PACKETCACHE_BINDINGS \ + -DDISABLE_DOWNSTREAM_BINDINGS \ + -DDISABLE_COMBO_ADDR_BINDINGS \ + -DDISABLE_CLIENT_STATE_BINDINGS \ + -DDISABLE_QPS_LIMITER_BINDINGS \ + -DDISABLE_SUFFIX_MATCH_BINDINGS \ + -DDISABLE_NETMASK_BINDINGS \ + -DDISABLE_DNSNAME_BINDINGS \ + -DDISABLE_DNSHEADER_BINDINGS \ + -DDISABLE_RECVMMSG \ + -DDISABLE_WEB_CONFIG \ + -DDISABLE_RULES_ALTERING_QUERIES \ + -DDISABLE_ECS_ACTIONS \ + -DDISABLE_TOP_N_BINDINGS' sanitizers = ' '.join('--enable-'+x for x in os.getenv('SANITIZERS').split('+')) - res = c.run('''CFLAGS="-O1 -Werror=vla -Werror=shadow -Wformat=2 -Werror=format-security -Werror=string-plus-int" \ - CXXFLAGS="-O1 -Werror=vla -Werror=shadow -Wformat=2 -Werror=format-security -Werror=string-plus-int -Wp,-D_GLIBCXX_ASSERTIONS" \ + cflags = '-O1 -Werror=vla -Werror=shadow -Wformat=2 -Werror=format-security -Werror=string-plus-int' + cxxflags = cflags + ' -Wp,-D_GLIBCXX_ASSERTIONS ' + additional_flags + res = c.run('''CFLAGS="%s" \ + CXXFLAGS="%s" \ ./configure \ CC='clang-12' \ CXX='clang++-12' \ --enable-option-checking=fatal \ --enable-unit-tests \ - --enable-dnstap \ - --enable-dnscrypt \ - --enable-dns-over-tls \ - --enable-dns-over-https \ - --enable-systemd \ - --prefix=/opt/dnsdist \ - --with-gnutls \ - --with-libsodium \ - --with-lua=luajit \ - --with-libcap \ - --with-nghttp2 \ - --with-re2 ''' + sanitizers, warn=True) + --prefix=/opt/dnsdist %s %s %s''' % (cflags, cxxflags, features_set, sanitizers), warn=True) if res.exited != 0: c.run('cat config.log') raise UnexpectedExit(res)