Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Add a test case for NUT with musl libc implementation (and non-fatally, a recent collectd source for good measure) #2382

Open
jimklimov opened this issue Apr 4, 2024 · 0 comments
Labels
CI Entries related to continuous integration infrastructure (historically also recipes like Makefiles) portability We want NUT to build and run everywhere possible
Projects
Milestone

Comments

@jimklimov
Copy link
Member

jimklimov commented Apr 4, 2024

As for the build log, I suppose most of the error noise about ups->conn as an int is because of C defaulting:

src/nut.c:40:2: error: #error "Unable to determine the UPS connection type."
   40 | #error "Unable to determine the UPS connection type."
      |  ^~~~~
src/nut.c:46:3: error: unknown type name 'collectd_upsconn_t'
   46 |   collectd_upsconn_t *conn;
      |   ^~~~~~~~~~~~~~~~~~

further due to this:

checking upsclient.h usability... yes
checking upsclient.h presence... yes
checking for upsclient.h... yes
checking for upscli_connect in -lupsclient... yes
checking for upscli_init in -lupsclient... yes
checking for upscli_tryconnect in -lupsclient... yes
checking for UPSCONN_t... no
checking for UPSCONN... no

Not sure why configure decides the header is usable if it then fails to parse/use it, I suppose - if it does not find the UPSCONN_t as usable. But the code build does not seem to fail because of the header syntax (consumer C file includes time.h elsewhere in the chain before upsclient.h?) - e.g. it knows to expect struct <anonymous> * here:

In file included from src/nut.c:33:
/usr/lfs/hdd_v1/rc-buildroot-test/scripts/instance-1/output-1/host/i586-buildroot-linux-musl/sysroot/usr/include/upsclient.h:82:13: note: expected 'UPSCONN_t *' {aka 'struct <anonymous> *'} but argument is of type 'int *'
   82 | const char *upscli_strerror(UPSCONN_t *ups);
      |             ^~~~~~~~~~~~~~

In fact, for that build log I do not see mention of time_t at all.

However some other changes to less loose data types, like uint16_t vs. earlier int for the port numbers may need to be fixed in the consumer codebase. At least that much of the change was "sort of" documented:
https://github.com/networkupstools/nut/blob/master/UPGRADING#L51-L59

Originally posted by @jimklimov in #1638 (comment)

@jimklimov jimklimov added this to the 2.8.3 milestone Apr 4, 2024
@jimklimov jimklimov added CI Entries related to continuous integration infrastructure (historically also recipes like Makefiles) portability We want NUT to build and run everywhere possible labels Apr 4, 2024
@jimklimov jimklimov added this to TODO in NUT QA Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Entries related to continuous integration infrastructure (historically also recipes like Makefiles) portability We want NUT to build and run everywhere possible
Projects
Development

No branches or pull requests

1 participant