Skip to content

Commit

Permalink
Complete rewrite the BIND 9 build system
Browse files Browse the repository at this point in the history
The rewrite of BIND 9 build system is a large work and cannot be reasonable
split into separate merge requests.  Addition of the automake has a positive
effect on the readability and maintainability of the build system as it is more
declarative, it allows conditional and we are able to drop all of the custom
make code that BIND 9 developed over the years to overcome the deficiencies of
autoconf + custom Makefile.in files.

This squashed commit contains following changes:

- conversion (or rather fresh rewrite) of all Makefile.in files to Makefile.am
  by using automake

- the libtool is now properly integrated with automake (the way we used it
  was rather hackish as the only official way how to use libtool is via
  automake

- the dynamic module loading was rewritten from a custom patchwork to libtool's
  libltdl (which includes the patchwork to support module loading on different
  systems internally)

- conversion of the unit test executor from kyua to automake parallel driver

- conversion of the system test executor from custom make/shell to automake
  parallel driver

- The GSSAPI has been refactored, the custom SPNEGO on the basis that
  all major KRB5/GSSAPI (mit-krb5, heimdal and Windows) implementations
  support SPNEGO mechanism.

- The various defunct tests from bin/tests have been removed:
  bin/tests/optional and bin/tests/pkcs11

- The text files generated from the MD files have been removed, the
  MarkDown has been designed to be readable by both humans and computers

- The xsl header is now generated by a simple sed command instead of
  perl helper

- The <irs/platform.h> header has been removed

- cleanups of configure.ac script to make it more simpler, addition of multiple
  macros (there's still work to be done though)

- the tarball can now be prepared with `make dist`

- the system tests are partially able to run in oot build

Here's a list of unfinished work that needs to be completed in subsequent merge
requests:

- `make distcheck` doesn't yet work (because of system tests oot run is not yet
  finished)

- documentation is not yet built, there's a different merge request with docbook
  to sphinx-build rst conversion that needs to be rebased and adapted on top of
  the automake

- msvc build is non functional yet and we need to decide whether we will just
  cross-compile bind9 using mingw-w64 or fix the msvc build

- contributed dlz modules are not included neither in the autoconf nor automake
  • Loading branch information
oerdnj committed Apr 21, 2020
1 parent 4df5a58 commit 978c7b2
Show file tree
Hide file tree
Showing 596 changed files with 4,300 additions and 21,769 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
*.gcno
*.la
*.lo
*.log
*.o
*.orig
*.plist/ # ccc-analyzer store its results in .plist directories
*.rej
*.so
*.trs
*_test
*.ipch # vscode/intellisense precompiled header
*~
Expand Down Expand Up @@ -63,3 +65,4 @@ timestamp
/cppcheck.results
/tsan
/util/check-make-install
/INSTALL
96 changes: 15 additions & 81 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ variables:
TARBALL_EXTENSION: xz

stages:
- autoconf
- precheck
- build
- unit
Expand Down Expand Up @@ -168,7 +169,7 @@ stages:
.autoconf: &autoconf_job
<<: *release_branch_triggering_rules
<<: *base_image
stage: precheck
stage: autoconf
script:
- autoreconf -fi
artifacts:
Expand All @@ -186,6 +187,7 @@ stages:
--with-json-c \
--prefix=$HOME/.local \
--without-make-clean \
--with-python=python3 \
$EXTRA_CONFIGURE \
|| cat config.log

Expand Down Expand Up @@ -253,8 +255,8 @@ stages:
- *setup_interfaces
- *setup_softhsm
script:
- ( cd bin/tests/system && make -j${TEST_PARALLEL_JOBS:-1} -k test V=1 )
- test -s bin/tests/system/systests.output
- ( cd bin/tests/system && make -j${TEST_PARALLEL_JOBS:-1} -k check V=1 ) || cat bin/tests/system/test-suite.log
- test -s bin/tests/system/test-suite.log

.system_test: &system_test_job
<<: *system_test_common
Expand Down Expand Up @@ -313,9 +315,7 @@ stages:
before_script:
- *setup_softhsm
script:
- make unit
after_script:
- *kyua_report_html
- cd lib && make -j${TEST_PARALLEL_JOBS:-1} -k check V=1

.unit_test: &unit_test_job
<<: *unit_test_common
Expand All @@ -328,16 +328,12 @@ stages:
<<: *unit_test_common
allow_failure: true
after_script:
- *kyua_report_html
- 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

.cppcheck_args: &run_cppcheck |
Expand Down Expand Up @@ -377,7 +373,6 @@ autoreconf:
misc:
<<: *precheck_job
script:
- sh util/check-ans-prereq.sh
- sh util/checklibs.sh > checklibs.out
- sh util/tabify-changes < CHANGES > CHANGES.tmp
- diff -urNap CHANGES CHANGES.tmp
Expand Down Expand Up @@ -451,16 +446,14 @@ tarball-create:
stage: precheck
<<: *base_image
script:
- source version
- export BIND_DIRECTORY="bind-${MAJORVER}.${MINORVER}.${PATCHVER}${RELEASETYPE}${RELEASEVER}"
- git archive --prefix="${BIND_DIRECTORY}/" --output="${BIND_DIRECTORY}.tar" HEAD
- mkdir "${BIND_DIRECTORY}"
- echo "SRCID=$(git rev-list --max-count=1 HEAD | cut -b1-7)" > "${BIND_DIRECTORY}/srcid"
- tar --append --file="${BIND_DIRECTORY}.tar" "${BIND_DIRECTORY}/srcid"
- ${TARBALL_COMPRESSOR} "${BIND_DIRECTORY}.tar"
- *configure
- make -j${BUILD_PARALLEL_JOBS:-1} dist V=1
artifacts:
paths:
- bind-*.tar.${TARBALL_EXTENSION}
- bind-*.tar.*
needs:
- job: autoreconf
artifacts: true
only:
- tags

Expand All @@ -477,6 +470,7 @@ docs:
needs:
- job: autoreconf
artifacts: true
allow_failure: true
artifacts:
paths:
- doc/arm/
Expand Down Expand Up @@ -524,7 +518,7 @@ gcc:centos6:amd64:
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON}"
EXTRA_CONFIGURE: "--with-libidn2 --disable-warn-error"
EXTRA_CONFIGURE: "--with-libidn2 --disable-warn-error --without-python"
<<: *centos_centos6_amd64_image
<<: *build_job

