]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
auth: Build and test with libdecaf included in Github Actions 11518/head
authorFred Morcos <fred.morcos@open-xchange.com>
Fri, 8 Apr 2022 09:15:28 +0000 (11:15 +0200)
committerFred Morcos <fred.morcos@open-xchange.com>
Fri, 8 Apr 2022 11:21:07 +0000 (13:21 +0200)
Co-authored-by: Peter van Dijk <peter.van.dijk@powerdns.com>
tasks.py

index 49dccd727f99aa96139f684f145a300ac6c8e395..d3ebe20b25c312cffd1d871a09c3b24ccf5ea66d 100644 (file)
--- a/tasks.py
+++ b/tasks.py
@@ -132,9 +132,25 @@ def install_clang_runtime(c):
     # this gives us the symbolizer, for symbols in asan/ubsan traces
     c.sudo('apt-get -qq -y --no-install-recommends install clang-12')
 
+def install_libdecaf(c, product):
+    c.run('git clone https://git.code.sf.net/p/ed448goldilocks/code /tmp/libdecaf')
+    with c.cd('/tmp/libdecaf'):
+        c.run('git checkout 41f349')
+        c.run('cmake -B build '
+              '-DCMAKE_INSTALL_PREFIX=/usr/local '
+              '-DCMAKE_INSTALL_LIBDIR=lib '
+              '-DENABLE_STATIC=OFF '
+              '-DENABLE_TESTS=OFF '
+              '-DCMAKE_C_FLAGS="-Wno-sizeof-array-div -Wno-array-parameter" .')
+        c.run('make -C build')
+        c.run('sudo make -C build install')
+    c.sudo(f'mkdir -p /opt/{product}/libdecaf')
+    c.sudo(f'cp /usr/local/lib/libdecaf.so* /opt/{product}/libdecaf/.')
+
 @task
 def install_auth_build_deps(c):
     c.sudo('apt-get install -qq -y --no-install-recommends ' + ' '.join(all_build_deps + git_build_deps + auth_build_deps))
+    install_libdecaf(c, 'pdns-auth')
 
 def setup_authbind(c):
     c.sudo('touch /etc/authbind/byport/53')
@@ -171,6 +187,10 @@ def install_auth_test_deps(c, backend): # FIXME: rename this, we do way more tha
     # FIXME we may want to start a background recursor here to make ALIAS tests more robust
     setup_authbind(c)
 
+    # Copy libdecaf out
+    c.sudo('mkdir -p /usr/local/lib')
+    c.sudo('cp /opt/pdns-auth/libdecaf/libdecaf.so* /usr/local/lib/.')
+
 @task
 def install_rec_bulk_deps(c): # FIXME: rename this, we do way more than apt-get
     c.sudo('apt-get --no-install-recommends -qq -y install ' + ' '.join(rec_bulk_deps))
@@ -238,6 +258,8 @@ def ci_auth_configure(c):
                    ./configure \
                       CC='clang-12' \
                       CXX='clang++-12' \
+                      CPPFLAGS='-I/usr/local/include/decaf' \
+                      LDFLAGS='-L/usr/local/lib -Wl,-rpath,/usr/local/lib' \
                       --enable-option-checking=fatal \
                       --with-modules='bind geoip gmysql godbc gpgsql gsqlite3 ldap lmdb lua2 pipe remote tinydns' \
                       --enable-systemd \
@@ -249,6 +271,7 @@ def ci_auth_configure(c):
                       --enable-remotebackend-zeromq \
                       --with-lmdb=/usr \
                       --with-libsodium \
+                      --with-libdecaf \
                       --prefix=/opt/pdns-auth \
                       --enable-ixfrdist \
                       --enable-asan \