Skip to content

Conversation

@jimklimov
Copy link
Member

@jimklimov jimklimov commented Mar 1, 2025

This PR follows up from #2825 to complete a feature originally tried there but excised due to added complexity/instability of original PoC builds. Also updates bits of documentation and general Makefile markup here and there, and presumably fixes a presumably broken delivery of some source files into "dist" archives in certain build circumstances.

The libnutconf library was until now treated in recipes as an internal detail of the nutconf tool, added to main codebase in PR #2283 and refined later on. However for third-party integrations it may be (or not be) interesting to experiment with use of the library as such, rather than calling the command-line tool (which allegedly provides a more stable API for integrations). IMHO there's too much placed into the header files for it to be stable, and some lower-level concepts were evolving since the branch merge into master.

To allow for such experiments, this PR introduces configure --with-dev-libnutconf to enable delivery of a (shared) library file and corresponding C++ headers.

UPDATE: This was originally "orthogonal to either --with-nutconf or --with-dev being enabled or disabled", but now is tied to those values IF --with-all=(auto|yes|no) is used and no explicit --with-dev-libnutconf value is requested. The updated decision logic is also documented in docs/configure.txt.

CC @arnaudquette-eaton if this can help in e.g. SmartNUT. Not sure how stable or unstable this API would end up being, but at least the PR makes it easier to try.

Feel free to CC @emilienkia-eaton @ericclappier-eaton and other initial authors/contributors to see how their baby grew :)

Also this tool (and/or maybe lib) may be useful in integrations like unraid (CC @desertwitch, how do I case its spelling correctly BTW?), HA (CC @aquette) and other embedding, rather them all keeping track of generating NUT configs.

@jimklimov jimklimov added packaging documentation C++ nut-scanner portability We want NUT to build and run everywhere possible nutconf NUT configuration library and tool labels Mar 1, 2025
@jimklimov jimklimov added this to the 2.8.3 milestone Mar 1, 2025
@AppVeyorBot
Copy link

…e -j` [networkupstools#2825]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…tions

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
… names

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…ddition of "skel"

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
* FIXME: Enable SO build, API version, etc. like in clients/Makefile.am and nut-scanner
* Headers somewhere there too

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…ing them into a library

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
… experimental) to generate the shared object file

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@jimklimov jimklimov force-pushed the deliver-nutconf-lib branch from 3d75e31 to e4b95f3 Compare March 1, 2025 20:25
@AppVeyorBot
Copy link

jimklimov added 10 commits March 2, 2025 12:45
…r lib+headers) and WITH_LIBNUTCONF (at least one of tool or lib)

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
… we already use it in libcommonclient.la

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…completes, report SUCCESS more visibly

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…tax of configure options

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…d --with-dev-libnutconf

The original independence of settings led to CI failures, where
explicit `--with-nutconf=auto --with-all=yes` correctly turned
`with_nutconf` to `no` on systems or build scenarios without the
required level of C++ support, but the defaulted `with_dev_libnutconf`
became `yes` (following `with_all`).

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@jimklimov jimklimov force-pushed the deliver-nutconf-lib branch from e4b95f3 to ffd0ba8 Compare March 2, 2025 11:55
@jimklimov jimklimov merged commit 3657a16 into networkupstools:master Mar 2, 2025
30 checks passed
@jimklimov jimklimov deleted the deliver-nutconf-lib branch March 2, 2025 17:27
jimklimov added a commit that referenced this pull request Mar 3, 2025
…t on packaging [#2828]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@jimklimov jimklimov restored the deliver-nutconf-lib branch April 15, 2025 09:45
@jimklimov jimklimov deleted the deliver-nutconf-lib branch April 15, 2025 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C++ documentation nut-scanner nutconf NUT configuration library and tool packaging portability We want NUT to build and run everywhere possible

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants