2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-22 10:10:06 +00:00

Use -release instead of -version-info for internal library SONAMEs

The BIND 9 libraries are considered to be internal only and hence the
API and ABI changes a lot.  Keeping track of the API/ABI changes takes
time and it's a complicated matter as the safest way to make everything
stable would be to bump any library in the dependency chain as in theory
if libns links with libdns, and a binary links with both, and we bump
the libdns SOVERSION, but not the libns SOVERSION, the old libns might
be loaded by binary pulling old libdns together with new libdns loaded
by the binary.  The situation gets even more complicated with loading
the plugins that have been compiled with few versions old BIND 9
libraries and then dynamically loaded into the named.

We are picking the safest option possible and usable for internal
libraries - instead of using -version-info that has only a weak link to
BIND 9 version number, we are using -release libtool option that will
embed the corresponding BIND 9 version number into the library name.

That means that instead of libisc.so.1701 (as an example) the library
will now be named libisc-9.17.10.so.
This commit is contained in:
Ondřej Surý 2021-01-12 13:38:44 +01:00 committed by Michał Kępień
parent 7939e7fd71
commit c605d75ea5
19 changed files with 7 additions and 278 deletions

View File

@ -1504,39 +1504,6 @@ stress:recursive:freebsd12:amd64:
variables:
- $CI_COMMIT_TAG || ($BIND_STRESS_TEST_OS =~ /freebsd/i && $BIND_STRESS_TEST_MODE =~ /recursive/i && $BIND_STRESS_TEST_ARCH =~ /amd64/i)
# ABI check
abi-check:
<<: *base_image
stage: build
needs:
- job: autoreconf
artifacts: true
variables:
CC: gcc
CFLAGS: "${CFLAGS_COMMON} -Og"
EXTRA_CONFIGURE: "--enable-dnstap --with-libidn2"
BIND_BASELINE_VERSION: v9_17_9
script:
- *configure
- make -j${BUILD_PARALLEL_JOBS:-1} V=1
- git clone --branch "${BIND_BASELINE_VERSION}" --depth 1 https://gitlab.isc.org/isc-projects/bind9.git refbind
- cd refbind/
- autoreconf -fi
- *configure
- make -j${BUILD_PARALLEL_JOBS:-1} V=1
- cd ..
- util/api-checker.sh . refbind
artifacts:
paths:
- "*-lib*.html"
- "*-lib*.txt"
- "abi-*.dump"
expire_in: "1 week"
only:
- main@isc-projects/bind9
- /^v9_[1-9][0-9]$/@isc-projects/bind9
gcov:
<<: *base_image
<<: *default_triggering_rules

View File

@ -71,17 +71,6 @@ AS_IF([test "$cross_compiling" = no],
[AM_MAINTAINER_MODE(m4_ifset([bind_SRCID],[enable],[disable]))],
[AM_MAINTAINER_MODE([disable])])
# Set the library versions
# https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
AX_BIND9_LIB_VERSION([bind9])
AX_BIND9_LIB_VERSION([dns])
AX_BIND9_LIB_VERSION([irs])
AX_BIND9_LIB_VERSION([isc])
AX_BIND9_LIB_VERSION([isccc])
AX_BIND9_LIB_VERSION([isccfg])
AX_BIND9_LIB_VERSION([ns])
#
# Enable system extensions to C and POSIX
#

View File

@ -28,6 +28,4 @@ libbind9_la_LIBADD = \
libbind9_la_LDFLAGS = \
$(AM_LDFLAGS) \
$(libbind9_VERSION_INFO)
EXTRA_DIST = api
-release "$(PACKAGE_VERSION)"

View File

@ -1,16 +0,0 @@
# LIBINTERFACE ranges
# 9.6: 50-59, 110-119
# 9.7: 60-79
# 9.8: 80-89, 120-129
# 9.9: 90-109, 170-179
# 9.9-sub: 130-139, 150-159, 200-209
# 9.10: 140-149, 190-199
# 9.10-sub: 180-189
# 9.11: 160-169,1100-1199
# 9.12: 1200-1299
# 9.13/9.14: 1300-1499
# 9.15/9.16: 1500-1699
# 9.17/9.18: 1700-1899
LIBINTERFACE = 1701
LIBREVISION = 4
LIBAGE = 0

