fix: dev: Assorted Meson fixes

Merge branch 'mnowak/meson-ci-fixes' into 'main'

See merge request isc-projects/bind9!12167
This commit is contained in:
Michal Nowak 2026-06-30 19:01:50 +02:00
commit f27acdfd5a
11 changed files with 52 additions and 37 deletions

View file

@ -429,11 +429,14 @@ stages:
- find -name 'tsan.*' -exec "$PYTHON" "$CI_PROJECT_DIR"/bind9-qa/ci/parse_tsan.py {} \;
.check_readline_setup: &check_readline_setup
- if [[ -n "${WITHOUT_LIBEDIT}" ]]; then
! grep "^#define HAVE_LIBEDIT" build/config.h;
elif [[ -n "${WITH_LIBEDIT}" ]]; then
grep -e "^#define HAVE_LIBEDIT" build/config.h;
fi
# WITH_LIBEDIT/WITHOUT_LIBEDIT are always-set global variables, so inspect
# the actual per-job configure flags to decide what to assert.
- case " ${EXTRA_CONFIGURE} " in
*" -Dline=disabled "*)
! grep -e "^#define HAVE_LIBEDIT" build/config.h;;
*" -Dline=enabled "*)
grep -e "^#define HAVE_LIBEDIT" build/config.h;;
esac
.list_installed_package_versions: &list_installed_package_versions
- echo -e "\e[0Ksection_start:`date +%s`:installed_packages_section[collapsed=true]\r\e[0KHeader of the installed packages collapsible section"

View file

