From 7c8e3db6eb9e423d5a595fff0782b0b26409cf6e Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Thu, 9 Jan 2025 17:41:41 +0100 Subject: [PATCH 01/15] Enabled subdir-objects in AM_INIT_AUTOMAKE This way we don't get annoying warnings like: ``` warning: source file '$(srcdir)/../../libutils/statistics.c' is in a subdirectory, but option 'subdir-objects' is disabled ``` Ticket: CFE-2780 Signed-off-by: Lars Erik Wik --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index ab9699009b..b632f7dc88 100644 --- a/configure.ac +++ b/configure.ac @@ -69,7 +69,7 @@ m4_define(SERIAL_TESTS, m4_bmatch(AUTOMAKE_VERSION, [^1\.\([0-9]\|1[0-1]\)\(\.\| AC_MSG_RESULT(AUTOMAKE_VERSION) -AM_INIT_AUTOMAKE([tar-ustar] SERIAL_TESTS) +AM_INIT_AUTOMAKE([tar-ustar] SERIAL_TESTS [subdir-objects]) AM_MAINTAINER_MODE([enable]) m4_divert_text([DEFAULTS], [: "${AR_FLAGS=cr}"]) From fe27d6d80174c206b404736abac75eab8d228632 Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Fri, 10 Jan 2025 10:19:19 +0100 Subject: [PATCH 02/15] Fixed warning AC_PROG_LEX without either yywrap or noyywrap is obsolete Ticket: CFE-2780 Signed-off-by: Lars Erik Wik --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index b632f7dc88..7d3d423327 100644 --- a/configure.ac +++ b/configure.ac @@ -132,7 +132,7 @@ m4_ifdef([LT_INIT], [AC_DISABLE_STATIC AC_PROG_LIBTOOL]) -AM_PROG_LEX +AC_PROG_LEX(noyywrap) AC_PROG_YACC AC_PROG_INSTALL AC_PATH_PROG([PERL], [perl]) From 604145a84c5208594011599cc37744aebd1b7844 Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Fri, 10 Jan 2025 10:26:23 +0100 Subject: [PATCH 03/15] Ran autoupdate on configure.ac Ticket: CFE-2780 Signed-off-by: Lars Erik Wik --- configure.ac | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 7d3d423327..e37851a28d 100644 --- a/configure.ac +++ b/configure.ac @@ -29,7 +29,7 @@ dnl # Run ./autogen.sh to build configure script dnl # dnl ########################################################################## -AC_PREREQ(2.63) +AC_PREREQ([2.71]) m4_define([cfversion_from_env], m4_normalize(m4_esyscmd([echo $EXPLICIT_VERSION]))) m4_define([cfversion_from_file], m4_normalize(m4_esyscmd([cat CFVERSION]))) @@ -46,7 +46,7 @@ m4_ifval(cfversion_from_env, [ ]) -AC_INIT(cfengine, cfversion) +AC_INIT([cfengine],[cfversion]) AC_CONFIG_SRCDIR([libpromises/generic_agent.c]) AC_CANONICAL_TARGET @@ -126,11 +126,11 @@ AC_EXEEXT dnl GCC specific flags m4_include([m4/cf3_gcc_flags.m4]) -# Use either new LT_INIT or old AC_DISABLE_STATIC/AC_PROG_LIBTOOL macros +# Use either new LT_INIT or old AC_DISABLE_STATIC/LT_INIT macros m4_ifdef([LT_INIT], [LT_INIT([disable-static])], [AC_DISABLE_STATIC - AC_PROG_LIBTOOL]) + LT_INIT]) AC_PROG_LEX(noyywrap) AC_PROG_YACC @@ -768,8 +768,29 @@ AC_CHECK_HEADERS(sys/jail.h, [], [], [AC_INCLUDES_DEFAULT AC_CHECK_HEADERS(net/route.h netinet/in.h netinet/ip.h) -AC_HEADER_STDC -AC_HEADER_TIME +m4_warn([obsolete], +[The preprocessor macro `STDC_HEADERS' is obsolete. + Except in unusual embedded environments, you can safely include all + ISO C90 headers unconditionally.])dnl +# Autoupdate added the next two lines to ensure that your configure +# script's behavior did not change. They are probably safe to remove. +AC_CHECK_INCLUDES_DEFAULT +AC_PROG_EGREP + +m4_warn([obsolete], +[Update your code to rely only on HAVE_SYS_TIME_H, +then remove this warning and the obsolete code below it. +All current systems provide time.h; it need not be checked for. +Not all systems provide sys/time.h, but those that do, all allow +you to include it and time.h simultaneously.])dnl +AC_CHECK_HEADERS_ONCE([sys/time.h]) +# Obsolete code to be removed. +if test $ac_cv_header_sys_time_h = yes; then + AC_DEFINE([TIME_WITH_SYS_TIME],[1],[Define to 1 if you can safely include both + and . This macro is obsolete.]) +fi +# End of obsolete code. + AC_HEADER_SYS_WAIT AC_HEADER_DIRENT AC_HEADER_STDBOOL From c5f534d82a9109b2af46e2fd0a182972d5ac0144 Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Fri, 10 Jan 2025 10:46:37 +0100 Subject: [PATCH 04/15] Fixed warnings after autoupdate Ticket: CFE-2780 Signed-off-by: Lars Erik Wik --- configure.ac | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/configure.ac b/configure.ac index e37851a28d..86bf501c0b 100644 --- a/configure.ac +++ b/configure.ac @@ -767,30 +767,6 @@ AC_CHECK_HEADERS(sys/jail.h, [], [], [AC_INCLUDES_DEFAULT ]) AC_CHECK_HEADERS(net/route.h netinet/in.h netinet/ip.h) - -m4_warn([obsolete], -[The preprocessor macro `STDC_HEADERS' is obsolete. - Except in unusual embedded environments, you can safely include all - ISO C90 headers unconditionally.])dnl -# Autoupdate added the next two lines to ensure that your configure -# script's behavior did not change. They are probably safe to remove. -AC_CHECK_INCLUDES_DEFAULT -AC_PROG_EGREP - -m4_warn([obsolete], -[Update your code to rely only on HAVE_SYS_TIME_H, -then remove this warning and the obsolete code below it. -All current systems provide time.h; it need not be checked for. -Not all systems provide sys/time.h, but those that do, all allow -you to include it and time.h simultaneously.])dnl -AC_CHECK_HEADERS_ONCE([sys/time.h]) -# Obsolete code to be removed. -if test $ac_cv_header_sys_time_h = yes; then - AC_DEFINE([TIME_WITH_SYS_TIME],[1],[Define to 1 if you can safely include both - and . This macro is obsolete.]) -fi -# End of obsolete code. - AC_HEADER_SYS_WAIT AC_HEADER_DIRENT AC_HEADER_STDBOOL From d4c373ecd2618425183653dae2f5b77abe8cc846 Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Fri, 10 Jan 2025 11:05:03 +0100 Subject: [PATCH 05/15] Fixed warning `AC_LANG_C' is obsolete `AC_LANG_C` is expanded from `ACX_PTHREAD` which is also obsolete. It was renamed to `AX_PTHREAD`. We may have to install `autoconf-archive` as a dependency in order to get this macro. ``` configure.ac:134: warning: The macro `AC_LANG_C' is obsolete. configure.ac:134: You should run autoupdate. ./lib/autoconf/c.m4:72: AC_LANG_C is expanded from... m4/acinclude.m4:3: ACX_PTHREAD is expanded from... ``` Ticket: CFE-2780 Signed-off-by: Lars Erik Wik --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 86bf501c0b..b97a6bc80b 100644 --- a/configure.ac +++ b/configure.ac @@ -163,7 +163,7 @@ if test "x$with_pthreads" != x && test "x$with_pthreads" != "xyes" && test "x$wi CPPFLAGS="-I$with_pthreads/include $CPPFLAGS" fi -ACX_PTHREAD([], +AX_PTHREAD([], [AC_MSG_ERROR(pthread-compatible library is required to build CFEngine)]) CC="$PTHREAD_CC" From 03e0625ae4661ca4ae787fade4ad2039eb708c65 Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Fri, 10 Jan 2025 11:27:21 +0100 Subject: [PATCH 06/15] Fixed warning non-POSIX variable name Ticket: CFE-2780 Signed-off-by: Lars Erik Wik --- examples/Makefile.am | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/Makefile.am b/examples/Makefile.am index 662351a12e..ad5f6a53bf 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -29,10 +29,10 @@ MAINTAINERCLEANFILES = Makefile.in mdate-sh # only re-run the outputs for examples that already have an example_output block remake: - perl ./remake_outputs.pl $(shell grep -l example_output $(dist_examples_DATA)) + perl ./remake_outputs.pl `shell grep -l example_output $(dist_examples_DATA)` recheck: - perl ./remake_outputs.pl -c $(shell grep -l example_output $(dist_examples_DATA)) + perl ./remake_outputs.pl -c `shell grep -l example_output $(dist_examples_DATA)` recheck_verbose: - perl ./remake_outputs.pl -v -c $(shell grep -l example_output $(dist_examples_DATA)) + perl ./remake_outputs.pl -v -c `shell grep -l example_output $(dist_examples_DATA)` From dbbd2bea5f3dc040a9d0b1320b32daab251b62f6 Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Fri, 10 Jan 2025 11:45:09 +0100 Subject: [PATCH 07/15] Added autoconf-archive dependency to get AX_PTHREAD Ticket: CFE-2780 Signed-off-by: Lars Erik Wik --- .github/workflows/acceptance_tests.yml | 2 +- .github/workflows/asan_unit_tests.yml | 2 +- .github/workflows/codeql.yml | 2 +- .github/workflows/job-static-check.yml | 2 +- .github/workflows/macos_unit_tests.yml | 2 +- .github/workflows/shellcheck.yml | 2 +- .github/workflows/unit_tests.yml | 2 +- .github/workflows/valgrind.yml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/acceptance_tests.yml b/.github/workflows/acceptance_tests.yml index 60132de1f0..d13c4eb86f 100644 --- a/.github/workflows/acceptance_tests.yml +++ b/.github/workflows/acceptance_tests.yml @@ -11,7 +11,7 @@ jobs: with: submodules: recursive - name: Install dependencies - run: sudo apt-get update -y && sudo apt-get install -y libssl-dev libpam0g-dev liblmdb-dev byacc curl libyaml-dev librsync-dev + run: sudo apt-get update -y && sudo apt-get install -y libssl-dev libpam0g-dev liblmdb-dev byacc curl libyaml-dev librsync-dev autoconf-archive - name: Run autotools / configure run: ./autogen.sh --enable-debug - name: Compile and link (make) diff --git a/.github/workflows/asan_unit_tests.yml b/.github/workflows/asan_unit_tests.yml index 5958e1998d..a226a78cf4 100644 --- a/.github/workflows/asan_unit_tests.yml +++ b/.github/workflows/asan_unit_tests.yml @@ -11,7 +11,7 @@ jobs: with: submodules: recursive - name: Install dependencies - run: sudo apt-get update -y && sudo apt-get install -y libssl-dev libpam0g-dev liblmdb-dev byacc curl librsync-dev + run: sudo apt-get update -y && sudo apt-get install -y libssl-dev libpam0g-dev liblmdb-dev byacc curl librsync-dev autoconf-archive - name: Run autotools / configure run: ./autogen.sh --enable-debug - name: Compile and link (make) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 016276a748..9256c23c8f 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -41,7 +41,7 @@ jobs: - name: Install dependencies (C) if: ${{ matrix.language == 'cpp' }} - run: sudo apt-get update -y && sudo apt-get install -y libssl-dev libpam0g-dev liblmdb-dev byacc curl librsync-dev + run: sudo apt-get update -y && sudo apt-get install -y libssl-dev libpam0g-dev liblmdb-dev byacc curl librsync-dev autoconf-archive - name: Build (C) if: ${{ matrix.language == 'cpp' }} diff --git a/.github/workflows/job-static-check.yml b/.github/workflows/job-static-check.yml index e0d1481138..46feed344f 100644 --- a/.github/workflows/job-static-check.yml +++ b/.github/workflows/job-static-check.yml @@ -41,7 +41,7 @@ jobs: sudo apt-get install -y dpkg-dev debhelper g++ libncurses6 pkg-config \ build-essential libpam0g-dev fakeroot gcc make autoconf buildah \ liblmdb-dev libacl1-dev libcurl4-openssl-dev libyaml-dev libxml2-dev \ - libssl-dev libpcre2-dev librsync-dev + libssl-dev libpcre2-dev librsync-dev autoconf-archive - name: Run Autogen run: NO_CONFIGURE=1 PROJECT=community ./buildscripts/build-scripts/autogen diff --git a/.github/workflows/macos_unit_tests.yml b/.github/workflows/macos_unit_tests.yml index d79037f56c..2445ae460b 100644 --- a/.github/workflows/macos_unit_tests.yml +++ b/.github/workflows/macos_unit_tests.yml @@ -11,7 +11,7 @@ jobs: with: submodules: recursive - name: Install dependencies - run: brew install lmdb automake openssl pcre2 autoconf libtool librsync + run: brew install lmdb automake openssl pcre2 autoconf libtool librsync autoconf-archive - name: Check tools run: command -v libtool && command -v automake && command -v autoconf - name: Check tools versions diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index b5de17ec7c..545b82a6d7 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -12,7 +12,7 @@ jobs: with: submodules: recursive - name: Install dependencies - run: sudo apt-get update -y && sudo apt-get install -y libssl-dev libpam0g-dev liblmdb-dev byacc curl shellcheck librsync-dev + run: sudo apt-get update -y && sudo apt-get install -y libssl-dev libpam0g-dev liblmdb-dev byacc curl shellcheck librsync-dev autoconf-archive - name: Run autotools / configure run: ./autogen.sh --enable-debug - name: Run shellcheck diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 8115a911b6..56dd0d09b7 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -12,7 +12,7 @@ jobs: with: submodules: recursive - name: Install dependencies - run: sudo apt-get update -y && sudo apt-get install -y libssl-dev libpam0g-dev liblmdb-dev byacc curl librsync-dev + run: sudo apt-get update -y && sudo apt-get install -y libssl-dev libpam0g-dev liblmdb-dev byacc curl librsync-dev autoconf-archive - name: Run autotools / configure run: ./autogen.sh --enable-debug - name: Compile and link (make) diff --git a/.github/workflows/valgrind.yml b/.github/workflows/valgrind.yml index 6b0f780708..31df388c72 100644 --- a/.github/workflows/valgrind.yml +++ b/.github/workflows/valgrind.yml @@ -27,7 +27,7 @@ jobs: path: masterfiles submodules: recursive - name: Install dependencies - run: sudo apt-get update -y && sudo apt-get install -y libssl-dev libpam0g-dev liblmdb-dev byacc curl libyaml-dev valgrind librsync-dev + run: sudo apt-get update -y && sudo apt-get install -y libssl-dev libpam0g-dev liblmdb-dev byacc curl libyaml-dev valgrind librsync-dev autoconf-archive - name: Run autotools / configure run: ./autogen.sh --enable-debug --with-systemd-service - name: Compile and link (make) From aabb2797f206877d0ab3ddcf03c9da5a312a4fe0 Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Fri, 10 Jan 2025 11:53:10 +0100 Subject: [PATCH 08/15] Added autoconf-archive as dependency to static and valgrind checks autoconf-archive is needed for `AX_PTHREAD` macro Ticket: CFE-2780 Signed-off-by: Lars Erik Wik --- tests/static-check/run.sh | 2 +- tests/valgrind-check/Containerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/static-check/run.sh b/tests/static-check/run.sh index 913a65688f..676d1bd8ec 100755 --- a/tests/static-check/run.sh +++ b/tests/static-check/run.sh @@ -19,7 +19,7 @@ fi function create_image() { local c=$(buildah from -q $BASE_IMG) buildah run $c -- dnf -q -y install "@C Development Tools and Libraries" clang cppcheck which diffutils file >/dev/null 2>&1 - buildah run $c -- dnf -q -y install pcre-devel pcre2-devel openssl-devel libxml2-devel pam-devel lmdb-devel libacl-devel libyaml-devel curl-devel libvirt-devel librsync-devel >/dev/null 2>&1 + buildah run $c -- dnf -q -y install pcre-devel pcre2-devel openssl-devel libxml2-devel pam-devel lmdb-devel libacl-devel libyaml-devel curl-devel libvirt-devel librsync-devel autoconf-archive >/dev/null 2>&1 buildah run $c -- dnf clean all >/dev/null 2>&1 # Copy checksum of this file into container. We use the checksum to detect diff --git a/tests/valgrind-check/Containerfile b/tests/valgrind-check/Containerfile index cd4a35a749..2cad055615 100644 --- a/tests/valgrind-check/Containerfile +++ b/tests/valgrind-check/Containerfile @@ -1,7 +1,7 @@ FROM ubuntu:22.04 AS build RUN DEBIAN_FRONTEND=noninteractive apt-get update -y RUN DEBIAN_FRONTEND=noninteractive apt-get install -y libssl-dev libxml2-dev libpam0g-dev liblmdb-dev libacl1-dev libpcre2-dev librsync-dev -RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python3 git flex bison byacc automake make autoconf libtool valgrind +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python3 git flex bison byacc automake make autoconf libtool valgrind autoconf-archive COPY masterfiles masterfiles COPY core core WORKDIR core From 9af95385e3cf26954f401cc4aeefe14e1d5038b2 Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Fri, 10 Jan 2025 12:02:38 +0100 Subject: [PATCH 09/15] Put AC_PREREQ back to version 2.63 We need configure.ac to be supported on older platforms Ticket: CFE-2780 Signed-off-by: Lars Erik Wik --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index b97a6bc80b..6d55b98186 100644 --- a/configure.ac +++ b/configure.ac @@ -29,7 +29,7 @@ dnl # Run ./autogen.sh to build configure script dnl # dnl ########################################################################## -AC_PREREQ([2.71]) +AC_PREREQ([2.63]) m4_define([cfversion_from_env], m4_normalize(m4_esyscmd([echo $EXPLICIT_VERSION]))) m4_define([cfversion_from_file], m4_normalize(m4_esyscmd([cat CFVERSION]))) From ba693ca41ae7110d08b62fd440b91a30ed9c0166 Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Fri, 10 Jan 2025 14:11:38 +0100 Subject: [PATCH 10/15] Fixed non-POSIX variable name warning ``` tests/acceptance/Makefile.am:103: warning: wildcard [0-9]*: non-POSIX variable name tests/acceptance/Makefile.am:103: (probably a GNU make extension) ``` Ticket: CFE-2780 Signed-off-by: Lars Erik Wik --- tests/acceptance/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/acceptance/Makefile.am b/tests/acceptance/Makefile.am index cc77519761..2dbd8924ce 100644 --- a/tests/acceptance/Makefile.am +++ b/tests/acceptance/Makefile.am @@ -100,7 +100,7 @@ EXTRA_DIST = default.cf.sub dcs.cf.sub plucked.cf.sub run_with_server.cf.sub \ root-MD5=617eb383deffef843ea856b129d0a423.priv # Recursively include all tests in the dist tarball and set proper permissions -EXTRA_DIST += $(wildcard [0-9]*) +EXTRA_DIST += `wildcard [0-9]*` dist-hook: chmod -R go-w $(distdir) From e509fc6c747ead4521716a58f6801857873235c7 Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Fri, 10 Jan 2025 14:29:29 +0100 Subject: [PATCH 11/15] Reapply "Fix init_script_test_helper not being cleaned properly." Looks like 520144f11a2267734a88e1aaf4aa9edd333d0dac was an attempt to fix init_script_test_helper from not being cleaned properly. This commit was reverted in ebd97bd29beee6de6b82d4565e588e86adf31127, and another attempt was added in 9dc759f448a202ee413814aa4b64d365df4fbc85. However, the revert actually removed the entire `init_script_test_helper` binary from being compiled. This reapplying the first fix, and combining it with the second fix should do the trick. Found this while trying to clear the warning: ``` tests/unit/Makefile.am:402: warning: variable 'init_script_test_helper_SOURCES' is defined but no program or tests/unit/Makefile.am:402: library has 'init_script_test_helper' as canonical name (possible typo) ``` This reverts commit ebd97bd29beee6de6b82d4565e588e86adf31127. --- tests/unit/Makefile.am | 1 + tests/unit/init_script_test.sh | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am index 5349375bad..47704da1fa 100644 --- a/tests/unit/Makefile.am +++ b/tests/unit/Makefile.am @@ -402,6 +402,7 @@ nfs_test_LDADD = ../../libpromises/libpromises.la libtest.la init_script_test_helper_SOURCES = init_script_test_helper.c init_script_test.sh: init_script_test_helper CLEANFILES += init_script_test_helper +noinst_PROGRAMS += init_script_test_helper endif EXTRA_DIST += init_script_test_helper.c EXTRA_DIST += init_script_test.sh diff --git a/tests/unit/init_script_test.sh b/tests/unit/init_script_test.sh index f105ede55d..dddcc8587b 100755 --- a/tests/unit/init_script_test.sh +++ b/tests/unit/init_script_test.sh @@ -91,10 +91,10 @@ fi # Fail on any error. set -e -cp init_script_test_helper $CFTEST_PREFIX/bin/cf-test-execd -cp init_script_test_helper $CFTEST_PREFIX/bin/cf-test-serverd -cp init_script_test_helper $CFTEST_PREFIX/bin/cf-test-monitord -cp init_script_test_helper $CFTEST_PREFIX/bin/cf-test-agent +cp .libs/init_script_test_helper $CFTEST_PREFIX/bin/cf-test-execd +cp .libs/init_script_test_helper $CFTEST_PREFIX/bin/cf-test-serverd +cp .libs/init_script_test_helper $CFTEST_PREFIX/bin/cf-test-monitord +cp .libs/init_script_test_helper $CFTEST_PREFIX/bin/cf-test-agent touch $CFTEST_PREFIX/inputs/promises.cf From 32872f6699aa43f7e3946f104f607208f46beaf3 Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Fri, 10 Jan 2025 17:10:21 +0100 Subject: [PATCH 12/15] Remove references to `top_sourcedir` in Makefile.am I don't know why, but this was necessary, and all the other tests does this. I was getting the following errors after enabling subdir-objects in `AM_INIT_AUTOMAKE`: ``` Makefile:1843: ../../cf-upgrade/.deps/cf_upgrade_test-alloc-mini.Po: No such file or directory Makefile:1844: ../../cf-upgrade/.deps/cf_upgrade_test-command_line.Po: No such file or directory Makefile:1845: ../../cf-upgrade/.deps/cf_upgrade_test-configuration.Po: No such file or directory Makefile:1846: ../../cf-upgrade/.deps/cf_upgrade_test-log.Po: No such file or directory Makefile:1847: ../../cf-upgrade/.deps/cf_upgrade_test-process.Po: No such file or directory Makefile:1848: ../../cf-upgrade/.deps/cf_upgrade_test-update.Po: No such file or directory ``` Ticket: CFE-2780 Signed-off-by: Lars Erik Wik --- tests/unit/Makefile.am | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am index 47704da1fa..88f0a00b28 100644 --- a/tests/unit/Makefile.am +++ b/tests/unit/Makefile.am @@ -381,17 +381,17 @@ verify_databases_test_LDADD = ../../cf-agent/libcf-agent.la libtest.la iteration_test_SOURCES = iteration_test.c cf_upgrade_test_SOURCES = cf_upgrade_test.c \ - $(top_srcdir)/cf-upgrade/alloc-mini.c \ - $(top_srcdir)/cf-upgrade/alloc-mini.h \ - $(top_srcdir)/cf-upgrade/command_line.c \ - $(top_srcdir)/cf-upgrade/command_line.h \ - $(top_srcdir)/cf-upgrade/configuration.c \ - $(top_srcdir)/cf-upgrade/configuration.h \ - $(top_srcdir)/cf-upgrade/log.c $(top_srcdir)/cf-upgrade/log.h \ - $(top_srcdir)/cf-upgrade/process.c $(top_srcdir)/cf-upgrade/process.h \ - $(top_srcdir)/cf-upgrade/update.c \ - $(top_srcdir)/cf-upgrade/update.h -cf_upgrade_test_CPPFLAGS = -I$(top_srcdir)/cf-upgrade -I$(top_srcdir)/libntech/libutils -I$(top_srcdir) + ../../cf-upgrade/alloc-mini.c \ + ../../cf-upgrade/alloc-mini.h \ + ../../cf-upgrade/command_line.c \ + ../../cf-upgrade/command_line.h \ + ../../cf-upgrade/configuration.c \ + ../../cf-upgrade/configuration.h \ + ../../cf-upgrade/log.c ../../cf-upgrade/log.h \ + ../../cf-upgrade/process.c ../../cf-upgrade/process.h \ + ../../cf-upgrade/update.c \ + ../../cf-upgrade/update.h +cf_upgrade_test_CPPFLAGS = -I../../cf-upgrade -I../../libntech/libutils -I../../ cf_upgrade_test_LDADD = libtest.la ../../libntech/libcompat/libcompat.la if !NT From 4799d028155e935bc02a3d7a9edc0c27bf6ddd0d Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Mon, 13 Jan 2025 10:41:25 +0100 Subject: [PATCH 13/15] Removed linking libraries to init_script_test_helper The `init_script_test_helper` binary does not require any libraries. The libraries `libpromises.la` and `libtest.la` were previously added through the `LDADD` variable in the top of Makefile.am. Ticket: CFE-2780 Signed-off-by: Lars Erik Wik --- tests/unit/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am index 88f0a00b28..938e153096 100644 --- a/tests/unit/Makefile.am +++ b/tests/unit/Makefile.am @@ -399,6 +399,7 @@ check_PROGRAMS += nfs_test nfs_test_SOURCES = nfs_test.c nfs_test_LDADD = ../../libpromises/libpromises.la libtest.la +init_script_test_helper_LDADD = init_script_test_helper_SOURCES = init_script_test_helper.c init_script_test.sh: init_script_test_helper CLEANFILES += init_script_test_helper From ffb68bea5dc2bd0734d2200676bd3cfd000332be Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Mon, 13 Jan 2025 11:07:24 +0100 Subject: [PATCH 14/15] Removed reference to $(srcdir) in test/load/Makefile.am For some reason it causes the following error ``` 10:58:19 Makefile:598: ../../libpromises/.deps/lastseen.Po: No such file or directory 10:58:19 make[3]: *** No rule to make target '../../libpromises/.deps/lastseen.Po'. Stop. ``` in bootstrap_pr while doing `make dist` in Jenkins. Ticket: CFE-2780 Signed-off-by: Lars Erik Wik --- tests/load/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/load/Makefile.am b/tests/load/Makefile.am index 89c5762d81..29a820f79b 100644 --- a/tests/load/Makefile.am +++ b/tests/load/Makefile.am @@ -54,8 +54,8 @@ db_load_LDADD = ../unit/libdb.la lastseen_load_SOURCES = lastseen_load.c \ - $(srcdir)/../../libpromises/lastseen.c \ - $(srcdir)/../../libntech/libutils/statistics.c + ../../libpromises/lastseen.c \ + ../../libntech/libutils/statistics.c lastseen_load_LDADD = ../unit/libdb.la ../../libpromises/libpromises.la endif From 5a52be7d0be4eba40b831d24303f9c02abbcbe91 Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Mon, 13 Jan 2025 11:14:19 +0100 Subject: [PATCH 15/15] Revert "Fixed non-POSIX variable name warning" This reverts commit ba693ca41ae7110d08b62fd440b91a30ed9c0166. --- tests/acceptance/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/acceptance/Makefile.am b/tests/acceptance/Makefile.am index 2dbd8924ce..cc77519761 100644 --- a/tests/acceptance/Makefile.am +++ b/tests/acceptance/Makefile.am @@ -100,7 +100,7 @@ EXTRA_DIST = default.cf.sub dcs.cf.sub plucked.cf.sub run_with_server.cf.sub \ root-MD5=617eb383deffef843ea856b129d0a423.priv # Recursively include all tests in the dist tarball and set proper permissions -EXTRA_DIST += `wildcard [0-9]*` +EXTRA_DIST += $(wildcard [0-9]*) dist-hook: chmod -R go-w $(distdir)