View File

@ -22,7 +22,6 @@ gen$(BUILD_EXEEXT): gen.c gen-unix.h
$(CC_FOR_BUILD) -g -I. $(GEN_NEED_OPTARG) $(srcdir)/gen.c -o $@
EXTRA_DIST = \
api \
dnstap.proto \
gen.c \
gen-unix.h \
@ -282,7 +281,7 @@ libdns_la_CPPFLAGS = \
libdns_la_LDFLAGS = \
$(AM_LDFLAGS) \
$(libdns_VERSION_INFO)
-release "$(PACKAGE_VERSION)"
libdns_la_LIBADD = \
$(LIBISC_LIBS) \

View File

@ -1,16 +0,0 @@
# LIBINTERFACE ranges
# 9.6: 50-59, 110-119
# 9.7: 60-79
# 9.8: 80-89, 120-129
# 9.9: 90-109, 170-179
# 9.9-sub: 130-139, 150-159, 200-209
# 9.10: 140-149, 190-199
# 9.10-sub: 180-189
# 9.11: 160-169,1100-1199
# 9.12: 1200-1299
# 9.13/9.14: 1300-1499
# 9.15/9.16: 1500-1699
# 9.17/9.18: 1700-1899
LIBINTERFACE = 1709
LIBREVISION = 0
LIBAGE = 0

View File

@ -24,11 +24,8 @@ libirs_la_LIBADD = \
libirs_la_LDFLAGS = \
$(AM_LDFLAGS) \
$(libirs_VERSION_INFO)
-release "$(PACKAGE_VERSION)"
if HAVE_CMOCKA
SUBDIRS = tests
endif
EXTRA_DIST = api

View File

@ -1,16 +0,0 @@
# LIBINTERFACE ranges
# 9.6: 50-59, 110-119
# 9.7: 60-79
# 9.8: 80-89, 120-129
# 9.9: 90-109, 170-179
# 9.9-sub: 130-139, 150-159, 200-209
# 9.10: 140-149, 190-199
# 9.10-sub: 180-189
# 9.11: 160-169,1100-1199
# 9.12: 1200-1299
# 9.13/9.14: 1300-1499
# 9.15/9.16: 1500-1699
# 9.17/9.18: 1700-1899
LIBINTERFACE = 1701
LIBREVISION = 0
LIBAGE = 0

View File

@ -229,7 +229,7 @@ libisc_la_CPPFLAGS = \
libisc_la_LDFLAGS = \
$(AM_LDFLAGS) \
$(libisc_VERSION_INFO)
-release "$(PACKAGE_VERSION)"
libisc_la_LIBADD = \
$(LIBUV_LIBS) \
@ -255,5 +255,3 @@ endif HAVE_LIBXML2
if HAVE_CMOCKA
SUBDIRS = tests
endif
EXTRA_DIST = api

View File

@ -1,16 +0,0 @@
# LIBINTERFACE ranges
# 9.6: 50-59, 110-119
# 9.7: 60-79
# 9.8: 80-89, 120-129
# 9.9: 90-109, 170-179
# 9.9-sub: 130-139, 150-159, 200-209
# 9.10: 140-149, 190-199
# 9.10-sub: 180-189
# 9.11: 160-169,1100-1199
# 9.12: 1200-1299
# 9.13/9.14: 1300-1499
# 9.15/9.16: 1500-1699
# 9.17/9.18: 1700-1899
LIBINTERFACE = 1707
LIBREVISION = 1
LIBAGE = 0

View File

@ -36,10 +36,8 @@ libisccc_la_LIBADD = \
libisccc_la_LDFLAGS = \
$(AM_LDFLAGS) \
$(libisccc_VERSION_INFO)
-release "$(PACKAGE_VERSION)"
if HAVE_CMOCKA
SUBDIRS = tests
endif
EXTRA_DIST = api

View File

