Skip to content

nut-scanner: consolidate library selection - #3760

Open
user01010111 wants to merge 5 commits into
networkupstools:masterfrom
user01010111:refactor/scanner-library-selection
Open

user01010111 wants to merge 5 commits into
networkupstools:masterfrom
user01010111:refactor/scanner-library-selection

Conversation

@user01010111

@user01010111 user01010111 commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Following the load-reporting changes in #3739, consolidate the repeated library selection in tools/nut-scanner/nutscan-init.c into one private helper and explicit candidate lists. Preserve resolver-first lookup, fallback ordering, unload/reset behaviour, availability results and diagnostics, including libupsclient's different Windows ordering. Adapter loaders and public interfaces remain unchanged.

Compatibility and platform-specific rationale comments are retained beside the shared helper or candidate lists.

Add tests/nutscan-selection-test.c and register nine variants in tests/Makefile.am. The tests exercise real initialisation and the shared unloader with independent expectations for candidate order, entry and re-entry state, ownership and logging.

Validation:

  • Linux GCC suite 25/25, including all nine selection variants and 8,064 total cases.
  • Strict Clang: nine variants, 8,064 total cases, zero failures.
  • Native Windows/MinGW: affected library code built with strict warnings; suite 24/24, including all nine variants and 9,540 total cases with configured warning flags retained and NDEBUG enabled.
  • make distcheck-light and style checks passed; the archive contains the tested versions of the three code and build files.

Valgrind checks of the production library-selection and loading/cleanup paths reported no errors or lost blocks; retained allocations matched the baseline.

AI assistance: OpenAI Codex for implementation and tests; Claude Opus 5.5 for review.

user01010111 added 2 commits October 15, 2026 11:25
Signed-off-by: user01010111 <lapses.50.booster@icloud.com>
Signed-off-by: user01010111 <lapses.50.booster@icloud.com>
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

A ZIP file with standard source tarball and another tarball with pre-built docs for commit 63bbb15 is temporarily available: NUT-tarballs-PR-3760.zip.

Comment thread tests/nutscan-selection-test.c Dismissed
Comment thread tests/nutscan-selection-test.c Dismissed
@jimklimov jimklimov added nut-scanner refactor/fightwarn PR or issue proposal to improve code maintainability without functional changes, or to fix warnings labels Oct 15, 2026
@jimklimov jimklimov added this to the 2.8.6 milestone Oct 15, 2026
@github-actions github-actions Bot deleted a comment from AppVeyorBot Oct 18, 2026
@github-actions github-actions Bot deleted a comment from AppVeyorBot Oct 23, 2026
@AppVeyorBot

Copy link
Copy Markdown

✅ Build nut 2.8.5.5880-master completed (commit 13c001b6b4 by @jimklimov)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

nut-scanner refactor/fightwarn PR or issue proposal to improve code maintainability without functional changes, or to fix warnings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants