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

NUT plugin: fix "port" and "answer_num" to stricter int types… #4043

Merged
merged 2 commits into from Sep 8, 2022

Conversation

jimklimov
Copy link
Contributor

@jimklimov jimklimov commented Aug 31, 2022

…as required by NUT headers since v2.8.0 release (and cater to architecture-dependent int types if building against older NUT releases)

Inspired by discussion at networkupstools/nut#1638 with @ffontaine (maintainer of this plugin, AFAIK?)

This is a quick fix for build errors with "reproducer" set up as documented at: networkupstools/nut#1638 (comment)

ChangeLog: nut plugin: adapted to NUT public API changes in version 2.8.0

@jimklimov jimklimov requested a review from a team as a code owner August 31, 2022 09:43
@jimklimov
Copy link
Contributor Author

jimklimov commented Aug 31, 2022

Eh, guess I need to fiddle with configure to detect proper int types for the NUT API revision it is building against :\

@jimklimov jimklimov force-pushed the fix/nut-2.8.0 branch 2 times, most recently from db5276e to c33d95e Compare August 31, 2022 11:12
…d against

Either use the stricter int types required by NUT headers since v2.8.0 release,
or the relaxed (arch-dependent) types required by older NUT releases - depending
on which NUT API version the collectd is building against at the moment.

Inspired by discussion at networkupstools/nut#1638
@jimklimov jimklimov changed the title src/nut.c: fix "port" and "answer_num" to stricter int types… NUT plugin: fix "port" and "answer_num" to stricter int types… Aug 31, 2022
@jimklimov
Copy link
Contributor Author

Sorry about the back-and-forth in your CI setup... getting it to complain in the right places at right times (and so detect currently suitable types) took a few iterations :)

… NUT plugin

NOTE: src/nut.c also has pragmas to error out in this situation,
but that handling is compiler-dependent and happens too late in
the checkout/configure/build loop.

Presumably this inability to find the type in the earlier-found header file
is also triggered by build environment "inconsistencies" like lack of basic
types in the libc implementation (maybe highlighting the need for additional
headers or macros for the platform).
@mrunge
Copy link
Member

mrunge commented Sep 6, 2022

thanks!

@jimklimov
Copy link
Contributor Author

I suppose the recently appearing FAIL: test_plugin_virt is not relevant to this change? :)

@mrunge
Copy link
Member

mrunge commented Sep 8, 2022

The test failures have nothing to do with this patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants