Repository navigation
nut-scanner: one load verdict per library at the default debug level - #3739
Merged
jimklimov merged 1 commit intoOct 14, 2026
Merged
Conversation
…etworkupstools#3654] Each nutscan_load_*_library() printed "Cannot load X library (name) : reason. X search disabled." at debug level 0 for every failed attempt. Now that nutscan_init() really tries each candidate name in turn, that made a missing library print one line per name, and a library that loads on a later name still claimed its search was disabled. Move the per-attempt messages, and the loaders' "library not found" messages, to debug level 1, where the name tried and the reason stay available, and drop their "X search disabled" suffix since the scan goes on to the next name. nutscan_init() now prints a single line per library that could not be loaded at all. A library that loads keeps its existing debug level 1 message, so a normal run prints nothing new. tests/NIT/nit.sh excused a missing libupsclient by matching the old per-attempt wording, so point that pattern at the new summary line. Signed-off-by: Jordan Rodgers <com6056@gmail.com>
com6056
force-pushed
the
nut-scanner-load-report
branch
from
October 10, 2026 21:21
6abcca7 to
02381c3
Compare
|
A ZIP file with standard source tarball and another tarball with pre-built docs for commit 02381c3 is temporarily available: NUT-tarballs-PR-3739.zip. |
|
✅ Build nut 2.8.5.5630-master completed (commit 987da8705c by @com6056)
|
|
✅ Build nut 2.8.5.5631-master completed (commit 6bf8522d21 by @com6056)
|
jimklimov
approved these changes
Oct 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #3654, as discussed there. Each
nutscan_load_*_library()logs a line likeCannot load XML library (libneon.so.27) : file not found. XML search disabled.at debug level 0 for every name it tries, so since #3654 a missing library prints one line per candidate, and a library that loads on a later name still prints lines saying its search was disabled.This moves those lines, and the loaders'
library not foundlines, to debug level 1 without thesearch disabledsuffix, andnutscan_init()now prints one level-0 line per library that could not be loaded at all. A library that loads keeps its existing level-1 message, so a normal run prints nothing new. The flags in the loaders are untouched. A direct caller of the exported loaders (there are none in-tree) now only gets the level-1 lines.Tested on Alpine edge, counting the library load lines
nut-scanner -aprints at the default debug level:libneonremovedThe one line in the last case is
Cannot load LibNeon, XML search disabled., andNUT_DEBUG_LEVEL=1still shows every name tried and why it failed.make checkandmake spellcheckpass.tests/NIT/nit.shskips itsnut-scannercheck by matching the old per-name line, so I pointed it at the new summary line. I checked the pattern against real scanner output but did not run NIT itself.I went with one static helper in
nutscan-init.crather than the per-librarynutscan_report_*_library()ones from the thread, since the verdict needs no reason from the loader and the per-name text stays in eachscan_*.c. Happy to switch if you'd rather have the helpers!Disclosure per the template, this was written with Claude Code (Anthropic) using Claude Opus 5.5, with review passes from Claude Opus 5.5 and Claude Fable 5.1 subagents. I reviewed all of it.
General points
Described the changes in the PR submission or a separate issue, e.g.
known published or discovered protocols, applicable hardware (expected
compatible and actually tested/developed against), limitations, etc.
There may be multiple commits in the PR, aligned and commented with
a functional change. Notably, coding style changes better belong in a
separate PR, but certainly in a dedicated commit to simplify reviews
of "real" changes in the other commits. Similarly for typo fixes in
comments or text documents.
Use of coding helper tools and AI should be disclosed in the commit
or PR comments (it is interesting to know which ones do a decent job).
As with other contributions, a human is responsible and thanked for the
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
acsiidocinputs). Particularly AI is keen on adding
mdashcharacters instead ofplain ASCII double-dash (which renders into the long dash where applicable).
Frequent "underwater rocks" for general C code PRs
in the code of the file, and examples/guide in
docs/developers.txtfile.General documentation updates
Added a bullet point into
NEWS.adoc, possibly alsoUPGRADING.adocif there is something packagers or custom-build users should take into
account (new driver categories, configuration options, dependencies...)
Passed
make spellcheck, updated spell-checking dictionary in thedocs/nut.dictfile if needed (did not remove any words -- themakerule printout in case of changes suggests how to maintain it).