matrix:
sanitizers: [ubsan+asan, tsan]
features: [least, full]
+ builder: [autotools, meson]
exclude:
- sanitizers: tsan
features: least
+ - builder: meson
+ sanitizers: tsan
container:
image: "${{ needs.get-runner-container-image.outputs.id }}:${{ needs.get-runner-container-image.outputs.tag }}"
env:
path: ~/.ccache
key: recursor-${{ matrix.features }}-${{ matrix.sanitizers }}-ccache-${{ steps.get-stamp.outputs.stamp }}
restore-keys: recursor-${{ matrix.features }}-${{ matrix.sanitizers }}-ccache-
- - run: inv ci-install-rust ${{ env.REPO_HOME }}
+ - run: inv install-rec-build-deps ${{ matrix.builder == 'meson' && '--meson' || '' }}
working-directory: ./pdns/recursordist/
- - run: inv ci-autoconf
+ - run: inv ci-install-rust ${{ env.REPO_HOME }}
working-directory: ./pdns/recursordist/
- - run: inv ci-rec-configure ${{ matrix.features }}
+ - run: inv ci-autoconf ${{ matrix.builder == 'meson' && '--meson' || '' }}
working-directory: ./pdns/recursordist/
- - run: inv ci-make-distdir
+ - run: inv ci-rec-configure -f ${{ matrix.features }} -b pdns-recursor-${{ env.BUILDER_VERSION }} ${{ matrix.builder == 'meson' && '--meson' || '' }}
working-directory: ./pdns/recursordist/
- - run: inv ci-rec-configure ${{ matrix.features }}
- - run: inv ci-rec-make-bear
- - run: inv ci-rec-run-unit-tests
+ - run: inv ci-rec-build ${{ matrix.builder == 'meson' && '--meson' || '' }}
+ - run: inv ci-rec-run-unit-tests ${{ matrix.builder == 'meson' && '--meson' || '' }}
- run: inv generate-coverage-info ./testrunner $GITHUB_WORKSPACE
- if: ${{ env.COVERAGE == 'yes' && matrix.sanitizers != 'tsan' }}
+ if: ${{ env.COVERAGE == 'yes' && matrix.sanitizers != 'tsan' && matrix.builder != 'meson' }}
- name: Coveralls Parallel rec unit
- if: ${{ env.COVERAGE == 'yes' && matrix.sanitizers != 'tsan' }}
+ if: ${{ env.COVERAGE == 'yes' && matrix.sanitizers != 'tsan' && matrix.builder != 'meson' }}
uses: coverallsapp/github-action@v2
with:
flag-name: rec-unit-${{ matrix.features }}-${{ matrix.sanitizers }}
parallel: true
allow-empty: true
fail-on-error: false
- - run: inv ci-make-install
+ - run: inv ci-rec-install ${{ matrix.builder == 'meson' && '--meson' || '' }}
- run: ccache -s
- - run: echo "normalized-branch-name=${{ inputs.branch-name || github.ref_name }}" | tr "/" "-" >> "$GITHUB_ENV"
- - name: Store the binaries
+ - if: ${{ matrix.builder != 'meson' }}
+ run: echo "normalized-branch-name=${{ inputs.branch-name || github.ref_name }}" | tr "/" "-" >> "$GITHUB_ENV"
+ - if: ${{ matrix.builder != 'meson' }}
+ name: Store the binaries
uses: actions/upload-artifact@v4 # this takes 30 seconds, maybe we want to tar
with:
name: pdns-recursor-${{ matrix.features }}-${{ matrix.sanitizers }}-${{ env.normalized-branch-name }}
c.sudo('chmod 755 /var/agentx')
@task
-def install_rec_build_deps(c):
+def install_rec_build_deps(c, meson=False):
c.sudo('apt-get install -y --no-install-recommends ' + ' '.join(all_build_deps + git_build_deps + rec_build_deps))
+ if meson:
+ install_meson(c)
@task(optional=['skipXDP'])
def install_dnsdist_build_deps(c, skipXDP=False):
def get_sanitizers(meson=False):
sanitizers = os.getenv('SANITIZERS', '')
if meson:
+ if sanitizers == 'ubsan+asan':
+ sanitizers='address,undefined'
+ if sanitizers == 'tsan':
+ sanitizers='thread'
return f'-D b_sanitize={sanitizers}' if sanitizers != '' else ''
if sanitizers != '':
sanitizers = sanitizers.split('+')
with c.cd(f'{build_dir}'):
ci_auth_configure_autotools(c)
-@task
-def ci_rec_configure(c, features):
- unittests = get_unit_tests()
+def ci_rec_configure_meson(c, features, build_dir):
+ # XXX feautures
+ unittests = get_unit_tests(meson=True, auth=False)
+ if features == "full":
+ configure_cmd = " ".join([
+ "LDFLAGS='-L/usr/local/lib -Wl,-rpath,/usr/local/lib'",
+ get_base_configure_cmd_meson(build_dir),
+ "-D dns-over-tls=true",
+ "-D nod=true",
+ "-D snmp=true",
+ "-D lua=luajit",
+ "-D prefix=/opt/pdns-recursor",
+ unittests,
+ ])
+ else:
+ configure_cmd = " ".join([
+ "LDFLAGS='-L/usr/local/lib -Wl,-rpath,/usr/local/lib'",
+ get_base_configure_cmd_meson(build_dir),
+ "-D dns-over-tls=false",
+ "-D dnstap=disabled",
+ "-D libcurl=disabled",
+ "-D lua=luajit",
+ "-D nod=false",
+ "-D prefix=/opt/pdns-recursor",
+ "-D signers-libsodium=disabled",
+ "-D snmp=false",
+ "-D systemd=disabled",
+ unittests,
+ ])
+ res = c.run(configure_cmd, warn=True)
+ if res.exited != 0:
+ c.run(f'cat {build_dir}/meson-logs/meson-log.txt')
+ raise UnexpectedExit(res)
+def ci_rec_configure_autotools(c, features):
+ unittests = get_unit_tests()
if features == 'full':
configure_cmd = " ".join([
get_base_configure_cmd(),
c.run('cat config.log')
raise UnexpectedExit(res)
+@task
+def ci_rec_configure(c, features, build_dir=None, meson=False):
+ if meson:
+ ci_rec_configure_meson(c, features, build_dir)
+ else:
+ ci_rec_configure_autotools(c, features)
+ if build_dir:
+ ci_make_distdir(c)
+ with c.cd(f'{build_dir}'):
+ ci_rec_configure_autotools(c, features)
@task
def ci_dnsdist_configure(c, features):
c.run(f'bear --append -- make -j{get_build_concurrency()} -k V=1')
def run_ninja(c):
- c.run(f'. {repo_home}/.venv/bin/activate && ninja -j{get_build_concurrency()} --verbose')
+ c.run(f'. {repo_home}/.venv/bin/activate && ninja -j{get_build_concurrency(4)} --verbose')
@task
def ci_auth_build(c, meson=False):
else:
ci_auth_make_bear(c)
-@task
-def ci_rec_make(c):
- c.run(f'make -j{get_build_concurrency()} -k V=1')
-
@task
def ci_rec_make_bear(c):
# Assumed to be running under ./pdns/recursordist/
- c.run(f'bear --append -- make -j{get_build_concurrency()} -k V=1')
+ c.run(f'bear --append -- make -j{get_build_concurrency(4)} -k V=1')
+
+@task
+def ci_rec_build(c, meson=False):
+ if meson:
+ run_ninja(c)
+ else:
+ ci_rec_make_bear(c)
@task
def ci_dnsdist_make(c):
raise UnexpectedExit(res)
@task
-def ci_rec_run_unit_tests(c):
- res = c.run('make check', warn=True)
- if res.exited != 0:
- c.run('cat test-suite.log')
- raise UnexpectedExit(res)
+def ci_rec_run_unit_tests(c, meson=False):
+ if meson:
+ suite_timeout_sec = 120
+ logfile = 'meson-logs/testlog.txt'
+ res = c.run(f'. {repo_home}/.venv/bin/activate && meson test --verbose -t {suite_timeout_sec}', warn=True)
+ else:
+ res = c.run('make check', warn=True)
+ if res.exited != 0:
+ c.run('cat test-suite.log')
+ raise UnexpectedExit(res)
@task
def ci_dnsdist_run_unit_tests(c):
raise UnexpectedExit(res)
@task
-def ci_make_distdir(c):
- c.run('make distdir')
+def ci_make_distdir(c, meson=False):
+ if not meson:
+ c.run('make distdir')
@task
def ci_auth_install(c, meson=False):
def ci_make_install(c):
c.run('make install')
+@task
+def ci_rec_install(c, meson=False):
+ if not meson:
+ c.run('make install')
+
@task
def add_auth_repo(c, dist_name, dist_release_name, pdns_repo_version):
c.sudo('apt-get install -y curl gnupg2')