From 866a469e5a565b0ef5197107172c1d1f396c7b8d Mon Sep 17 00:00:00 2001 From: Antonio Alvarez Feijoo Date: Wed, 10 Apr 2024 11:07:32 +0200 Subject: [PATCH 1/2] test: add missing header to test.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` ../src/shared/tests.h:361:28: error: implicit declaration of function ‘fork’ [-Werror=implicit-function-declaration] 361 | int _pid = fork(); \ | ^~~~ ../src/test/test-macro.c:1114:9: note: in expansion of macro ‘ASSERT_SIGNAL’ 1114 | ASSERT_SIGNAL(ASSERT_OK(-1), SIGABRT); | ^~~~~~~~~~~~~ ../src/shared/tests.h:369:25: error: implicit declaration of function ‘_exit’ [-Werror=implicit-function-declaration] 369 | _exit(EXIT_SUCCESS); \ | ^~~~~ ../src/test/test-macro.c:1114:9: note: in expansion of macro ‘ASSERT_SIGNAL’ 1114 | ASSERT_SIGNAL(ASSERT_OK(-1), SIGABRT); | ^~~~~~~~~~~~~ ../src/shared/tests.h:369:25: warning: incompatible implicit declaration of built-in function ‘_exit’ [-Wbuiltin-declaration-mismatch] 369 | _exit(EXIT_SUCCESS); \ | ^~~~~ ../src/test/test-macro.c:1114:9: note: in expansion of macro ‘ASSERT_SIGNAL’ 1114 | ASSERT_SIGNAL(ASSERT_OK(-1), SIGABRT); | ^~~~~~~~~~~~~ ../src/shared/tests.h:369:25: warning: incompatible implicit declaration of built-in function ‘_exit’ [-Wbuiltin-declaration-mismatch] 369 | _exit(EXIT_SUCCESS); \ | ^~~~~ ../src/test/test-macro.c:1115:9: note: in expansion of macro ‘ASSERT_SIGNAL’ 1115 | ASSERT_SIGNAL(ASSERT_OK(-ENOANO), SIGABRT); | ^~~~~~~~~~~~~ ../src/test/test-macro.c:1119:21: error: implicit declaration of function ‘getpid’; did you mean ‘getpt’? [-Werror=implicit-function-declaration] 1119 | ASSERT_TRUE(getpid()); | ^~~~~~ ``` Follow-up for #32189 --- src/shared/tests.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/shared/tests.h b/src/shared/tests.h index 07e05bf267..1572ca7102 100644 --- a/src/shared/tests.h +++ b/src/shared/tests.h @@ -3,6 +3,7 @@ #include #include +#include #include "sd-daemon.h" From 2ad44c22febb8d8f2332a037bf1854e5eb746d60 Mon Sep 17 00:00:00 2001 From: Antonio Alvarez Feijoo Date: Wed, 10 Apr 2024 11:08:25 +0200 Subject: [PATCH 2/2] tools/check-version-history: skip test if lxml is not installed ``` ================================= 1070/1408 ================================== test: systemd:dist / check-version-history start time: 07:55:05 duration: 0.03s result: exit status 1 ... ----------------------------------- stderr ----------------------------------- Traceback (most recent call last): File "/mnt/work/systemd/upstream-fork/main/tools/check-version-history.py", line 6, in import lxml.etree as tree ModuleNotFoundError: No module named 'lxml' ============================================================================== ``` Follow-up for 3691e7fce70149ed19edc5d3003e2d7c936c147a --- tools/check-version-history.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/check-version-history.py b/tools/check-version-history.py index c4d4b3e1ec..d4a87df355 100644 --- a/tools/check-version-history.py +++ b/tools/check-version-history.py @@ -3,7 +3,12 @@ import os import sys -import lxml.etree as tree + +try: + import lxml.etree as tree +except ImportError as e: + print(str(e), file=sys.stderr) + sys.exit(77) _parser = tree.XMLParser(resolve_entities=False) tree.set_default_parser(_parser)