@ -1,16 +0,0 @@
# LIBINTERFACE ranges
# 9.6: 50-59, 110-119
# 9.7: 60-79
# 9.8: 80-89, 120-129
# 9.9: 90-109, 170-179
# 9.9-sub: 130-139, 150-159, 200-209
# 9.10: 140-149, 190-199
# 9.10-sub: 180-189
# 9.11: 160-169,1100-1199
# 9.12: 1200-1299
# 9.13/9.14: 1300-1499
# 9.15/9.16: 1500-1699
# 9.17/9.18: 1700-1899
LIBINTERFACE = 1703
LIBREVISION = 0
LIBAGE = 0

View File

@ -32,10 +32,8 @@ libisccfg_la_LIBADD = \
libisccfg_la_LDFLAGS = \
$(AM_LDFLAGS) \
$(libisccfg_VERSION_INFO)
-release "$(PACKAGE_VERSION)"
if HAVE_CMOCKA
SUBDIRS = tests
endif
EXTRA_DIST = api

View File

@ -1,16 +0,0 @@
# LIBINTERFACE ranges
# 9.6: 50-59, 110-119
# 9.7: 60-79
# 9.8: 80-89, 120-129
# 9.9: 90-109, 170-179
# 9.9-sub: 130-139, 150-159, 200-209
# 9.10: 140-149, 190-199
# 9.10-sub: 180-189
# 9.11: 160-169,1100-1199
# 9.12: 1200-1299
# 9.13/9.14: 1300-1499
# 9.15/9.16: 1500-1699
# 9.17/9.18: 1700-1899
LIBINTERFACE = 1704
LIBREVISION = 0
LIBAGE = 0

View File

@ -56,10 +56,8 @@ libns_la_LIBADD = \
libns_la_LDFLAGS = \
$(AM_LDFLAGS) \
$(libns_VERSION_INFO)
-release "$(PACKAGE_VERSION)"
if HAVE_CMOCKA
SUBDIRS = tests
endif
EXTRA_DIST = api

View File

@ -1,16 +0,0 @@
# LIBINTERFACE ranges
# 9.6: 50-59, 110-119
# 9.7: 60-79
# 9.8: 80-89, 120-129
# 9.9: 90-109, 170-179
# 9.9-sub: 130-139, 150-159, 200-209
# 9.10: 140-149, 190-199
# 9.10-sub: 180-189
# 9.11: 160-169,1100-1199
# 9.12: 1200-1299
# 9.13/9.14: 1300-1499
# 9.15/9.16: 1500-1699
# 9.17/9.18: 1700-1899
LIBINTERFACE = 1707
LIBREVISION = 0
LIBAGE = 0

View File