Expand Down Expand Up @@ -805,7 +799,7 @@ gcc:tumbleweed:amd64:
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON}"
EXTRA_CONFIGURE: "--with-libidn2"
EXTRA_CONFIGURE: "--with-libidn2 --with-python"
<<: *tumbleweed_latest_amd64_image
<<: *build_job

Expand Down Expand Up @@ -1152,77 +1146,17 @@ system:clang:openbsd6.6:amd64:
- schedules
- web

# Jobs for Visual Studio 2017 builds on Windows (amd64)

msvc:windows:amd64:
<<: *windows_build_job
<<: *default_triggering_rules
variables:
VSCONF: Release

system:msvc:windows:amd64:
<<: *windows_system_test_job
variables:
VSCONF: Release
needs:
- job: msvc:windows:amd64
artifacts: true

msvc-debug:windows:amd64:
<<: *windows_build_job
variables:
VSCONF: Debug
only:
- schedules
- tags
- web

system:msvc-debug:windows:amd64:
<<: *windows_system_test_job
variables:
VSCONF: Debug
needs:
- job: msvc-debug:windows:amd64
artifacts: true

# Job producing a release tarball

release:
<<: *base_image
stage: release
script:
# Determine BIND version
- source version
- export BIND_DIRECTORY="bind-${MAJORVER}.${MINORVER}.${PATCHVER}${RELEASETYPE}${RELEASEVER}"
# Remove redundant files and system test utilities from Windows build artifacts
- find Build/Release/ -name "*.pdb" -print -delete
- find Build/Debug/ \( -name "*.bsc" -o -name "*.idb" \) -print -delete
- find Build/ -regextype posix-extended -regex "Build/.*/($(find bin/tests/ -type f | sed -nE "s|^bin/tests(/system)?/win32/(.*)\.vcxproj$|\2|p" | paste -d"|" -s))\..*" -print -delete
# Create Windows zips
- openssl dgst -sha256 "${BIND_DIRECTORY}.tar.${TARBALL_EXTENSION}" | tee Build/Release/SHA256 Build/Debug/SHA256
- ( cd Build/Release; zip "../../BIND${BIND_DIRECTORY#bind-}.x64.zip" * )
- ( cd Build/Debug; zip "../../BIND${BIND_DIRECTORY#bind-}.debug.x64.zip" * )
# Prepare release tarball contents (tarballs + zips + documentation)
- mkdir -p release/doc/arm
- pushd release
- mv "../${BIND_DIRECTORY}.tar.${TARBALL_EXTENSION}" ../BIND*.zip .
- tar --extract --file="${BIND_DIRECTORY}.tar.${TARBALL_EXTENSION}"
- mv "${BIND_DIRECTORY}"/{CHANGES*,COPYRIGHT,LICENSE,README,srcid} .
- mv "${BIND_DIRECTORY}"/doc/arm/{Bv9ARM{*.html,.pdf},man.*,notes.{html,pdf,txt}} doc/arm/
- rm -rf "${BIND_DIRECTORY}"
- cp doc/arm/notes.html "RELEASE-NOTES-${BIND_DIRECTORY}.html"
- cp doc/arm/notes.pdf "RELEASE-NOTES-${BIND_DIRECTORY}.pdf"
- cp doc/arm/notes.txt "RELEASE-NOTES-${BIND_DIRECTORY}.txt"
- popd
# Create release tarball
- tar --create --file="${CI_COMMIT_TAG}.tar.gz" --gzip release/
needs:
- job: tarball-create
artifacts: true
- job: msvc:windows:amd64
artifacts: true
- job: msvc-debug:windows:amd64
artifacts: true
only:
- tags
artifacts:
Expand Down
53 changes: 53 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
Mark Andrews
Andreas Gustafsson
Evan Hunt
Brian Wellington
Bob Halley
David Lawrence
Michael Graff
Michael Sawyer
Ondřej Surý
James Brister
Tatuya JINMEI 神明達哉
Francis Dupont
Michał Kępień
Danny Mayer
Mukund Sivaraman
Jeremy C. Reed
William King
Stephen Morris
Witold Kręcicki
Curtis Blackburn
Scott Mann
Rob Austein
Jim Reid
Eric Luce
Olafur Gudmundsson
Stephen Jacob
Damien Neil
Tony Finch
Jakob Schlyter
Petr Menšík
Vernon Schryver
Matt Nelson
Shane Kerr
Paul Ebersman
Ray Bellis
Shawn Routhier
Ben Cottrell
Tomas Hozza
johnd
Bill Parker
李昶
Kevin Chen
Jonathan Casey
Mary Stahl
Mathieu Arnold
David Hankins
Paul Hoffman
Paul Vixie
Brian Conry
Anay Panvalkar
colleen
Robert Edmonds
João Damas
79 changes: 0 additions & 79 deletions CODE_OF_CONDUCT

This file was deleted.

Loading

0 comments on commit 978c7b2

Please sign in to comment.