]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: First attempt at buiding a 'thin' version with features disabled
authorRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 15 Dec 2021 17:00:17 +0000 (18:00 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 22 Dec 2021 08:30:44 +0000 (09:30 +0100)
.github/workflows/build-and-test-all.yml
tasks.py

index 8ba449dfca0c7f62ae93c34a0752d660c325e2bd..29e5bef10c504f10334f2669ef6235ba793489dd 100644 (file)
@@ -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
index 0edc6c3f01ac5018ec81b37e9cfa4101ef64a7fd..be2ba451daae8c9e843c8813310e48513a28547b 100644 (file)
--- 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)