@ -1,10 +0,0 @@
AC_DEFUN([AX_BIND9_LIB_VERSION],
[AS_IF([test -z "$SED"],
[AC_PROG_SED])
AS_IF([test -z "$SED"],
[AC_MSG_ERROR([sed not found, but required, set \$SED to sed])])
ax_bind9_lib$1_current=`$SED -n "s,^LIBINTERFACE = \(.*\),\1,p" "$srcdir/lib/$1/api"`
ax_bind9_lib$1_revision=`$SED -n "s,^LIBREVISION = \(.*\),\1,p" "$srcdir/lib/$1/api"`
ax_bind9_lib$1_age=`$SED -n "s,^LIBAGE = \(.*\),\1,p" "$srcdir/lib/$1/api"`
AC_SUBST([lib$1_VERSION_INFO],["-version-info $ax_bind9_lib$1_current:$ax_bind9_lib$1_revision:$ax_bind9_lib$1_age]")
])

View File

@ -1,83 +0,0 @@
#!/bin/bash
#
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
set -e
# Exit if program $1 is not found in PATH.
check_program() {
if ! command -v "${1}" > /dev/null 2>&1; then
echo "'${1}' not found in PATH" >&2
exit 1
fi
}
# Check that we were spawned with two arguments and that these arguments are two
# different directories.
check_args() {
if [ ${#} -ne 2 ] || [ ! -d "${1}" ] || [ ! -d "${2}" ] || [ "${1}" = "${2}" ]; then
echo "Usage:"
echo ""
echo " ${0} <TESTDIR> <REFDIR>"
echo ""
echo "Generate API compatibility reports for BIND libraries."
echo ""
echo " <TESTDIR> is a directory with current (new) BIND version"
echo " <REFDIR> is a directory with reference (old) BIND version"
exit 1
fi
}
check_args "${@}"
TESTBIND="${1}"
REFBIND="${2}"
# Ensure the required tools are available in PATH.
check_program abi-dumper
check_program abi-compliance-checker
check_program git
check_program w3m
# Find all libraries which have designated 'api' file and
# generate ABI dump file for them.
while read -r SO; do
APIFILE="$(dirname "${SO}")/../api"
APIFILE_DIR=$(dirname "${APIFILE}")
GIT_HEAD_REV=$(git -C "${APIFILE_DIR}" rev-parse HEAD | cut -c 1-10)
GIT_HEAD_UNIX_TIME=$(git -C "${APIFILE_DIR}" log -1 --format=%ct HEAD)
# Get LIBINTERFACE, LIBREVISION, LIBAGE from the 'api' file.
eval "$(grep -v "^#" "${APIFILE}" | tr -d " ")"
VERSION="${LIBINTERFACE}.${LIBREVISION}.${LIBAGE}-${GIT_HEAD_UNIX_TIME}-${GIT_HEAD_REV}"
abi-dumper "${SO}" -o abi-"$(basename "${SO}" .so)-${VERSION}".dump -lver "${VERSION}"
done < <(find "${TESTBIND}"/lib/*/.libs/ "${REFBIND}"/lib/*/.libs/ -name '*.so' ! -name '*-nosymtbl*')
# Generate HTML API compatibility reports for all libraries.
find . -maxdepth 1 -name 'abi-*.dump' | sort | while read -r OLD; read -r NEW; do
SONAME=${OLD/.\/abi-/}
SONAME=${SONAME/-*/}
if abi-compliance-checker -l "${SONAME}" -old "${OLD}" -new "${NEW}"; then
REPORT_PREFIX="PASS"
else
echo "***** Compatibility problems detected"
REPORT_PREFIX="WARN"
fi
OLD_REPORT_PATH="$(find "compat_reports/${SONAME}" -name '*.html')"
NEW_REPORT_PATH="${REPORT_PREFIX}-${SONAME}.html"
mv "${OLD_REPORT_PATH}" "${NEW_REPORT_PATH}"
echo
done
# Generate TXT API compatibility reports from HTML reports for all BIND libraries.
echo "Generate TXT API compatibility reports from HTML reports for all BIND libraries:"
while read -r HTMLREPORT; do
TXTREPORT="${HTMLREPORT/.html/.txt}"
echo " w3m: ${HTMLREPORT} -> ${TXTREPORT}"
w3m -dump -cols 75 -O ascii -T text/html "${HTMLREPORT}" > "${TXTREPORT}"
done < <(find . -maxdepth 1 -name '*-lib*.html')

View File

@ -1274,7 +1274,6 @@
./fuzz/isc_lex_gettoken.c C 2020,2021
./fuzz/libfuzzer.sh SH 2020,2021
./fuzz/main.c C 2018,2019,2020,2021
./lib/bind9/api X 2001,2006,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021
./lib/bind9/check.c C 2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021
./lib/bind9/getaddresses.c C 2001,2002,2004,2005,2007,2014,2015,2016,2017,2018,2019,2020,2021
./lib/bind9/include/bind9/check.h C 2001,2004,2005,2006,2007,2016,2018,2019,2020,2021
@ -1286,7 +1285,6 @@
./lib/bind9/win32/libbind9.vcxproj.user X 2013,2018,2019,2020,2021
./lib/dns/acl.c C 1999,2000,2001,2002,2004,2005,2006,2007,2008,2009,2011,2013,2014,2016,2017,2018,2019,2020,2021
./lib/dns/adb.c C 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021
./lib/dns/api X 1999,2000,2001,2006,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021
./lib/dns/badcache.c C 2014,2015,2016,2018,2019,2020,2021
./lib/dns/byaddr.c C 2000,2001,2002,2003,2004,2005,2007,2009,2013,2016,2017,2018,2019,2020,2021
./lib/dns/cache.c C 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021
@ -1742,7 +1740,6 @@
./lib/dns/zonekey.c C 2001,2003,2004,2005,2007,2016,2018,2019,2020,2021
./lib/dns/zoneverify.c C 2018,2019,2020,2021
./lib/dns/zt.c C 1999,2000,2001,2002,2004,2005,2006,2007,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021
./lib/irs/api X 2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021
./lib/irs/include/irs/resconf.h C 2009,2014,2016,2018,2019,2020,2021
./lib/irs/resconf.c C 2009,2011,2012,2014,2015,2016,2017,2018,2019,2020,2021
./lib/irs/tests/resconf_test.c C 2016,2018,2019,2020,2021
@ -1770,7 +1767,6 @@
./lib/irs/win32/libirs.vcxproj.user X 2014,2018,2019,2020,2021
./lib/irs/win32/resconf.c C 2018,2019,2020,2021
./lib/isc/aes.c C 2014,2016,2017,2018,2019,2020,2021
./lib/isc/api X 1999,2000,2001,2006,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021
./lib/isc/app.c C 1999,2000,2001,2002,2003,2004,2005,2007,2008,2009,2013,2014,2015,2016,2017,2018,2019,2020,2021
./lib/isc/assertions.c C 1997,1998,1999,2000,2001,2004,2005,2007,2008,2009,2015,2016,2018,2019,2020,2021
./lib/isc/astack.c C 2019,2020,2021
@ -2070,7 +2066,6 @@
./lib/isc/win32/unistd.h C 2000,2001,2004,2007,2008,2009,2016,2018,2019,2020,2021
./lib/isc/win32/win32os.c C 2002,2004,2007,2013,2014,2015,2016,2018,2019,2020,2021
./lib/isccc/alist.c C.NOM 2001,2004,2005,2007,2015,2016,2018,2019,2020,2021
./lib/isccc/api X 2001,2006,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021
./lib/isccc/base64.c C.NOM 2001,2004,2005,2007,2013,2016,2018,2019,2020,2021
./lib/isccc/cc.c C.NOM 2001,2002,2003,2004,2005,2006,2007,2012,2013,2014,2015,2016,2018,2019,2020,2021
./lib/isccc/ccmsg.c C.NOM 2001,2004,2005,2007,2016,2018,2019,2020,2021
@ -2095,7 +2090,6 @@
./lib/isccc/win32/libisccc.vcxproj.in X 2013,2014,2015,2016,2017,2018,2019,2020
./lib/isccc/win32/libisccc.vcxproj.user X 2013,2018,2019,2020,2021
./lib/isccfg/aclconf.c C 1999,2000,2001,2002,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021
./lib/isccfg/api X 2001,2006,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021
./lib/isccfg/dnsconf.c C 2009,2016,2018,2019,2020,2021
./lib/isccfg/include/isccfg/aclconf.h C 1999,2000,2001,2004,2005,2006,2007,2010,2011,2012,2013,2014,2016,2018,2019,2020,2021
./lib/isccfg/include/isccfg/cfg.h C 2000,2001,2002,2004,2005,2006,2007,2010,2013,2014,2015,2016,2018,2019,2020,2021
@ -2114,7 +2108,6 @@
./lib/isccfg/win32/libisccfg.vcxproj.filters.in X 2013,2014,2015,2016,2018,2019,2020
./lib/isccfg/win32/libisccfg.vcxproj.in X 2013,2014,2015,2016,2017,2018,2019,2020
./lib/isccfg/win32/libisccfg.vcxproj.user X 2013,2018,2019,2020,2021
./lib/ns/api X 2017,2018,2019,2020,2021
./lib/ns/client.c C 2017,2018,2019,2020,2021
./lib/ns/hooks.c C 2018,2019,2020,2021
./lib/ns/include/ns/client.h C 2017,2018,2019,2020,2021
@ -2188,7 +2181,6 @@
./util/COPYRIGHT.NOM X 2001,2004,2007,2016,2018,2019,2020,2021
./util/COPYRIGHT.PORTION X 1996,1997,1998,1999,2000,2001,2004,2007,2016,2018,2019,2020,2021
./util/COPYRIGHT.TOP X 2018,2019,2020,2021
./util/api-checker.sh SH 2020,2021
./util/bindkeys.pl PERL 2009,2010,2011,2012,2014,2016,2017,2018,2019,2020,2021
./util/branchsync.sh SH 2013,2016,2018,2019,2020,2021
./util/check-categories.sh SH 2015,2016,2017,2018,2019,2020,2021