@ -47,7 +47,7 @@ foreach name, prog : {
endforeach
# Run a script to copy required files to the source directory in order to make
# pytest work and find the compiled files. This is executed on every incovation
# pytest work and find the compiled files. This is executed on every invocation
# of the compile command, so the latest build is always used for system tests.
custom_target(
'system-test-init',

View file

@ -22,7 +22,6 @@ manrst_srcset.add(when: 'HAVE_DNSTAP', if_true: files('dnstap-read.rst'))
manrst_srcset.add(
files(
'arpaname.rst',
'dnstap-read.rst',
'mdig.rst',
'named-journalprint.rst',
'named-makejournal.rst',

View file

@ -56,7 +56,7 @@ with (build / "meson-info" / "intro-targets.json").open() as f:
["nm", target["filename"][0]],
stdin=None,
stdout=subprocess.PIPE,
timeout=1,
timeout=60,
check=True,
shell=False,
)

View file

@ -91,6 +91,7 @@ if fs.is_file('arpaname.1.in')
'rndc-confgen.8.in',
'rndc.8.in',
'rndc.conf.5.in',
'synthrecord.8.in',
'tsig-keygen.8.in',
),
)

View file

@ -16,6 +16,8 @@ dns_header_depfiles += files(
'amtrelay_260.h',
'avc_258.c',
'avc_258.h',
'brid_68.c',
'brid_68.h',
'caa_257.c',
'caa_257.h',
'cdnskey_60.c',
@ -38,12 +40,16 @@ dns_header_depfiles += files(
'doa_259.h',
'ds_43.c',
'ds_43.h',
'dsync_66.c',
'dsync_66.h',
'eui48_108.c',
'eui48_108.h',
'eui64_109.c',
'eui64_109.h',
'gpos_27.c',
'gpos_27.h',
'hhit_67.c',
'hhit_67.h',
'hinfo_13.c',
'hinfo_13.h',
'hip_55.c',
@ -136,6 +142,8 @@ dns_header_depfiles += files(
'txt_16.h',
'uri_256.c',
'uri_256.h',
'wallet_262.c',
'wallet_262.h',
'x25_19.c',
'x25_19.h',
'zonemd_63.c',

View file

@ -273,13 +273,12 @@ env = environment(
)
# Meson defines these variables in unit tests when not set
test_env = environment(
{
'ASAN_OPTIONS': asan_options,
'TSAN_OPTIONS': tsan_options,
'UBSAN_OPTIONS': ubsan_options,
},
)
test_env_vars = {
'ASAN_OPTIONS': asan_options,
'TSAN_OPTIONS': tsan_options,
'UBSAN_OPTIONS': ubsan_options,
}
test_env = environment(test_env_vars)
### Configuration
config = configuration_data()
@ -461,7 +460,7 @@ if cpu_family in ['arm', 'aarch64']
instruction_test.format('yield'),
name: 'usage of yield instruction',
)
config.set('HAVE_SPARC_PAUSE', 1)
config.set('HAVE_ARM_YIELD', 1)
endif
elif cpu_family in ['sparc', 'sparc64']
if cc.compiles(
@ -726,7 +725,7 @@ endif
# not add it automatically - we need to add it explicitly in such case.
if urcu_dep[1].version().version_compare('<0.13.0')
urcu_dep += cc.find_library('liburcu-common')
urcu_dep += cc.find_library('urcu-common')
endif
foreach h : [
@ -956,7 +955,7 @@ dtrace_header = generator(
arguments: ['-s', '@INPUT@', '-h', '-o', '@OUTPUT@'],
)
# Acutally, dtrace probes are still built with macOS.
# Actually, dtrace probes are still built with macOS.
# macOS flavored dtrace doesn't recognize the -G option and
# only uses headers.
#
@ -964,8 +963,7 @@ dtrace_header = generator(
# to be able to disable it. You can just not use the probes.
config.set(
'HAVE_DTRACE',
dtrace.full_path() != dtrace_shim
and build_machine.system() != 'darwin',
dtrace.full_path() != dtrace_shim and host_machine.system() != 'darwin',
)
cc.has_header('sys/sdt.h', required: tracing_opt)
assert(
@ -1993,8 +1991,8 @@ if doc_opt.allowed()
rst_epilog = f'''.. |rndc_conf| replace:: ``@sysconfdir@/rndc.conf``
.. |rndc_key| replace:: ``@sysconfdir@/rndc.key``
.. |named_conf| replace:: ``@sysconfdir@/named.key``
.. |named_pid| replace:: ``@runstatedir@/named.key``
.. |named_conf| replace:: ``@sysconfdir@/named.conf``
.. |named_pid| replace:: ``@runstatedir@/named.pid``
.. |session_key| replace:: ``@runstatedir@/session.key``
'''

View file

@ -100,16 +100,21 @@ foreach unit : isc_test
suites = ['isc', 'cmocka']
timeout = 300
unit_env = test_env
if unit in flaky_isc_test
suites += 'flaky'
# Pass FLAKY and TIMEOUT to the test wrapper so it can retry appropriately
test_env.set('FLAKY', '1')
test_env.set('TIMEOUT', timeout.to_string())
# Pass FLAKY and TIMEOUT to the test wrapper so it can retry
# appropriately. Build a fresh environment instead of mutating the
# shared test_env, which meson stores by reference and would otherwise
# leak these variables into every other test.
unit_env = environment(
test_env_vars + {'FLAKY': '1', 'TIMEOUT': timeout.to_string()},
)
endif
test(
unit,
test_bin,
env: test_env,
env: unit_env,
suite: suites,
timeout: timeout,
workdir: meson.current_source_dir(),

View file

@ -13,7 +13,7 @@
set -e
if [ -z "$MESON_DIST_ROOT" ] || [ -z "$MESON_SOURCE_ROOT" ]; then
if [ -z "$MESON_DIST_ROOT" ] || [ -z "$MESON_SOURCE_ROOT" ] || [ -z "$MESON_BUILD_ROOT" ]; then
echo "meson-dist-package.sh must be run inside meson dist!"
exit 1
fi
@ -41,19 +41,19 @@ generate_man_pages() {
"${MESON_SOURCE_ROOT}/doc/man" \
"${MESON_BUILD_ROOT}/dist-man"
for man in ${MESON_BUILD_ROOT}/dist-man/man1/*; do
for man in "${MESON_BUILD_ROOT}"/dist-man/man1/*; do
[ -f "${man}" ] || continue
cp $man "${MESON_DIST_ROOT}/doc/man/${man##*/}.in"
cp "$man" "${MESON_DIST_ROOT}/doc/man/${man##*/}.in"
done
for man in ${MESON_BUILD_ROOT}/dist-man/man5/*; do
for man in "${MESON_BUILD_ROOT}"/dist-man/man5/*; do
[ -f "${man}" ] || continue
cp $man "${MESON_DIST_ROOT}/doc/man/${man##*/}.in"
cp "$man" "${MESON_DIST_ROOT}/doc/man/${man##*/}.in"
done
for man in ${MESON_BUILD_ROOT}/dist-man/man8/*; do
for man in "${MESON_BUILD_ROOT}"/dist-man/man8/*; do
[ -f "${man}" ] || continue
cp $man "${MESON_DIST_ROOT}/doc/man/${man##*/}.in"
cp "$man" "${MESON_DIST_ROOT}/doc/man/${man##*/}.in"
done
}

View file

@ -28,8 +28,9 @@ done
echo "files("
pushd ${dir:-.} >/dev/null
for file in ./*.${extension:-c}; do
shopt -s nullglob
pushd "${dir:-.}" >/dev/null
for file in ./*."${extension:-c}"; do
echo " '${file:2}',"
done
popd >/dev/null

View file

@ -16,5 +16,5 @@ if [ -z "$BIND_SOURCE_ROOT" ] || [ -z "$BIND_BUILD_ROOT" ]; then
exit 1
fi
cp $BIND_BUILD_ROOT/bin/tests/system/isctest/vars/.build_vars/TOP_BUILDDIR $BIND_SOURCE_ROOT/bin/tests/system/isctest/vars/.build_vars/TOP_BUILDDIR
cp $BIND_BUILD_ROOT/bin/tests/system/ifconfig.sh $BIND_SOURCE_ROOT/bin/tests/system/ifconfig.sh
cp "$BIND_BUILD_ROOT/bin/tests/system/isctest/vars/.build_vars/TOP_BUILDDIR" "$BIND_SOURCE_ROOT/bin/tests/system/isctest/vars/.build_vars/TOP_BUILDDIR"
cp "$BIND_BUILD_ROOT/bin/tests/system/ifconfig.sh" "$BIND_SOURCE_ROOT/bin/tests/system/ifconfig.sh"