Skip to content

Implement parallel nut-scanner scanning support on MacOS, fix NUT build on Solaris 8#2539

Merged
jimklimov merged 25 commits intonetworkupstools:masterfrom
jimklimov:issue-2522
Jul 19, 2024
Merged

Implement parallel nut-scanner scanning support on MacOS, fix NUT build on Solaris 8#2539
jimklimov merged 25 commits intonetworkupstools:masterfrom
jimklimov:issue-2522

Conversation

@jimklimov
Copy link
Copy Markdown
Member

Closes: #2522

Detect dysfunctional (on MacOS) sem_init() (unnamed) and functional sem_open() (named) semaphore support.

Update nut-scanner to work with either technology.

Tested on MacOS and Linux to do successfully run parallel scans.

Not quite sure what should happen if sem_init()/sem_open() fails. This code drops the max_threads_scantype to 0, to avoid probing a NULL named semaphore pointer. Currently there are no similar provisions for the global limiting semaphore (to skip if null).

jimklimov and others added 11 commits July 16, 2024 19:04
….h> and/or <float.h> [networkupstools#1176]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…test.c et al: introduce a NUT_CHECK_BOOL scriptlet and a header with nut_bool_t type [networkupstools#1176]

Chose to use a unique type name to avoid conflicts with third-party headers
which deliver a `bool_t` (currently commonly hacked into many NUT sources).

Using lower-cased `true` and `false` values, hoping for maximum compatibility
with C99 and newer language standards (if the compilers do implement them on
whatever obscure platform NUT gets built on, and then our new `nut_bool_t`
definition can be just an alias for what the language gives us).

A test case was added to make sure it behaves as expected on different systems.

Converting the sources from their custom type definitions and usages would
be a separate step.

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…ariable pc_path pkg-config` for troubleshooting

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…onfig program, neuter its PKG_CONFIG_LIBDIR

Imported from wxWidgets project; their license is LGPL-based with extra permissions:
https://github.com/wxWidgets/wxWidgets/blob/master/docs/licence.txt

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
… lines [networkupstools#2510]

While we group by those (by default, overridable) when generating the `ChangeLog`,
we ignore the e-mail for comparisons -- and different signatures can matter!

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

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…they vary in preferences

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…etworkupstools#2522]

Should fail e.g. on MacOS where it is present in headers
but not implemented and throws deprecation warnings which
our compile+link(+run) check can use to rule out the support.

Signed-off-by: Jim Klimov <jimklimov@gmail.com>
…e of files [networkupstools#2511]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@jimklimov jimklimov added enhancement nut-scanner macOS portability We want NUT to build and run everywhere possible labels Jul 17, 2024
@jimklimov jimklimov added this to the 2.8.3 milestone Jul 17, 2024
…y something else if possible

MacOS ships 3.x and does not grok our syntax;
their HomeBrew version is ok.

Signed-off-by: Jim Klimov <jimklimov@gmail.com>
Signed-off-by: Jim Klimov <jimklimov@gmail.com>
Signed-off-by: Jim Klimov <jimklimov@gmail.com>
Signed-off-by: Jim Klimov <jimklimov@gmail.com>
@jimklimov
Copy link
Copy Markdown
Member Author

Previous build stumbled on some of the issues solved by PR #2538 (and this one would solve some issues with the new MacOS agent that would preclude other PRs from getting built), so merged that and #2537 branches into this one.

Probably merging it later (after tests pass) would auto-close those too.

@jimklimov jimklimov force-pushed the issue-2522 branch 3 times, most recently from 947f61c to bef2bca Compare July 18, 2024 21:03
@jimklimov jimklimov changed the title Implement parallel nut-scanner scanning support on MacOS Implement parallel nut-scanner scanning support on MacOS, fix NUT build on Solaris 8 Jul 18, 2024
@jimklimov jimklimov added the Solaris/illumos Solaris and illumos systems (OpenIndiana, OmniOS, SmartOS, TribbliX...) label Jul 18, 2024
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@jimklimov
Copy link
Copy Markdown
Member Author

jimklimov commented Jul 18, 2024

While testing SEMLIBS definition fixes (with -lrt additionally needed for Solaris, and -lpthread explicitly for some of BSDs), found that Solaris 8 did not build some recent NUT changes (not part of CI farm). Fixed in recent commits here.

Closes: #2337
Thanks to https://stackoverflow.com/questions/16647819/timegm-cross-platform

jimklimov and others added 9 commits July 19, 2024 00:03
… on MacOS+Homebrew

Signed-off-by: Jim Klimov <jimklimov@gmail.com>
…y in threaded builds [networkupstools#2522]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…CREAT header [networkupstools#2522]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…OR_LINK_IFELSE() just a bit below) [networkupstools#2522]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…allback.c: add a fallback timegm()

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…ll getifaddr() related methods [networkupstools#2244]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@jimklimov
Copy link
Copy Markdown
Member Author

jimklimov commented Jul 19, 2024

The couple of failed scenarios are due to tinkering with the MacOS build agent. No clang-cpp there, and attempts to symlink a program name like that end up freezing.

Another couple due to misplaced label claiming it can build all driver types (can not, e.g. avahi is missing).

@jimklimov jimklimov merged commit cfe4985 into networkupstools:master Jul 19, 2024
@jimklimov jimklimov deleted the issue-2522 branch July 19, 2024 08:15
@jimklimov jimklimov restored the issue-2522 branch April 15, 2025 09:41
@jimklimov jimklimov deleted the issue-2522 branch April 15, 2025 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement macOS nut-scanner portability We want NUT to build and run everywhere possible Solaris/illumos Solaris and illumos systems (OpenIndiana, OmniOS, SmartOS, TribbliX...)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Want to implement parallel nut-scanner scanning support on MacOS

1 participant