Skip to content

clients/upsclient.h: include sys/types.h#2475

Merged
jimklimov merged 1 commit intonetworkupstools:masterfrom
ffontaine:master
Jun 25, 2024
Merged

clients/upsclient.h: include sys/types.h#2475
jimklimov merged 1 commit intonetworkupstools:masterfrom
ffontaine:master

Conversation

@ffontaine
Copy link
Copy Markdown
Contributor

Include sys/types.h to avoid the following uclibc build failure with collectd raised since version 2.8.0 and
3f3851e:

configure:109633: checking int type of port argument for NUT upscli_splitname
configure:109665: /home/buildroot/instance-0/output-1/host/bin/x86_64-linux-gcc -c -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -O2 -g0   -Wall -Werror -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  conftest.c >&5
In file included from conftest.c:172:
/home/buildroot/instance-0/output-1/host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/upsclient.h:114:1: error: unknown type name 'ssize_t'; did you mean 'size_t'?
  114 | ssize_t upscli_sendline_timeout(UPSCONN_t *ups, const char *buf, size_t buflen, const time_t timeout);
      | ^~~~~~~
      | size_t

Fixes:

Include sys/types.h to avoid the following uclibc build failure with
collectd raised since version 2.8.0 and
3f3851e:

configure:109633: checking int type of port argument for NUT upscli_splitname
configure:109665: /home/buildroot/instance-0/output-1/host/bin/x86_64-linux-gcc -c -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -O2 -g0   -Wall -Werror -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  conftest.c >&5
In file included from conftest.c:172:
/home/buildroot/instance-0/output-1/host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/upsclient.h:114:1: error: unknown type name 'ssize_t'; did you mean 'size_t'?
  114 | ssize_t upscli_sendline_timeout(UPSCONN_t *ups, const char *buf, size_t buflen, const time_t timeout);
      | ^~~~~~~
      | size_t

Fixes:
 - http://autobuild.buildroot.org/results/205/2058f87ad7dbf7fbc62c8747855c82da4157ea35/collectd-5.12.0/config.log

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
@jimklimov jimklimov added bug portability We want NUT to build and run everywhere possible impacts-release-2.8.0 Issues reported against NUT release 2.8.0 (maybe vanilla or with minor packaging tweaks) impacts-release-2.8.1 Issues reported against NUT release 2.8.1 (maybe vanilla or with minor packaging tweaks) impacts-release-2.8.2 Issues reported against NUT release 2.8.2 (maybe vanilla or with minor packaging tweaks) labels Jun 15, 2024
@jimklimov jimklimov added this to the 2.8.3 milestone Jun 15, 2024
@jimklimov
Copy link
Copy Markdown
Member

Good catch, thanks!

Would you please share how such builds with alternative libc (uclibc, maybe musl) can be arranged for NUT CI farm builds? (Maybe buildroots are ok, maybe prepared LXC containers or some such to reduce R/W traffic for dependencies involved)

@ffontaine
Copy link
Copy Markdown
Contributor Author

I'm not familiar with CI but you could probably try to reuse what buildroot is using with gitlab CI:

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

Labels

bug impacts-release-2.8.0 Issues reported against NUT release 2.8.0 (maybe vanilla or with minor packaging tweaks) impacts-release-2.8.1 Issues reported against NUT release 2.8.1 (maybe vanilla or with minor packaging tweaks) impacts-release-2.8.2 Issues reported against NUT release 2.8.2 (maybe vanilla or with minor packaging tweaks) 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