From badecc0f9139a2c506c1cd2f474da213aee260d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ayd=C4=B1n=20Mercan?= Date: Wed, 19 Mar 2025 16:11:25 +0300 Subject: [PATCH] fixup! replace the build system with meson --- .gitlab-ci.yml | 2 ++ ci/cross_version_config_test.sh | 4 +-- ci/generate-release.sh | 13 +++++++ meson.build | 54 +++++++++------------------- meson.format | 1 + util/generate-stress-test-configs.py | 4 ++- 6 files changed, 36 insertions(+), 42 deletions(-) mode change 100644 => 100755 ci/cross_version_config_test.sh create mode 100755 ci/generate-release.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 736fa8b208..51b7ff131c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -736,6 +736,8 @@ cross-version-config-tests: - meson compile -C build system-test-init system-test-dependencies - *find_pytest - bash ci/cross_version_config_test.sh + - > + "$PYTEST" --setup-only --junit-xml="$CI_PROJECT_DIR"/junit.xml -n "${TEST_PARALLEL_JOBS:-1}" needs: - job: ci-variables artifacts: true diff --git a/ci/cross_version_config_test.sh b/ci/cross_version_config_test.sh old mode 100644 new mode 100755 index b9cd75d31d..b513861d28 --- a/ci/cross_version_config_test.sh +++ b/ci/cross_version_config_test.sh @@ -44,12 +44,10 @@ rm -r dlzexternal rm -r dyndb cp ${CI_PROJECT_DIR}/bin/tests/system/isctest/vars/basic.py isctest/vars/basic.py -sed -i "s|f\"{AC_VARS\['TOP_BUILDDIR'\]}|\"$CI_PROJECT_DIR|g" isctest/vars/basic.py cp ${CI_PROJECT_DIR}/bin/tests/system/isctest/vars/build.py isctest/vars/build.py cp -r ${CI_PROJECT_DIR}/build/bin/tests/system/isctest/vars/.build_vars isctest/vars/.build_vars # Run the setup phase of all system tests in the most recently tagged BIND 9 # release using the binaries built for the current BIND 9 version. This # intends to detect obvious backward compatibility issues with the latter. - -"$PYTEST" --setup-only --junit-xml="$CI_PROJECT_DIR"/junit.xml -n "${TEST_PARALLEL_JOBS:-1}" +sed -i "s|f\"{AC_VARS\['TOP_BUILDDIR'\]}|\"$CI_PROJECT_DIR|g" isctest/vars/basic.py diff --git a/ci/generate-release.sh b/ci/generate-release.sh new file mode 100755 index 0000000000..de8987937b --- /dev/null +++ b/ci/generate-release.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# 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. + diff --git a/meson.build b/meson.build index e4eab0f3ca..e73d0bde5b 100644 --- a/meson.build +++ b/meson.build @@ -386,36 +386,6 @@ if host_machine.system() == 'sunos' and cc.get_id() == 'gcc' ) endif -## IPv6 - -# meson_version (>=1.0.0) : compiler.has_type, compiler.has_member -ipv6_test = ''' -#include -#include -#include - -int main(void) { - struct sockaddr_in6 sin6; - struct in6_addr in6; - struct in6_pktinfo *in6_pi; - struct sockaddr_storage storage; - in6 = in6addr_any; - in6 = in6addr_loopback; - sin6.sin6_scope_id = 0; - return 0; -} -''' - -if not cc.compiles(ipv6_test, args: sys_defines, name: 'usage of IPv6') - error('IPv6 support is mandatory') -endif - -foreach sym : ['in6addr_any', 'in6addr_loopback'] - if not cc.has_header_symbol('netinet/in.h', sym, args: sys_defines) - error('IPv6 support is mandatory') - endif -endforeach - config.set( 'HAVE_PTHREAD_MUTEX_ADAPTIVE_NP', cc.has_header_symbol('pthread.h', 'PTHREAD_MUTEX_ADAPTIVE_NP'), @@ -497,9 +467,11 @@ endforeach config.set10('ENABLE_LEAK_DETECTION', leak_opt.enabled()) ## Query Tracing + +# meson_version (>=1.1.0) : enable_if in feature object query_trace_opt = 'query' in trace_logging single_trace_opt = 'single' in trace_logging -if query_trace_opt +if query_trace_opt or developer_mode config.set('WANT_QUERYTRACE', true) config.set('WANT_SINGLETRACE', single_trace_opt) elif single_trace_opt @@ -766,9 +738,11 @@ endif config.set('HAVE_LMDB', lmdb_dep.found()) ## zlib + +# meson_version (>=1.1.0) : enable_if in feature object zlib_dep = null_dep -if zlib_opt.allowed() - zlib_dep = dependency('zlib', required: zlib_opt) +if zlib_opt.allowed() or developer_mode + zlib_dep = dependency('zlib', required: zlib_opt.enabled() or developer_mode) endif config.set('HAVE_ZLIB', zlib_dep.found()) @@ -804,8 +778,14 @@ config.set('HAVE_LIBSYSTEMD', systemd_dep.found()) ## cmocka cmocka_dep = null_dep -if cmocka_opt.allowed() - cmocka_dep = dependency('cmocka', version: '>=1.1.3', required: cmocka_opt) + +# meson_version (>=1.1.0) : enable_if in feature object +if cmocka_opt.allowed() or developer_mode + cmocka_dep = dependency( + 'cmocka', + version: '>=1.1.3', + required: cmocka_opt.enabled() or developer_mode.enabled(), + ) endif config.set('HAVE_CMOCKA', cmocka_dep.found()) @@ -1677,9 +1657,7 @@ if doc_opt.allowed() ) endforeach - if man_pages != [] - install_man(man_pages) - endif + install_man(man_pages) if sphinx_build.found() meson.add_dist_script( diff --git a/meson.format b/meson.format index c6e46f2a63..cbacfb2399 100644 --- a/meson.format +++ b/meson.format @@ -11,3 +11,4 @@ group_arg_value = true indent_before_comments = ' ' +no_single_comma_function = false diff --git a/util/generate-stress-test-configs.py b/util/generate-stress-test-configs.py index 7a016bc339..136afbba9d 100755 --- a/util/generate-stress-test-configs.py +++ b/util/generate-stress-test-configs.py @@ -87,6 +87,7 @@ for mode, protocol, platform in itertools.product(modes, protocols, platforms): job_platform = "freebsd:amd64" compiler_binary = "clang" flame_binary = "/usr/local/bin/flame" + extra_configure = "--native-file ci/freebsd.ini" else: if "amd64" in platform: job_platform = "linux:amd64" @@ -94,6 +95,7 @@ for mode, protocol, platform in itertools.product(modes, protocols, platforms): job_platform = "linux:arm64" compiler_binary = "gcc" flame_binary = "/usr/bin/flame" + extra_configure = "" if mode == "rpz": default_traffic_rate = 1500 @@ -110,7 +112,7 @@ for mode, protocol, platform in itertools.product(modes, protocols, platforms): "variables": { "CC": compiler_binary, "CFLAGS": f"{cflags_common}", - "EXTRA_CONFIGURE": "--native-file ci/freebsd.ini", + "EXTRA_CONFIGURE": f"{extra_configure}", "EXPECTED_TCP_RESPONSE_RATE": expected_tcp_response_rate, "FLAME": flame_binary, "MODE": mode,