From f0b649db0ab1d366ef622cc91486abec73ad6275 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 19 May 2026 09:23:57 +0200 Subject: [PATCH 01/26] tests/NIT/Makefile.am: check-NIT-devel: minimize nut_version.h regeneration attempts [#1711] Signed-off-by: Jim Klimov --- tests/NIT/Makefile.am | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/NIT/Makefile.am b/tests/NIT/Makefile.am index fb4c7f2eed..2836dc1bd9 100644 --- a/tests/NIT/Makefile.am +++ b/tests/NIT/Makefile.am @@ -58,10 +58,12 @@ check-NIT: $(abs_srcdir)/nit.sh # Make sure pre-requisites for NIT are fresh as we iterate check-NIT-devel: $(abs_srcdir)/nit.sh @dotMAKE@ + +@cd "$(top_builddir)" && $(MAKE) $(AM_MAKEFLAGS) -s generated-sources-with-a-touch +@cd .. && ( $(MAKE) $(AM_MAKEFLAGS) -s cppnit$(EXEEXT) || echo "OPTIONAL C++ test client test will be skipped" ) +@cd "$(top_builddir)/clients" && $(MAKE) $(AM_MAKEFLAGS) -s upsc$(EXEEXT) upscmd$(EXEEXT) upsrw$(EXEEXT) upsmon$(EXEEXT) +@cd "$(top_builddir)/server" && $(MAKE) $(AM_MAKEFLAGS) -s upsd$(EXEEXT) sockdebug$(EXEEXT) +@cd "$(top_builddir)/drivers" && $(MAKE) $(AM_MAKEFLAGS) -s dummy-ups$(EXEEXT) upsdrvctl$(EXEEXT) + +@cd "$(top_builddir)" && $(MAKE) $(AM_MAKEFLAGS) -s cleanup-touchfiles-for-generated-headers +@$(MAKE) $(AM_MAKEFLAGS) check-NIT # Allow to override with make/env vars; provide sensible defaults (see nit.sh): From edb53d68355fde295fe376f35518807df7ad0103 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 20 May 2026 14:58:59 +0200 Subject: [PATCH 02/26] clients/upsstats.c: ups_connect(): avoid potential NULL dereference in debug/failure printouts Signed-off-by: Jim Klimov --- clients/upsstats.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/clients/upsstats.c b/clients/upsstats.c index ab14107d51..7d4450970a 100644 --- a/clients/upsstats.c +++ b/clients/upsstats.c @@ -536,10 +536,13 @@ static void ups_connect(void) } if (currups && upscli_connect(&ups, hostname, port, UPSCLI_CONN_TRYSSL) < 0) - fprintf(stderr, "UPS [%s]: can't connect to server: %s\n", currups->sys, upscli_strerror(&ups)); + fprintf(stderr, "UPS [%s]: can't connect to server: %s\n", + currups ? NUT_STRARG(currups->sys) : "", + upscli_strerror(&ups)); lastups = currups; - upsdebug_call_finished2(": pick first device on newly connected data server [%s]", NUT_STRARG(currups->sys)); + upsdebug_call_finished2(": pick first device on newly connected data server [%s]", + currups ? NUT_STRARG(currups->sys) : ""); } static void do_hostlink(void) From 664ca6097d94f1eb9556015587cb47814ae37b35 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Mon, 25 May 2026 10:17:45 +0000 Subject: [PATCH 03/26] tests/NIT/nit.sh: check_NIT_certs_NSS(): fix the check for *.txt and *.db file patterns [#3331, #1711] Signed-off-by: Jim Klimov --- tests/NIT/nit.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/NIT/nit.sh b/tests/NIT/nit.sh index 889a31e925..97c66ed42f 100755 --- a/tests/NIT/nit.sh +++ b/tests/NIT/nit.sh @@ -994,8 +994,8 @@ check_NIT_certs_NSS() { exit 0 fi - ls -l "${TESTCERT_PATH_ROOTCA}"/*.txt || true - ls -l "${TESTCERT_PATH_ROOTCA}"/*.db || exit + ls -l "${2}/${3}"*.txt || true + ls -l "${2}/${3}"*.db || exit ) || die "Could not list NSS ${1} DB files" # NSS certutil error handling is complicated: anything unexpected means From 96267b88a27c964ce7fe60fc38be4b562951b8be Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 26 May 2026 10:15:13 +0000 Subject: [PATCH 04/26] configure.ac: if developer enables configure debug, only wipe DOCTESTDIR after confirming we can build docs we want Signed-off-by: Jim Klimov --- configure.ac | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index a87bd8093d..55070960d2 100644 --- a/configure.ac +++ b/configure.ac @@ -4263,7 +4263,6 @@ dnl not fail if we have no tools to generate it (so add to SKIP list). esac done -rm -rf "${DOCTESTDIR}" AS_IF([test x"${nut_enable_configure_debug}" = xyes], [ AC_MSG_NOTICE([(CONFIGURE-DEVEL-DEBUG) DOC_BUILD_LIST: '${DOC_BUILD_LIST}']) @@ -4271,6 +4270,11 @@ AS_IF([test x"${nut_enable_configure_debug}" = xyes], [ AC_MSG_NOTICE([(CONFIGURE-DEVEL-DEBUG) DOC_SKIPBUILD_LIST: '${DOC_SKIPBUILD_LIST}']) AC_MSG_NOTICE([(CONFIGURE-DEVEL-DEBUG) DOC_INSTALL_DISTED_MANS: '${DOC_INSTALL_DISTED_MANS}']) AC_MSG_NOTICE([(CONFIGURE-DEVEL-DEBUG) DOC_INSTALL_SELECTED_MANS: '${DOC_INSTALL_SELECTED_MANS}']) + AC_MSG_NOTICE([(CONFIGURE-DEVEL-DEBUG) This script's DOCTESTDIR: '${DOCTESTDIR}']) +],[ + dnl If we are debugging, and doc generation fails, we want the directory + dnl else remove it later (after confirming success) below + rm -rf "${DOCTESTDIR}" ]) case "${nut_with_doc}" in @@ -4315,6 +4319,11 @@ AM_CONDITIONAL(WITH_PDF_NONASCII_TITLES, [test x"$can_build_doc_pdf_nonascii_tit NUT_REPORT_FEATURE([would build specific documentation format(s)], [${nut_with_doc}], [${DOC_BUILD_LIST} ${DOC_INSTALL_SELECTED_MANS}], [WITH_DOCS], [Define to enable overall documentation generation], [-]) +AS_IF([test x"${nut_enable_configure_debug}" = xyes], [ + dnl Delayed clean-up after success of desired doc types: + rm -rf "${DOCTESTDIR}" +]) + # To cater for less portable make's, precalculate the target list # for "make check" in "docs/" here... DOC_CHECK_LIST="" From dd682c4e27a8be07e0d20e8e807b59b790720ed8 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 26 May 2026 10:25:17 +0000 Subject: [PATCH 05/26] docs/config-prereqs.txt, docs/nut.dict: revise with FreeBSD 15 lessons learned Signed-off-by: Jim Klimov --- docs/config-prereqs.txt | 12 ++++++++---- docs/nut.dict | 5 ++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/docs/config-prereqs.txt b/docs/config-prereqs.txt index e125c2f1df..5e15adc75c 100644 --- a/docs/config-prereqs.txt +++ b/docs/config-prereqs.txt @@ -874,16 +874,17 @@ tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,inode64) ---- ====== -FreeBSD 12.2 -~~~~~~~~~~~~ +FreeBSD 12.2 - 15.0 +~~~~~~~~~~~~~~~~~~~ -NOTE: As of 2024, this version is way beyond EOL -- packages have been -removed from mirrors. A discussion at +NOTE: As of 2024, the originally described OS version 12.2 is way beyond +EOL -- its packages have been removed from mirrors. A discussion at https://forums.freebsd.org/threads/easy-upgrading-from-12-2-rel-in-2024.92695/ touches on upgrades in such situation. An alternate mirror (that worked to bump the system to `openjdk17`, as of this writing in Nov 2024) can be found at https://mirror.sg.gs/freebsd-pkg/FreeBSD:12:amd64/quarterly/ and written into `/etc/pkg/FreeBSD.conf` similarly to existing `url` entry. +That deployment on NUT CI farm survived `freebsd-update` up to 15.0 however. Note that `PATH` for builds on BSD should include `/usr/local/...`: @@ -930,6 +931,9 @@ below. :; pkg install \ asciidoc source-highlight textproc/py-pygments dblatex +# If PDF refuses to build, e.g. a simple `echo '\bye' | pdftex` fails, try: +# :; mktexlsr && fmtutil-sys --all + # For CGI graph generation - massive packages (X11): :; pkg install \ libgd diff --git a/docs/nut.dict b/docs/nut.dict index f2636e289f..3d681f4557 100644 --- a/docs/nut.dict +++ b/docs/nut.dict @@ -1,4 +1,4 @@ -personal_ws-1.1 en 3764 utf-8 +personal_ws-1.1 en 3767 utf-8 AAC AAS ABI @@ -2191,6 +2191,7 @@ firewalling firmwares fixNSS fmt +fmtutil fno fontconfig fopen @@ -2700,6 +2701,7 @@ mk mkdb mkdir mkstr +mktexlsr mmZ mmap mn @@ -2933,6 +2935,7 @@ pconf pcre pcs pdf +pdftex pdu pe peasy From 108ef7dd9573bc9d083df0ed6301b3c9a27bd738 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 27 May 2026 08:22:13 +0000 Subject: [PATCH 06/26] configure.ac: `unset CCACHE_DIR` if provided but empty Notably, ccache-3.7.12 in FreeBSD 15 breaks CI build with that complaint. Signed-off-by: Jim Klimov --- configure.ac | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 55070960d2..8c7a5d2567 100644 --- a/configure.ac +++ b/configure.ac @@ -148,6 +148,19 @@ AC_MSG_RESULT([${CONFIG_FLAGS}]) AC_DEFINE_UNQUOTED([CONFIG_FLAGS],["${CONFIG_FLAGS}"],[Flags passed to configure script]) AC_SUBST(CONFIG_FLAGS) +dnl Some versions of ccache take poorly to an exported empty CCACHE_DIR etc. +dnl ccache: error: CCACHE_DIR must not be the empty string +dnl and this breaks "checking for C compiler version" in a standard step below +AS_IF([set | ${EGREP} '^CCACHE_DIR(=|=""|='"''"')$'], [ + AC_MSG_NOTICE([Unsetting a provided but empty CCACHE_DIR environment variable]) + AS_UNSET([CCACHE_DIR]) +]) + +AS_IF([set | ${EGREP} '^CCACHE_PATH(=|=""|='"''"')$'], [ + AC_MSG_NOTICE([Resetting a provided but empty CCACHE_PATH environment variable to current PATH]) + CCACHE_PATH="${PATH}" +]) + AC_CHECK_PROGS([MKTEMP], [mktemp], []) AS_IF([test x"${MKTEMP}" = x], [ dnl # Have a simple (unsafe, unfeatured) fallback implementation: @@ -7037,8 +7050,9 @@ AC_ARG_VAR(CCACHE_DIR) AC_ARG_VAR(CCACHE_PATH) dnl Some versions of ccache take poorly to an exported empty CCACHE_DIR etc. -dnl Avoid exporting them if not set at the configure time (assuming ci_build.sh -dnl integration or user's shell profile sets them persistently) +dnl ccache: error: CCACHE_DIR must not be the empty string +dnl Avoid exporting them if NOT set at the configure time (assuming ci_build.sh +dnl integration or user's shell profile sets them persistently... or empty) AS_IF([test x"${CCACHE_NAMESPACE-}" = x], [NUT_AM_EXPORT_CCACHE_NAMESPACE="#"], [NUT_AM_EXPORT_CCACHE_NAMESPACE=""]) AC_SUBST(NUT_AM_EXPORT_CCACHE_NAMESPACE) AS_IF([test x"${CCACHE_BASEDIR-}" = x], [NUT_AM_EXPORT_CCACHE_BASEDIR="#"], [NUT_AM_EXPORT_CCACHE_BASEDIR=""]) From 2af72415f47c9918c8fdee02a1af179306d62359 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 27 May 2026 10:31:37 +0000 Subject: [PATCH 07/26] configure.ac: report the tested compiler location just before AC_PROG_CC etc. which might fail Signed-off-by: Jim Klimov --- configure.ac | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/configure.ac b/configure.ac index 8c7a5d2567..6af0fab402 100644 --- a/configure.ac +++ b/configure.ac @@ -273,7 +273,14 @@ dnl But OpenBSD 6.5 requires autoconf-2.65 and automake-1.13 or newer... AS_IF([test x"${nut_enable_configure_debug}" = xyes], [ AC_MSG_NOTICE([(CONFIGURE-DEVEL-DEBUG) CFLAGS_BEFORE_ACPROG="${CFLAGS-}"]) AC_MSG_NOTICE([(CONFIGURE-DEVEL-DEBUG) CXXFLAGS_BEFORE_ACPROG="${CXXFLAGS-}"]) + dnl Find and report the location of attempted compiler + dnl (maybe wrapped with something like ccache, distcc, etc.) + AC_MSG_NOTICE([(CONFIGURE-DEVEL-DEBUG) PATH='${PATH}']) + AC_MSG_NOTICE([(CONFIGURE-DEVEL-DEBUG) CCACHE_PATH='${CCACHE_PATH}']) + AC_MSG_NOTICE([(CONFIGURE-DEVEL-DEBUG) Compiler location: CC: '${CC}' => '`command -v ${CC}`']) + AC_MSG_NOTICE([(CONFIGURE-DEVEL-DEBUG) Compiler location: CXX: '${CXX}' => '`command -v ${CXX}`']) ]) + AC_MSG_CHECKING(for autoconf macro to enable system extensions) m4_version_prereq(2.61, [ AC_MSG_RESULT(yes) @@ -291,6 +298,9 @@ dnl Macro AC_PROG_CC_C99 is obsolete; use AC_PROG_CC dnl Note that NUT does not support building with C89 anyway dnl AC_PROG_CC_C99 dnl Needed for per-target flags +dnl NOTE: The AM macro below wraps its AC name-sake to perform +dnl additional tricks needed for automake. There seems to not be +dnl a CXX variant of that however, or at least not ubiquitoisly. AM_PROG_CC_C_O AC_PROG_CPP AC_PROG_CXX From b7d64eb4f1ccc6d4f3ee507f48e4e8902e821aad Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 27 May 2026 10:46:01 +0000 Subject: [PATCH 08/26] .github/pull_request_template.md: update with a section on Unicode characters Signed-off-by: Jim Klimov --- .github/pull_request_template.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index a381dad424..3e21ea2c9b 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -38,6 +38,14 @@ quality and content of the change, and is presumed to have the right to post that code to be published further under the project's license terms. +- [ ] Especially with involvement of AI, including modern IDE coding aid, + please be sure to revise that proposed code and documentation changes + follow NUT code style guide -- this helps portability across the decades + worth of supported systems. Notably, avoid Unicode characters where ASCII + text is expected (C sources and headers, manual pages and other `acsiidoc` + inputs). Particularly AI is keen on adding `mdash` characters instead of + plain ASCII double-dash (which renders into the long dash where applicable). + - [ ] Please star NUT on GitHub, this helps with sponsorships! ;) ## Frequent "underwater rocks" for driver addition/update PRs From e87fe127212930bd238957c1495673c3d6fca8ca Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 27 May 2026 11:05:23 +0000 Subject: [PATCH 09/26] configure.ac, Makefile.am, docs/Makefile.am, tools/check-source-nonascii.pl: add unicode-in-sources detection to spellcheck On some platforms, at least the `file` type parsing fails for text with some but not other wide characters (so it is "data" and not some sort of "text"). This test was added for C sources as well, but keep in mind that the final authority is the actually used compilers - which are free to complain or not. Signed-off-by: Jim Klimov --- Makefile.am | 17 +++++++++++++++++ configure.ac | 16 ++++++++++++++++ docs/Makefile.am | 9 +++++++++ tools/Makefile.am | 3 ++- tools/check-source-nonascii.pl | 31 +++++++++++++++++++++++++++++++ 5 files changed, 75 insertions(+), 1 deletion(-) create mode 100755 tools/check-source-nonascii.pl diff --git a/Makefile.am b/Makefile.am index 77de83a200..055cf4e832 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1776,11 +1776,28 @@ git-realclean-check: # separately from the probably slower/louder stages for test programs like # check-NIT: CHECK_FILES_QUICK_TARGETS = check-man + if WITH_SPELLCHECK CHECK_FILES_QUICK_TARGETS += spellcheck-quick endif WITH_SPELLCHECK + +if HAVE_PERL +CHECK_FILES_QUICK_TARGETS += check-source-nonascii +endif HAVE_PERL + check-files-quick: $(CHECK_FILES_QUICK_TARGETS) +# Style check of sorts, except that some older systems may refuse to handle +# source files with wide/multi-byte characters (have yet to see complaints +# about single-byte non-ASCII). So far not listing C++ here as its tools are +# more modern (we mostly care about C++11 and newer). +check-source-nonascii: + @echo " CHECK-SOURCE-NONASCII **/*.c **/*.h" + @ @PERL@ $(top_srcdir)/tools/check-source-nonascii.pl $(top_srcdir)/*/*.c $(top_srcdir)/*/*.h $(top_srcdir)/*/*/*.c $(top_srcdir)/*/*/*.h + +# TBD: clang-format, etc? +stylecheck: check-source-nonascii + # Autotools hook: run the quick checks before recursing for defaults: check-recursive: check-files-quick diff --git a/configure.ac b/configure.ac index 6af0fab402..48f95c11d8 100644 --- a/configure.ac +++ b/configure.ac @@ -2320,6 +2320,22 @@ printf("%ld ", GetAdaptersInfo(buf, &bufsz)) AC_SUBST([NETLIBS_GETADDRS]) AC_CACHE_VAL([nut_cv_var_NETLIBS_GETADDRS], [nut_cv_var_NETLIBS_GETADDRS="${NETLIBS_GETADDRS}"]) +dnl ---------------------------------------------------------------------- +dnl Simple check that it exists and can be executed +AC_PATH_PROGS([PERL], perl, [none]) +AS_IF([test x"${PERL}" != xnone], [ + AC_MSG_CHECKING([whether PERL interpreter is basically usable: '${PERL}']) + AS_IF([${PERL} -e 1 >/dev/null], [ + AC_MSG_RESULT([yes]) + ], [ + AC_MSG_RESULT([no]) + PERL=none + ]) +]) + +AC_SUBST([PERL]) +AM_CONDITIONAL([HAVE_PERL], [test x"$PERL" != xnone]) + dnl ---------------------------------------------------------------------- dnl First remember if caller wants a custom Python package location? NUT_ARG_WITH([python-modules-dir], [install the PyNUT module files under specified path for default Python interpreter (auto for its reported site-packages location, if not with UI app)], [auto]) diff --git a/docs/Makefile.am b/docs/Makefile.am index f33a9d6d53..b089f5735c 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -997,6 +997,14 @@ SPELLCHECK_AUTO_ONE = ( \ .conf.conf-spellchecked-auto: @dotMAKE@ +@$(SPELLCHECK_AUTO_ONE) +# If we can, make sure the documentation is ASCII (with maybe +# single-byte accented characters here and there, they seem okay): +if HAVE_PERL +SOURCE_CHECK_UNICODE = echo " CHECK-SOURCE-NONASCII $(SPELLCHECK_SRC)"; @PERL@ $(top_srcdir)/tools/check-source-nonascii.pl $(SPELLCHECK_SRC) || exit +else !HAVE_PERL +SOURCE_CHECK_UNICODE = true +endif !HAVE_PERL + spellcheck: @dotMAKE@ @if test "$(SPELLCHECK_ENV_DEBUG)" = detailed ; then \ echo "ASPELL DEBUG : information about the setup follows:"; \ @@ -1056,6 +1064,7 @@ spellcheck: @dotMAKE@ echo "NOTE: SPELLCHECK_ERROR_FATAL == no so this make does not break the build!"; \ echo "=====================================================================" ; \ fi >&2 ; exit 0 + @$(SOURCE_CHECK_UNICODE) # Interactively spell check all documentation source files below (so a human # can edit the documentation errors and/or add words to custom dictionary). diff --git a/tools/Makefile.am b/tools/Makefile.am index fa7d024864..11ea175398 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -26,7 +26,7 @@ PYTHON_DEFAULT = @PYTHON_DEFAULT@ EXTRA_DIST = nut-usbinfo.pl nut-recorder.sh nut-ddl-dump.sh nut-dumpdiff.sh \ gitlog2changelog.py.in gitlog2version.sh semver-compare.sh \ - nut-snmpinfo.py.in driver-list-format.sh + nut-snmpinfo.py.in driver-list-format.sh check-source-nonascii.pl # These files are generated for nut-scanner builds (and cleaned as any others), # and can change as respective SNMP/USB subdriver sources are iterated by a @@ -116,6 +116,7 @@ $(GENERATED_USB_OS_FILES): $(GENERATED_USB_FILES) fi @touch '$@' +# FIXME: Make use of @PERL[@] substitution and HAVE_PERL conditional? $(GENERATED_USB_FILES): $(top_srcdir)/drivers/*-hid.c $(top_srcdir)/drivers/*usb*.c $(top_srcdir)/drivers/nutdrv_qx.c $(top_srcdir)/tools/nut-usbinfo.pl @if perl -e 1; then \ echo "Regenerating the USB helper files in SRC dir."; \ diff --git a/tools/check-source-nonascii.pl b/tools/check-source-nonascii.pl new file mode 100755 index 0000000000..164ac582d4 --- /dev/null +++ b/tools/check-source-nonascii.pl @@ -0,0 +1,31 @@ +#!/usr/bin/env perl + +# Find unicode sequences in sources that should be ASCII +# (C programs/headers, asciidoc text) +# +# Copyright (C) 2026 Jim Klimov + +my %hits; + +while (<>) { + # xE2x80x90 / xE2x80x92 / xE2x80x93 - various-length dashes (change to - or --) + # xE2x86x92 - right arrow (change to =>) + if (/\xE2[\x80\x82\x86]/) { + print "${ARGV}:$.:\t$_" ; + + if (!(defined ($hits{ARGV}))) { + $hits{$ARGV} = 0; + } + + $hits{$ARGV} = $hits{$ARGV} + 1; + } + + if (eof) { close ARGV; } +} + +if (scalar(%hits) > 0) { + die("FAILED: found Unicode characters in " . + scalar(%hits) . " ASCII source" . + (scalar(%hits) > 1 ? "s" : "" ) . + ": " . (join ", ", keys %hits) ."\n"); +} From 6235c3fe2e6f4e93c0ea499b9e44f40b741e17da Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 27 May 2026 11:11:08 +0000 Subject: [PATCH 10/26] docs/developers.txt: add a chapter on ASCII vs Unicode Signed-off-by: Jim Klimov --- docs/developers.txt | 19 +++++++++++++++++++ docs/nut.dict | 3 ++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/docs/developers.txt b/docs/developers.txt index 9327dcd384..b8886056d6 100644 --- a/docs/developers.txt +++ b/docs/developers.txt @@ -121,6 +121,25 @@ Portability Avoid things that will break on other systems. All the world is not an x86 Linux box. +ASCII vs. Unicode +~~~~~~~~~~~~~~~~~ + +Some systems that NUT can still be built on pre-date the sprawl of Unicode +support, whether in compilers or in documentation management tooling. + +To err on the safe side, please avoid the multi-byte characters where +plain-text ASCII suffices. This is especially notable with computer-aided +software development, whether with AI agents or IDE code completion, +or when copying text from web sites or specifications, where all sorts of +typographical "quote" and "dash" characters pop up. + +Keep it simple, use the ASCII minuses, single or double quotes, or back-tick +characters as appropriate for your comments in C sources and headers, or in +the Asciidoc sources (e.g. man pages). + +See the `tools/check-source-nonascii.pl` (also called from NUT `Makefile.am` +recipes) for a simple check about this. + C comments ~~~~~~~~~~ diff --git a/docs/nut.dict b/docs/nut.dict index 3d681f4557..0fe9b3cfe4 100644 --- a/docs/nut.dict +++ b/docs/nut.dict @@ -1,4 +1,4 @@ -personal_ws-1.1 en 3767 utf-8 +personal_ws-1.1 en 3768 utf-8 AAC AAS ABI @@ -2812,6 +2812,7 @@ noimp noinst nolock nombattvolt +nonascii noncommercially noout nooutstats From eb5909fed149a59183bc803ea131a4ef05df17b0 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 27 May 2026 09:29:28 +0000 Subject: [PATCH 11/26] drivers/libwinhid.h: replace Unicode long dashes with acsii `--` and arrow with `=>` Signed-off-by: Jim Klimov --- drivers/libwinhid.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/libwinhid.h b/drivers/libwinhid.h index fa5a7a3dae..e04deb9cf2 100644 --- a/drivers/libwinhid.h +++ b/drivers/libwinhid.h @@ -101,7 +101,7 @@ typedef PVOID win_phidp_preparsed_data_t; /* HIDP_CAPS mirror */ /* ---------------------------------------------------------------------- */ -/*! @brief HIDP_CAPS mirror — top-level device capabilities summary */ +/*! @brief HIDP_CAPS mirror -- top-level device capabilities summary */ typedef struct win_hidp_caps_s { USHORT Usage; USHORT UsagePage; @@ -155,7 +155,7 @@ typedef union win_hidp_union_range_u { win_hidp_notrange_t NotRange; } win_hidp_union_range_t; -/*! @brief HIDP_VALUE_CAPS mirror — describes one value-type HID data item */ +/*! @brief HIDP_VALUE_CAPS mirror -- describes one value-type HID data item */ typedef struct win_hidp_value_caps_s { USHORT UsagePage; UCHAR ReportID; @@ -182,7 +182,7 @@ typedef struct win_hidp_value_caps_s { win_hidp_union_range_t u; } win_hidp_value_caps_t; -/*! @brief HIDP_BUTTON_CAPS mirror — describes one button-type HID data item */ +/*! @brief HIDP_BUTTON_CAPS mirror -- describes one button-type HID data item */ typedef struct win_hidp_button_caps_s { USHORT UsagePage; UCHAR ReportID; @@ -199,7 +199,7 @@ typedef struct win_hidp_button_caps_s { win_hidp_union_range_t u; } win_hidp_button_caps_t; -/*! @brief HIDP_LINK_COLLECTION_NODE mirror — one node in the collection tree */ +/*! @brief HIDP_LINK_COLLECTION_NODE mirror -- one node in the collection tree */ typedef struct win_hidp_link_collection_node_s { USHORT LinkUsage; USHORT LinkUsagePage; @@ -228,7 +228,7 @@ extern usb_communication_subdriver_t winhid_subdriver; * - Insert PowerSummary collection nodes where expected by subdriver tables * - Re-map 0x84xx (Power Device page) status leaf usages to their canonical * 0x85xx (Battery System page) equivalents - * - Flatten intermediate collection hierarchy (e.g. PowerConverter.Input → + * - Flatten intermediate collection hierarchy (e.g. PowerConverter.Input => * Input) and rewrite collection ID nodes to base form * - Generate alias HIDData items for paths that differ only by the above * transformations, so both old and new path forms resolve From 83e124f7f5a683b99f34f4be0a739e174538946d Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 27 May 2026 11:11:36 +0000 Subject: [PATCH 12/26] docs/documentation.txt, docs/man/nut.txt: replace Unicode long dashes with acsii `--` Signed-off-by: Jim Klimov --- docs/documentation.txt | 2 +- docs/man/nut.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/documentation.txt b/docs/documentation.txt index 1ec906d1cc..cf8370d1aa 100644 --- a/docs/documentation.txt +++ b/docs/documentation.txt @@ -109,7 +109,7 @@ These are writeups by users of the software. link:https://github.com/networkupstools/ConfigExamples[ConfigExamples], link:https://github.com/networkupstools/TLS-UPSmon[TLS-UPSmon], and link:https://github.com/networkupstools/TLS-Shims[TLS-Shims]) -- link:https://dan.langille.org/2020/09/10/nut-testing-the-shutdown-mechanism/[nut – testing the shutdown mechanism] '(Dan Langille)' +- link:https://dan.langille.org/2020/09/10/nut-testing-the-shutdown-mechanism/[nut - testing the shutdown mechanism] '(Dan Langille)' - link:http://www.dimat.unina2.it/LCS/MonitoraggioUpsNutUbuntu10-eng.htm[Deploying NUT on an Ubuntu 10.04 cluster] '(Stefano Angelone)' - link:http://blog.shadypixel.com/monitoring-a-ups-with-nut-on-debian-or-ubuntu-linux[Monitoring a UPS with nut on Debian or Ubuntu Linux] '(Avery Fay)' - link:http://linux.developpez.com/cours/upsusb/[Installation et gestion d'un UPS USB en réseau sous linux] '(Olivier Van Hoof, French)' diff --git a/docs/man/nut.txt b/docs/man/nut.txt index 132205bac6..ba44a84531 100644 --- a/docs/man/nut.txt +++ b/docs/man/nut.txt @@ -402,7 +402,7 @@ Internet resources operating system distributions (most of those the NUT CI farm tests each development iteration on) - link:https://github.com/networkupstools/nut/wiki/Building-NUT-for-in%E2%80%90place-upgrades-or-non%E2%80%90disruptive-tests[Building - NUT for in‐place upgrades or non‐disruptive tests] details how to build + NUT for in-place upgrades or non-disruptive tests] details how to build a newer version of NUT than your system packaging provides (as a potential replacement of the older installation), e.g. to test if some issue got resolved or if an updated driver sees more information from your device; From a251317c2bcb965a268c14616bb04135a53eb1e2 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 27 May 2026 13:15:48 +0000 Subject: [PATCH 13/26] drivers/socomec_jbus.c: clean up trailing whitespace Signed-off-by: Jim Klimov --- drivers/socomec_jbus.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/drivers/socomec_jbus.c b/drivers/socomec_jbus.c index 6affbdbbdd..50acdead29 100644 --- a/drivers/socomec_jbus.c +++ b/drivers/socomec_jbus.c @@ -3,13 +3,13 @@ * Copyright (C) * 2021 Thanos Chatziathanassiou * - * Based on documentation found freely on + * Based on documentation found freely on * https://www.socomec.com/files/live/sites/systemsite/files/GB-JBUS-MODBUS-for-Delphys-MP-and-Delphys-MX-operating-manual.pdf * but with dubious legal license. The document itself states: * ``CAUTION : “This is a product for restricted sales distribution to informed partners. * Installation restrictions or additional measures may be needed to prevent disturbances'' * YMMV - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -59,7 +59,7 @@ void upsdrv_initinfo(void) { uint16_t tab_reg[12]; int r; - + upsdebugx(2, "upsdrv_initinfo"); dstate_setinfo("device.mfr", "socomec jbus"); @@ -67,7 +67,7 @@ void upsdrv_initinfo(void) upsdebugx(2, "initial read"); - /* + /* this is a neat trick, but not really helpful right now https://stackoverflow.com/questions/25811662/spliting-an-hex-into-2-hex-values/41733170#41733170 uint8_t *lowbyte; @@ -79,7 +79,7 @@ void upsdrv_initinfo(void) if (r == -1) { fatalx(EXIT_FAILURE, "failed to read UPS code from JBUS. r is %d error %s", r, modbus_strerror(errno)); } - + upsdebugx(2, "read UPS Code %d", tab_reg[0]); if (tab_reg[1]) { @@ -92,11 +92,11 @@ void upsdrv_initinfo(void) case 130: dstate_setinfo("ups.model", "%s", "DIGYS"); break; - + case 515: dstate_setinfo("ups.model", "%s", "DELPHYS MX"); break; - + case 516: dstate_setinfo("ups.model", "%s", "DELPHYS MX elite"); break; @@ -123,7 +123,7 @@ void upsdrv_updateinfo(void) { uint16_t tab_reg[64]; int r; - + upsdebugx(2, "upsdrv_updateinfo"); status_init(); @@ -144,7 +144,7 @@ void upsdrv_updateinfo(void) upsdebugx(2, "battery capacity (Ah * 10) %u", tab_reg[8]); upsdebugx(2, "battery elements %u", tab_reg[9]); - + /* time and date */ r = mrir(modbus_ctx, 0x1360, 4, tab_reg); if (r == -1) { @@ -156,10 +156,10 @@ void upsdrv_updateinfo(void) /* ups status */ r = mrir(modbus_ctx, 0x1020, 6, tab_reg); - + if (r == -1) { upsdebugx(2, "Did not receive any data from the UPS at 0x1020 ! Ignoring ? r is %d error %s", r, modbus_strerror(errno)); - /* + /* dstate_datastale(); return; */ @@ -197,7 +197,7 @@ void upsdrv_updateinfo(void) upsdebugx(2, "Battery charging"); if (CHECK_BIT(tab_reg[1], 12)) upsdebugx(2, "Bypass input frequency out of tolerance"); - + if (CHECK_BIT(tab_reg[2], 0)) upsdebugx(2, "Unit operating"); @@ -223,7 +223,7 @@ void upsdrv_updateinfo(void) /* alarms */ r = mrir(modbus_ctx, 0x1040, 4, tab_reg); - + alarm_init(); if (r == -1) { @@ -270,7 +270,7 @@ void upsdrv_updateinfo(void) upsdebugx(2, "Battery charger fault"); alarm_set("Battery charger fault."); } - + if (CHECK_BIT(tab_reg[1], 1)) upsdebugx(2, "Improper condition of use"); if (CHECK_BIT(tab_reg[1], 2)) @@ -312,7 +312,7 @@ void upsdrv_updateinfo(void) if (CHECK_BIT(tab_reg[3], 3)) upsdebugx(2, "Synoptic alarm"); if (CHECK_BIT(tab_reg[3], 4)) { - upsdebugx(2, "Critical Rectifier fault"); + upsdebugx(2, "Critical Rectifier fault"); alarm_set("Critical Rectifier fault."); } if (CHECK_BIT(tab_reg[3], 6)) { @@ -373,7 +373,7 @@ void upsdrv_updateinfo(void) if (tab_reg[15] != 0xFFFF) dstate_setinfo("output.L1.current", "%u", tab_reg[15] ); - + if (tab_reg[16] != 0xFFFF) dstate_setinfo("output.L2.current", "%u", tab_reg[16] ); @@ -411,7 +411,7 @@ void upsdrv_updateinfo(void) --essential ups.status TRIM/BOOST/OVER ups.alarm - + --dangerous ups.shutdown shutdown.return @@ -489,7 +489,7 @@ void upsdrv_cleanup(void) static int mrir(modbus_t * arg_ctx, int addr, int nb, uint16_t * dest) { int r, i; - + /* zero out the thing, because we might have reused it */ for (i=0; i Date: Wed, 27 May 2026 13:17:30 +0000 Subject: [PATCH 14/26] drivers/*.c: replace Unicode in comments with ASCII equivalents Signed-off-by: Jim Klimov --- drivers/bicker_ser.c | 2 +- drivers/nut-libfreeipmi.c | 4 ++-- drivers/phoenixcontact_modbus.c | 10 +++++----- drivers/socomec_jbus.c | 4 ++-- drivers/usbhid-ups.c | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/bicker_ser.c b/drivers/bicker_ser.c index 218b943825..96f8493002 100644 --- a/drivers/bicker_ser.c +++ b/drivers/bicker_ser.c @@ -696,7 +696,7 @@ static int bicker_setvar(const char *varname, const char *val) /* This should not be needed because when `bicker_write()` is * successful the `parameter` struct is populated but gcc seems * not to be smart enough to realize that and errors out with - * "error: ‘parameter...’ may be used uninitialized in this function" + * "error: 'parameter...' may be used uninitialized in this function" */ parameter.id = 0; parameter.min = 0; diff --git a/drivers/nut-libfreeipmi.c b/drivers/nut-libfreeipmi.c index e136d026fb..fc63a40ade 100644 --- a/drivers/nut-libfreeipmi.c +++ b/drivers/nut-libfreeipmi.c @@ -1115,6 +1115,6 @@ int nut_ipmi_get_sensors_status(IPMIDevice_t *ipmi_dev) /* --chassis-control=CONTROL - Control the chassis. This command provides power-up, power-down, and reset control. Supported values: POWER-DOWN, POWER-UP, POWER-CYCLE, HARD-RESET, DIAGNOS‐ - TIC-INTERRUPT, SOFT-SHUTDOWN. + Control the chassis. This command provides power-up, power-down, and reset control. + Supported values: POWER-DOWN, POWER-UP, POWER-CYCLE, HARD-RESET, DIAGNOSTIC-INTERRUPT, SOFT-SHUTDOWN. */ diff --git a/drivers/phoenixcontact_modbus.c b/drivers/phoenixcontact_modbus.c index 20edb9569c..f28fd74013 100644 --- a/drivers/phoenixcontact_modbus.c +++ b/drivers/phoenixcontact_modbus.c @@ -77,24 +77,24 @@ #define GETVAL_U16(name, fallback) (dstate_getinfo(name) ? (uint16_t)atoi(dstate_getinfo(name)) : (fallback)) /* Time [s] after entering battery mode before shutdown signal (bit 15) is triggered */ -#define REG_PC_SHUTDOWN_DELAY 0x105A /* default: 60s, range: 1–65535 */ +#define REG_PC_SHUTDOWN_DELAY 0x105A /* default: 60s, range: 1-65535 */ /* Time [s] allowed for PC to shut down before output turns off */ -#define REG_PC_SHUTDOWN_TIME 0x105D /* default: 120s, range: 1–3600 */ +#define REG_PC_SHUTDOWN_TIME 0x105D /* default: 120s, range: 1-3600 */ /* Time [s] output is off after PC shutdown before reboot */ -#define REG_PC_RESET_TIME 0x105E /* default: 10s, range: 0–60 */ +#define REG_PC_RESET_TIME 0x105E /* default: 10s, range: 0-60 */ /* Time [s] input voltage must be above threshold to return to mains*/ #define REG_MAINS_RETURN_DELAY 0x1058 /* default: 10s */ /* Selector mode switch: PC-Mode = 9 */ -#define REG_MODE_SELECTOR_SWITCH 0x1074 /* default: 0–9 */ +#define REG_MODE_SELECTOR_SWITCH 0x1074 /* default: 0-9 */ /* --- Battery Monitoring --- */ /* SOH warning threshold [%] */ -#define REG_WARNING_SOH_THRESHOLD 0x1071 /* default: 0 (disabled), range: 1–100 */ +#define REG_WARNING_SOH_THRESHOLD 0x1071 /* default: 0 (disabled), range: 1-100 */ /* Switch to battery mode if below this input voltage [mV] */ #define REG_VOLTAGE_BELOW_BATTERY 0x1056 /* example: 21000 */ diff --git a/drivers/socomec_jbus.c b/drivers/socomec_jbus.c index 50acdead29..944138c314 100644 --- a/drivers/socomec_jbus.c +++ b/drivers/socomec_jbus.c @@ -6,8 +6,8 @@ * Based on documentation found freely on * https://www.socomec.com/files/live/sites/systemsite/files/GB-JBUS-MODBUS-for-Delphys-MP-and-Delphys-MX-operating-manual.pdf * but with dubious legal license. The document itself states: - * ``CAUTION : “This is a product for restricted sales distribution to informed partners. - * Installation restrictions or additional measures may be needed to prevent disturbances'' + * CAUTION : "This is a product for restricted sales distribution to informed partners. + * Installation restrictions or additional measures may be needed to prevent disturbances" * YMMV * * This program is free software; you can redistribute it and/or modify diff --git a/drivers/usbhid-ups.c b/drivers/usbhid-ups.c index 990cffcd11..8c18f0401a 100644 --- a/drivers/usbhid-ups.c +++ b/drivers/usbhid-ups.c @@ -536,7 +536,7 @@ static const char *date_conversion_fun(double value) * 4.2.6 Battery Settings -> ManufacturerDate * The date the pack was manufactured in a packed integer. * The date is packed in the following fashion: - * (year – 1980)*512 + month*32 + day. + * (year - 1980)*512 + month*32 + day. */ static char buf[32]; long year, month, day; From d3f8a5e8849803f87a6886e26719382f7c509276 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 27 May 2026 13:45:23 +0000 Subject: [PATCH 15/26] ci_build.sh: propose shell vs perl (faster?) implementations of normalize_path() Signed-off-by: Jim Klimov --- ci_build.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/ci_build.sh b/ci_build.sh index 71565c74b0..ae72127ebb 100755 --- a/ci_build.sh +++ b/ci_build.sh @@ -215,7 +215,11 @@ fi [ -n "$MAKE_FLAGS_VERBOSE" ] || MAKE_FLAGS_VERBOSE="VERBOSE=1 V=1 -s" [ -n "$MAKE_FLAGS_CLEAN" ] || MAKE_FLAGS_CLEAN="${MAKE_FLAGS_QUIET}" -normalize_path() { +normalize_path_perl() { + perl -e 'my %PATH; while (<>) { foreach my $D (split(/:/, $_)) { if (length($D) > 0 && !defined($PATH{$D})) { $PATH{$D} = scalar(%PATH); } } } ; my $joined = join ":", sort { $PATH{$a} <=> $PATH{$b} } keys %PATH; print "$joined";' +} + +normalize_path_shell() { # STDIN->STDOUT: strip duplicate "/" and extra ":" if present, # leave first copy of duplicates in (preferred) place sed -e 's,:::*,:,g' -e 's,^:*,,' -e 's,:*$,,' -e 's,///*,/,g' \ @@ -237,6 +241,19 @@ normalize_path() { ) } +HAVE_PERL=false +if perl -e 1 2>/dev/null; then + HAVE_PERL=true +fi + +normalize_path() { + if $HAVE_PERL ; then + normalize_path_perl "$@" + else + normalize_path_shell "$@" + fi +} + propose_CI_CCACHE_SYMLINKDIR() { # This is where many symlinks like "gcc -> ../bin/ccache" reside: echo \ From a403b3e061b97529c8b5804ec351a6e57d5d3749 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 27 May 2026 13:45:59 +0000 Subject: [PATCH 16/26] ci_build.sh: configure_nut(): report the PATH value ultimately used (maybe normalized) Signed-off-by: Jim Klimov --- ci_build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/ci_build.sh b/ci_build.sh index ae72127ebb..47c1dbf43a 100755 --- a/ci_build.sh +++ b/ci_build.sh @@ -1299,6 +1299,7 @@ configure_nut() { while : ; do # Note the CI_SHELL_IS_FLAKY=true support below echo "=== CONFIGURING NUT: $CONFIGURE_SCRIPT ${CONFIG_OPTS_STR}" echo "=== CC='$CC' CXX='$CXX' CPP='$CPP'" + echo "=== PATH='$PATH'" [ -z "${CI_SHELL_IS_FLAKY-}" ] || echo "=== CI_SHELL_IS_FLAKY='$CI_SHELL_IS_FLAKY'" if [ x"${DO_USE_AUTOCONF_CACHE}" = xyes ] && [ -n "${CI_CACHE_NUT_HASHDIR_CFG_OPT}" ] && [ -s "${CI_CACHE_NUT_HASHDIR_CFG}/config.cache" ] ; then From 3a47134bbf50638fe43aa3d4d49616b76c5b0e44 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 27 May 2026 14:11:22 +0000 Subject: [PATCH 17/26] ci_build.sh: normalize_path() before reporting it at start of actual work about BUILD_TYPE Signed-off-by: Jim Klimov --- ci_build.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ci_build.sh b/ci_build.sh index 47c1dbf43a..f231d1e018 100755 --- a/ci_build.sh +++ b/ci_build.sh @@ -1791,6 +1791,8 @@ export DO_CLEAN_AUTOCONF_CACHE_BEFORE echo "Processing BUILD_TYPE='${BUILD_TYPE}' ..." +PATH="`echo \"${PATH}\" | normalize_path`" + ensure_CI_CCACHE_SYMLINKDIR_envvar echo "Build host settings:" set | ${EGREP} '^(PATH|[^ ]*CCACHE[^ ]*|CI_[^ ]*|OS_[^ ]*|CANBUILD_[^ ]*|NODE_LABELS|MAKE|C[^ ]*FLAGS|LDFLAGS|ARCH[^ ]*|BITS[^ ]*|CC|CXX|CPP|DO_[^ ]*|BUILD_[^ ]*|[^ ]*_TGT|INPLACE_RUNTIME)=' | sed 's,\(.\)$,\1 \\,' || true From 291d6c2b660770de2b32e8fe9514b7d918bc19de Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 28 May 2026 09:53:54 +0000 Subject: [PATCH 18/26] ci_build.sh: fix normalize_path_perl() syntax for hash length; avoid newlines Signed-off-by: Jim Klimov --- ci_build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci_build.sh b/ci_build.sh index f231d1e018..1604691238 100755 --- a/ci_build.sh +++ b/ci_build.sh @@ -216,7 +216,7 @@ fi [ -n "$MAKE_FLAGS_CLEAN" ] || MAKE_FLAGS_CLEAN="${MAKE_FLAGS_QUIET}" normalize_path_perl() { - perl -e 'my %PATH; while (<>) { foreach my $D (split(/:/, $_)) { if (length($D) > 0 && !defined($PATH{$D})) { $PATH{$D} = scalar(%PATH); } } } ; my $joined = join ":", sort { $PATH{$a} <=> $PATH{$b} } keys %PATH; print "$joined";' + perl -e 'my %PATH; while (<>) { foreach my $D (split(/[:\r\n]/, $_)) { if (length($D) > 0 && !defined($PATH{$D})) { $PATH{$D} = scalar keys %PATH; } } } ; my $joined = join ":", sort { $PATH{$a} <=> $PATH{$b} } keys %PATH; print "$joined";' } normalize_path_shell() { From b6112c8bc3fb65954599017b53c3867bf51ee1c1 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Thu, 28 May 2026 09:54:23 +0000 Subject: [PATCH 19/26] tools/check-source-nonascii.pl: fix syntax for hash length Signed-off-by: Jim Klimov --- tools/check-source-nonascii.pl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/check-source-nonascii.pl b/tools/check-source-nonascii.pl index 164ac582d4..01a8b0be78 100755 --- a/tools/check-source-nonascii.pl +++ b/tools/check-source-nonascii.pl @@ -23,9 +23,10 @@ if (eof) { close ARGV; } } -if (scalar(%hits) > 0) { +my $hitCount = scalar keys %hits; +if ($hitCount > 0) { die("FAILED: found Unicode characters in " . - scalar(%hits) . " ASCII source" . - (scalar(%hits) > 1 ? "s" : "" ) . + $hitCount . " ASCII source" . + ($hitCount > 1 ? "s" : "" ) . ": " . (join ", ", keys %hits) ."\n"); } From 612c7016c1a1621c248bcbcd04d0460bf5769463 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Sun, 31 May 2026 18:13:52 +0200 Subject: [PATCH 20/26] configure.ac: ignore recent clang warning about unused-command-line-argument Signed-off-by: Jim Klimov --- configure.ac | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 48f95c11d8..2441803266 100644 --- a/configure.ac +++ b/configure.ac @@ -6675,18 +6675,20 @@ dnl # -Wno-c11-extensions -- clang-21 on Ubuntu 26.04 at least complains a lot dnl # about system headers (string.h, cdefs.h, etc.) using __glibc_const_generic dnl # -Wno-used-but-marked-unused -- openssl and clang do not always agree... dnl # -Wno-thread-safety-negative -- clang bug, it seems (https://reviews.llvm.org/D84604) +dnl # -Wno-unused-command-line-argument -- avoid the likes of (clang++) +dnl # error: argument unused during compilation: '-pthread' AS_CASE(["${nut_enable_warnings}"], [all], [ CFLAGS="${CFLAGS} -Wall" CXXFLAGS="${CXXFLAGS} -Wall" ], [clang-hard], [ - CFLAGS="${CFLAGS} -ferror-limit=0 -Wno-system-headers -Wno-missing-include-dirs -Wall -Wextra -Weverything -Wno-disabled-macro-expansion -Wno-unused-macros -Wno-reserved-id-macro -Wno-padded -Wno-documentation -fcomment-block-commands=retval -Wno-documentation-unknown-command -Wno-cast-qual -Wno-c11-extensions -pedantic -Wno-fuse-ld-path -Wno-unsafe-buffer-usage -Wno-thread-safety-negative" - CXXFLAGS="${CXXFLAGS} -ferror-limit=0 -Wno-system-headers -Wno-missing-include-dirs -Wall -Wextra -Weverything -Wno-disabled-macro-expansion -Wno-unused-macros -Wno-reserved-id-macro -Wno-padded -Wno-documentation -fcomment-block-commands=retval -Wno-documentation-unknown-command -Wno-cast-qual -Wno-c++98-compat-pedantic -Wno-c++98-compat -Wno-exit-time-destructors -Wno-fuse-ld-path -Wno-unsafe-buffer-usage -Wno-thread-safety-negative" + CFLAGS="${CFLAGS} -ferror-limit=0 -Wno-system-headers -Wno-missing-include-dirs -Wall -Wextra -Weverything -Wno-disabled-macro-expansion -Wno-unused-macros -Wno-reserved-id-macro -Wno-padded -Wno-documentation -fcomment-block-commands=retval -Wno-documentation-unknown-command -Wno-cast-qual -Wno-c11-extensions -pedantic -Wno-fuse-ld-path -Wno-unsafe-buffer-usage -Wno-thread-safety-negative -Wno-unused-command-line-argument" + CXXFLAGS="${CXXFLAGS} -ferror-limit=0 -Wno-system-headers -Wno-missing-include-dirs -Wall -Wextra -Weverything -Wno-disabled-macro-expansion -Wno-unused-macros -Wno-reserved-id-macro -Wno-padded -Wno-documentation -fcomment-block-commands=retval -Wno-documentation-unknown-command -Wno-cast-qual -Wno-c++98-compat-pedantic -Wno-c++98-compat -Wno-exit-time-destructors -Wno-fuse-ld-path -Wno-unsafe-buffer-usage -Wno-thread-safety-negative -Wno-unused-command-line-argument" ], [clang-medium], [ - CFLAGS="${CFLAGS} -ferror-limit=0 -Wno-system-headers -Wno-missing-include-dirs -Wall -Wextra -Weverything -Wno-disabled-macro-expansion -Wno-unused-macros -Wno-reserved-id-macro -Wno-padded -Wno-documentation -fcomment-block-commands=retval -Wno-documentation-unknown-command -Wno-cast-qual -Wno-c11-extensions -pedantic -Wno-fuse-ld-path -Wno-unsafe-buffer-usage -Wno-float-conversion -Wno-double-promotion -Wno-implicit-float-conversion -Wno-conversion -Wno-incompatible-pointer-types-discards-qualifiers -Wno-incompatible-function-pointer-types-strict -Wno-nullable-to-nonnull-conversion -Wno-used-but-marked-unused -Wno-thread-safety-negative" - CXXFLAGS="${CXXFLAGS} -ferror-limit=0 -Wno-system-headers -Wno-missing-include-dirs -Wall -Wextra -Weverything -Wno-disabled-macro-expansion -Wno-unused-macros -Wno-reserved-id-macro -Wno-padded -Wno-documentation -fcomment-block-commands=retval -Wno-documentation-unknown-command -Wno-cast-qual -Wno-c++98-compat-pedantic -Wno-c++98-compat -Wno-exit-time-destructors -Wno-global-constructors -Wno-fuse-ld-path -Wno-unsafe-buffer-usage -Wno-nullable-to-nonnull-conversion -Wno-used-but-marked-unused -Wno-thread-safety-negative" + CFLAGS="${CFLAGS} -ferror-limit=0 -Wno-system-headers -Wno-missing-include-dirs -Wall -Wextra -Weverything -Wno-disabled-macro-expansion -Wno-unused-macros -Wno-reserved-id-macro -Wno-padded -Wno-documentation -fcomment-block-commands=retval -Wno-documentation-unknown-command -Wno-cast-qual -Wno-c11-extensions -pedantic -Wno-fuse-ld-path -Wno-unsafe-buffer-usage -Wno-float-conversion -Wno-double-promotion -Wno-implicit-float-conversion -Wno-conversion -Wno-incompatible-pointer-types-discards-qualifiers -Wno-incompatible-function-pointer-types-strict -Wno-nullable-to-nonnull-conversion -Wno-used-but-marked-unused -Wno-thread-safety-negative -Wno-unused-command-line-argument" + CXXFLAGS="${CXXFLAGS} -ferror-limit=0 -Wno-system-headers -Wno-missing-include-dirs -Wall -Wextra -Weverything -Wno-disabled-macro-expansion -Wno-unused-macros -Wno-reserved-id-macro -Wno-padded -Wno-documentation -fcomment-block-commands=retval -Wno-documentation-unknown-command -Wno-cast-qual -Wno-c++98-compat-pedantic -Wno-c++98-compat -Wno-exit-time-destructors -Wno-global-constructors -Wno-fuse-ld-path -Wno-unsafe-buffer-usage -Wno-nullable-to-nonnull-conversion -Wno-used-but-marked-unused -Wno-thread-safety-negative -Wno-unused-command-line-argument" ], [clang-minimal], [ CFLAGS="${CFLAGS} -ferror-limit=0 -Wall -Wextra -Wno-documentation -Wno-documentation-unknown-command -fcomment-block-commands=retval" From 3b08899d06e5d8e311142bf87a69031d2785e532 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Mon, 1 Jun 2026 09:39:11 +0200 Subject: [PATCH 21/26] Jenkinsfile-dynamatrix: introduce dynacfgPipeline.notifyHandlerAlert (to report looping RESTART dynamatrix cells) Signed-off-by: Jim Klimov --- Jenkinsfile-dynamatrix | 41 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile-dynamatrix b/Jenkinsfile-dynamatrix index 1779d436d4..e4ca1fc83a 100644 --- a/Jenkinsfile-dynamatrix +++ b/Jenkinsfile-dynamatrix @@ -1355,10 +1355,45 @@ set | sort -n """ summary = dynamatrix.toStringStageCountDump() } catch (Throwable t) {} + try { + // TRY: Implementation below requires https://plugins.jenkins.io/ircbot (+ setup) + if (summary == null || summary == "") { + ircNotify (notificationStrategy:'FAILURE_AND_FIXED') + } else { + ircNotify (notificationStrategy:'FAILURE_AND_FIXED', customMessage: summary) + } + } catch (Throwable t) { + echo "Failed to ircNotify() a notification: ${t}" + } + } + + dynacfgPipeline.notifyHandlerAlert = { String msg -> + def summary = null + try { + summary = dynamatrix.toStringStageCountDump() + } catch (Throwable t) {} + if (summary == null || summary == "") { - ircNotify (notificationStrategy:'FAILURE_AND_FIXED') + summary = "Got some alert about Jenkins-Dynamatrix run ${BUILD_URL}" } else { - ircNotify (notificationStrategy:'FAILURE_AND_FIXED', customMessage: summary) + summary = "Got an alert about Jenkins-Dynamatrix run ${BUILD_URL} : ${summary}" + } + if (msg != null && msg != "") { + summary += "\n\n${msg}" + } + + try { + // TRY: Implementation below requires https://plugins.jenkins.io/email-ext + + // NOTE: If someone adapts this pipeline to their repository, + // be sure to change these settings (currently NUT-specific): + emailext (attachLog: false, + to: "nutci-alerts@networkupstools.org", + subject: "Alert from NUT CI farm job ${JOB_NAME} build ${BUILD_ID}", + body: summary + ) + } catch (Throwable t) { + echo "Failed to emailext() a notification: ${t}" } } @@ -1383,7 +1418,7 @@ def stageNameFunc_ShellcheckCustom(DynamatrixSingleBuildConfig dsbc) { if ( env?.BRANCH_NAME ==~ /.*verbose.*/ ) { dynamatrixGlobalState.enableDebugTrace = true - //dynamatrixGlobalState.enableDebugTraceResolver = true + //dynamatrixGlobalState.enableDebugTraceResolver = true dynamatrixGlobalState.enableDebugErrors = true dynamatrixGlobalState.enableDebugMilestones = true dynamatrixGlobalState.enableDebugMilestonesDetails = true From fc89ff22c54073b098d564213905cae45ca359ff Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Mon, 1 Jun 2026 10:48:07 +0200 Subject: [PATCH 22/26] Jenkinsfile-dynamatrix: use new countStagesPerNode feature from the library in notifyHandlerAlert Signed-off-by: Jim Klimov --- Jenkinsfile-dynamatrix | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile-dynamatrix b/Jenkinsfile-dynamatrix index e4ca1fc83a..dda6f491f4 100644 --- a/Jenkinsfile-dynamatrix +++ b/Jenkinsfile-dynamatrix @@ -1371,6 +1371,7 @@ set | sort -n """ def summary = null try { summary = dynamatrix.toStringStageCountDump() + summary += "\n\n" + dynamatrix.toStringStageCountPerNodeDump() } catch (Throwable t) {} if (summary == null || summary == "") { From 5d70d9f053f36f21ea90c339f76142594d1dc4e4 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 27 May 2026 14:48:20 +0000 Subject: [PATCH 23/26] docs/config-prereqs.txt: document JDK21+ as the requirement for NUT CI build farm agents since spring 2026 Signed-off-by: Jim Klimov --- docs/config-prereqs.txt | 72 ++++++++++++++++++++++++----------------- 1 file changed, 42 insertions(+), 30 deletions(-) diff --git a/docs/config-prereqs.txt b/docs/config-prereqs.txt index 5e15adc75c..14eac99fdd 100644 --- a/docs/config-prereqs.txt +++ b/docs/config-prereqs.txt @@ -327,7 +327,7 @@ complete environments): ------ NOTE: For Jenkins agents, also need to `apt-get install openjdk-21-jdk-headless` -(or `apt-get install openjdk-17-jdk-headless` on Debian 12 and older). +(or use alternate PPA sources or third-party builds on Debian 12 and older). You may have to ensure that `/proc` is mounted in the target chroot (or do this from the running container). @@ -554,7 +554,7 @@ other described environments by adding a symlink `/usr/lib/ccache`: [NOTE] ====== -For Jenkins agents, also need to install JDK 17 or newer, which is not +For Jenkins agents, also need to install JDK 21 or newer, which is not available for CentOS 6 nor 7 directly (in distribution packaging). In Fedora e.g.: @@ -674,7 +674,7 @@ clang version 14.0.6 done; done) ------ -Also for CI build agents, a Java environment (JDK17+ since autumn 2024) is +Also for CI build agents, a Java environment (JDK21+ since spring 2026) is required: ------ # Search for available Java versions: @@ -682,7 +682,7 @@ required: # Pick one: :; pacman -S --needed \ - jre17-openjdk-headless + jre21-openjdk-headless # If needed to change default implementation, consult: :; archlinux-java help @@ -814,7 +814,7 @@ Other common NUT dependencies absent from primary Slackware repositories can be found and downloaded (seek `*.txz` package files, although a few are named `*.tgz`) from here, and passed to `installpkg`: -* http://www.slackware.com/~alien/slackbuilds/openjdk17/ +* http://www.slackware.com/~alien/slackbuilds/openjdk25/ * http://www.slackware.com/~alien/slackbuilds/asciidoc/ * http://www.slackware.com/~alien/slackbuilds/cppunit/ * http://www.slackware.com/~alien/slackbuilds/lua/ (5.1 in "stable") and @@ -850,9 +850,9 @@ Note that some packages are further separated by Slackware version, e.g. with sub-directories for `15.0` and `current`: ---- :; wget -r -l1 -nd -R gif,css,jpg,html,htm --remove-listing \ - http://www.slackware.com/~alien/slackbuilds/openjdk17/pkg64/15.0/ + http://www.slackware.com/~alien/slackbuilds/openjdk25/pkg64/15.0/ -:; installpkg openjdk17-17.0.12_7-x86_64-1alien.txz +:; installpkg openjdk25-25.0.3_9-x86_64-1alien.txz ---- Upon community members' recommendations, Sotirov's SlackPack is also considered @@ -877,14 +877,19 @@ tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,inode64) FreeBSD 12.2 - 15.0 ~~~~~~~~~~~~~~~~~~~ -NOTE: As of 2024, the originally described OS version 12.2 is way beyond -EOL -- its packages have been removed from mirrors. A discussion at +[NOTE] +====== +As of 2024, the originally described OS version 12.2 is way beyond EOL -- its +packages have been removed from mirrors. A discussion at https://forums.freebsd.org/threads/easy-upgrading-from-12-2-rel-in-2024.92695/ touches on upgrades in such situation. An alternate mirror (that worked to -bump the system to `openjdk17`, as of this writing in Nov 2024) can be found -at https://mirror.sg.gs/freebsd-pkg/FreeBSD:12:amd64/quarterly/ and written -into `/etc/pkg/FreeBSD.conf` similarly to existing `url` entry. -That deployment on NUT CI farm survived `freebsd-update` up to 15.0 however. +bump that system to `openjdk17` in Nov 2024) can be found +at https://mirror.sg.gs/freebsd-pkg/FreeBSD:12:amd64/quarterly/ and it was +written into `/etc/pkg/FreeBSD.conf` similarly to existing `url` entry. + +That described deployment on NUT CI farm survived `freebsd-update` up to 15.0 +however, and ultimate update to newer `openjdk25` as needed by the CI farm. +====== Note that `PATH` for builds on BSD should include `/usr/local/...`: @@ -978,9 +983,9 @@ For compatibility with common setups on other operating systems, can symlink suffixed symlinks to compiler tools (e.g. `gcc-10` beside `gcc10` installed by package). -NOTE: For Jenkins agents, also need to `pkg install openjdk11` (17 or 21 -required since autumn 2024) -- and do note its further OS configuration -suggestions for special filesystem mounts. +NOTE: For Jenkins agents, also need to `pkg install openjdk21` (21+ required +since spring 2026) -- and do note its further OS configuration suggestions +for special filesystem mounts. Due to BSD specific paths *when not using* an implementation of `pkg-config` or `pkgconf` (so guessing of flags is left to administrator -- TBD in NUT @@ -1011,14 +1016,21 @@ below. OpenBSD delivers many versions of numerous packages, you should specify your pick interactively or as part of package name (e.g. `autoconf-2.69p2`). -NOTE: For the purposes of builds with Jenkins CI agents, since summer 2022 it -requires JDK11 which was first delivered with OpenBSD 6.5. Earlier iterations +[NOTE] +====== +For the purposes of builds with Jenkins CI agents, since summer 2022 the NUT CI +farm required JDK11 which was first delivered with OpenBSD 6.5. Earlier iterations used OpenBSD 6.4 and version nuances in this document may still reflect that. -FIXME: Since autumn 2024, JDK17+ is required. Maybe time to EOL OpenBSD 6.x +UPDATE: Since autumn 2024, JDK17+ was required. Maybe time to EOL OpenBSD 6.x workers, or to SSH into them from a nearby machine's Java agent?.. Alternately, consider https://github.com/adoptium/jdk17/blob/master/doc/building.md +UPDATE: Since spring 2026, JDK21+ is required by Jenkins. Tricks using SSH and +NFS with a nearby builder that has newer Java running are explored to keep the +older platform afloat for non-regression testing. +====== + During builds, you may have to tell system dispatcher scripts which version to use (which feels inconvenient, but on the up-side for CI -- this system allows to test many versions of auto-tools in the same agent), e.g.: @@ -1165,7 +1177,7 @@ dash-number suffixed symlinks to compiler tools (e.g. `gcc-4.2.1` beside `gcc` installed by package) into `/usr/lib/ccache`. NOTE: For Jenkins agents, also need to `pkg_add jdk` (if asked, pick version -11 or 17); can request `pkg_add jdk%11`. You would likely have to update +21 or 25); can request `pkg_add jdk%21`. You would likely have to update the trusted CA store to connect to NUT CI, see e.g. (raw!) download from https://gist.github.com/galan/ec8b5f92dd325a97e2f66e524d28aaf8 but ensure that you run it with `bash` and it does `wget` the certificates @@ -1568,12 +1580,12 @@ No pre-packaged `cppcheck` was found, either. [NOTE] ====== -For Jenkins agents, also need to `pkg install runtime/java/openjdk17` -for JRE/JDK 17. Java 17 or 21 is required to run Jenkins agents after -autumn 2024. If updating from older releases, you may need to update default -implementation, e.g.: +For Jenkins agents, also need to `pkg install runtime/java/openjdk21` +for JRE/JDK 21. Java 21 or 25 is required to run Jenkins agents after +spring 2026. If updating from older releases, you may need to update +the reference to default implementation, e.g.: ---- -:; pkg set-mediator -V 17 java +:; pkg set-mediator -V 21 java ---- ====== @@ -1701,9 +1713,9 @@ whatever they need to happen. [NOTE] ====== For Jenkins agents, also need to `pkg install runtime/java/openjdk21` -for JRE/JDK 17. Java 17 or 21 is required to run Jenkins agents after -autumn 2024. If updating from older releases, you may need to update default -implementation, e.g.: +for JRE/JDK 21. Java 21 or 25 is required to run Jenkins agents after +spring 2026. If updating from older releases, you may need to update +the reference to default implementation, e.g.: ---- :; pkg set-mediator -V 21 java ---- @@ -1866,8 +1878,8 @@ Alternatively, to prepare building sessions with `ci_build.sh` you can: ---- NOTE: For Jenkins agents, also need to `brew install --cask temurin@21` -for JRE/JDK 21. Java 17 or 21 (an LTS) is required to run Jenkins agents -after summer 2024. +for JRE/JDK 21. Java 21 or 25 (an LTS) is required to run Jenkins agents +after spring 2026. The compiler is part of Apple's XCode ecosystem. Just try to run `clang` in a GUI terminal, and a pop-up will appear offering to install it. From 89c0ea28b3a836ebee697e6b9b82e09ea7b9672d Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 3 Jun 2026 08:38:02 +0000 Subject: [PATCH 24/26] configure.ac: pass -Wno-unused-command-line-argument also to CLANG LDFLAGS Signed-off-by: Jim Klimov --- configure.ac | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configure.ac b/configure.ac index 2441803266..b7aa0db6fd 100644 --- a/configure.ac +++ b/configure.ac @@ -6677,6 +6677,8 @@ dnl # -Wno-used-but-marked-unused -- openssl and clang do not always agree... dnl # -Wno-thread-safety-negative -- clang bug, it seems (https://reviews.llvm.org/D84604) dnl # -Wno-unused-command-line-argument -- avoid the likes of (clang++) dnl # error: argument unused during compilation: '-pthread' +dnl # (apparently in FreeBSD 15 builds something gets into the wrong *FLAGS, +dnl # maybe via pkg-config... or it was just the first one to notice and yell) AS_CASE(["${nut_enable_warnings}"], [all], [ CFLAGS="${CFLAGS} -Wall" @@ -6685,10 +6687,12 @@ AS_CASE(["${nut_enable_warnings}"], [clang-hard], [ CFLAGS="${CFLAGS} -ferror-limit=0 -Wno-system-headers -Wno-missing-include-dirs -Wall -Wextra -Weverything -Wno-disabled-macro-expansion -Wno-unused-macros -Wno-reserved-id-macro -Wno-padded -Wno-documentation -fcomment-block-commands=retval -Wno-documentation-unknown-command -Wno-cast-qual -Wno-c11-extensions -pedantic -Wno-fuse-ld-path -Wno-unsafe-buffer-usage -Wno-thread-safety-negative -Wno-unused-command-line-argument" CXXFLAGS="${CXXFLAGS} -ferror-limit=0 -Wno-system-headers -Wno-missing-include-dirs -Wall -Wextra -Weverything -Wno-disabled-macro-expansion -Wno-unused-macros -Wno-reserved-id-macro -Wno-padded -Wno-documentation -fcomment-block-commands=retval -Wno-documentation-unknown-command -Wno-cast-qual -Wno-c++98-compat-pedantic -Wno-c++98-compat -Wno-exit-time-destructors -Wno-fuse-ld-path -Wno-unsafe-buffer-usage -Wno-thread-safety-negative -Wno-unused-command-line-argument" + LDFLAGS="${LDFLAGS} -Wno-unused-command-line-argument" ], [clang-medium], [ CFLAGS="${CFLAGS} -ferror-limit=0 -Wno-system-headers -Wno-missing-include-dirs -Wall -Wextra -Weverything -Wno-disabled-macro-expansion -Wno-unused-macros -Wno-reserved-id-macro -Wno-padded -Wno-documentation -fcomment-block-commands=retval -Wno-documentation-unknown-command -Wno-cast-qual -Wno-c11-extensions -pedantic -Wno-fuse-ld-path -Wno-unsafe-buffer-usage -Wno-float-conversion -Wno-double-promotion -Wno-implicit-float-conversion -Wno-conversion -Wno-incompatible-pointer-types-discards-qualifiers -Wno-incompatible-function-pointer-types-strict -Wno-nullable-to-nonnull-conversion -Wno-used-but-marked-unused -Wno-thread-safety-negative -Wno-unused-command-line-argument" CXXFLAGS="${CXXFLAGS} -ferror-limit=0 -Wno-system-headers -Wno-missing-include-dirs -Wall -Wextra -Weverything -Wno-disabled-macro-expansion -Wno-unused-macros -Wno-reserved-id-macro -Wno-padded -Wno-documentation -fcomment-block-commands=retval -Wno-documentation-unknown-command -Wno-cast-qual -Wno-c++98-compat-pedantic -Wno-c++98-compat -Wno-exit-time-destructors -Wno-global-constructors -Wno-fuse-ld-path -Wno-unsafe-buffer-usage -Wno-nullable-to-nonnull-conversion -Wno-used-but-marked-unused -Wno-thread-safety-negative -Wno-unused-command-line-argument" + LDFLAGS="${LDFLAGS} -Wno-unused-command-line-argument" ], [clang-minimal], [ CFLAGS="${CFLAGS} -ferror-limit=0 -Wall -Wextra -Wno-documentation -Wno-documentation-unknown-command -fcomment-block-commands=retval" From 7c3b9944984a9e1d3c259c86cebe5eaf72d27878 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 3 Jun 2026 11:42:27 +0000 Subject: [PATCH 25/26] NEWS.adoc: update for FreeBSD and Jenkins bumps Signed-off-by: Jim Klimov --- NEWS.adoc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS.adoc b/NEWS.adoc index 285f570d80..3f63cd8237 100644 --- a/NEWS.adoc +++ b/NEWS.adoc @@ -147,6 +147,10 @@ https://github.com/networkupstools/nut/milestone/13 names not exposed with dynamic linking metadata (e.g. some Mozilla NSS dependencies were not previously discovered and bundled). [issue #3420, PRs #3429, #3432] + * Updated a NUT CI farm worker to FreeBSD 15 and updated the recipes and + documentation according to problems that were found along the way. [#3453] + * Jenkins used as the NUT CI farm core has bumped JDK requirements for its + controllers and build agents, `docs/config-prereqs.txt` revised. Release notes for NUT 2.8.5 - what's new since 2.8.4 From 77decfcfb57d3fd3bea0abc6024a333597f1b604 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Fri, 5 Jun 2026 17:44:02 +0000 Subject: [PATCH 26/26] configure.ac: revise LIBSSL_LIBS vs "-pthread" option (from NSS occasionally) for C++ builds [#3453] Address error: argument unused during compilation: '-pthread' Signed-off-by: Jim Klimov --- clients/Makefile.am | 2 +- configure.ac | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/clients/Makefile.am b/clients/Makefile.am index f26e5a645a..9376f92158 100644 --- a/clients/Makefile.am +++ b/clients/Makefile.am @@ -314,7 +314,7 @@ if HAVE_WINDOWS libnutclient_la_LDFLAGS += -no-undefined endif HAVE_WINDOWS if WITH_SSL_CXX - libnutclient_la_LIBADD += $(LIBSSL_LDFLAGS_RPATH) $(LIBSSL_LIBS) + libnutclient_la_LIBADD += $(LIBSSL_LDFLAGS_RPATH) $(LIBSSL_LIBS_CXX) endif WITH_SSL_CXX else !HAVE_CXX11 EXTRA_DIST += nutclient.h nutclient.cpp diff --git a/configure.ac b/configure.ac index b7aa0db6fd..7de682323c 100644 --- a/configure.ac +++ b/configure.ac @@ -7323,6 +7323,21 @@ AC_SUBST(LIBSSL_CXXFLAGS) NUT_REPORT_FEATURE([enable SSL support in C++ client library], [${nut_with_ssl_cxx}], [${nut_ssl_lib}], [WITH_SSL_CXX], [Define to enable SSL in libnutclient]) +dnl At least FreeBSD clang complains about NSS builds with +dnl error: argument unused during compilation: '-pthread' +dnl which pops up in LDFLAGS/LIBS and is kept as "compiler" +dnl flag when calling the linker. +dnl Does not hurt plain C builds though. +LIBSSL_LIBS_CXX="${LIBSSL_LIBS}" +AS_IF([test "$nut_with_ssl_cxx" = "yes"], + [AS_CASE([$LIBSSL_LIBS_CXX], + [*" -pthread "*|"-pthread "*|*" -pthread"|-pthread], [ + AC_MSG_NOTICE([Remove -pthread from LIBSSL_LIBS for C++ builds]) + LIBSSL_LIBS_CXX="`echo \"${LIBSSL_LIBS}\" | sed 's, *-pthread *, ,'`" + ]) + ]) +AC_SUBST(LIBSSL_LIBS_CXX) + AC_DEFINE_UNQUOTED([EXEEXT], ["${EXEEXT}"], [Platform-specific extension for binary program files (may be empty where not required)]) AC_SUBST(EXEEXT)