Bug 263791 - net-mgmt/collectd5 fails to build against sysutils/nut 2.8.0
Summary: net-mgmt/collectd5 fails to build against sysutils/nut 2.8.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Cy Schubert
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-05 10:00 UTC by Petteri Valkonen
Modified: 2022-05-10 11:28 UTC (History)
2 users (show)

See Also:
cy: maintainer-feedback? (ports)


Attachments
Poudriere build log for collectd5-5.12.0_5 (186.72 KB, text/plain)
2022-05-05 10:00 UTC, Petteri Valkonen
no flags Details
This will fix it (3.48 KB, patch)
2022-05-07 02:10 UTC, Cy Schubert
no flags Details | Diff
Use this patch instead. (1.45 KB, patch)
2022-05-07 02:24 UTC, Cy Schubert
no flags Details | Diff
Poudriere build log for collectd5-5.12.0_5 w/ configure failure (52.01 KB, text/plain)
2022-05-10 10:25 UTC, Petteri Valkonen
no flags Details
Config.log for configure failure (623.14 KB, text/plain)
2022-05-10 11:28 UTC, Petteri Valkonen
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petteri Valkonen 2022-05-05 10:00:12 UTC
Created attachment 233739 [details]
Poudriere build log for collectd5-5.12.0_5

Sysutils/nut was recently updated to version 2.8.0. After the update, collectd5-5.12.0_5 fails to build when the NUT plugin is enabled (NUTUPS=on) with the following error:

libtool: compile:  cc -DHAVE_CONFIG_H -I. -I./src -I./src -I./src/daemon -DPREFIX=\"/usr/local\" -DCONFIGFILE=\"/usr/local/etc/collectd.conf\" -DLOCALSTATEDIR=\"/var\" -DPKGLOCALSTATEDIR=\"/var/db/collectd\" -DPLUGINDIR=\"/usr/local/lib/collectd\" -DPKGDATADIR=\"/usr/local/share/collectd\" -I/usr/local/include -Wall -I/usr/local/include -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -MT src/nut_la-nut.lo -MD -MP -MF src/.deps/nut_la-nut.Tpo -c src/nut.c  -fPIC -DPIC -o src/.libs/nut_la-nut.o
src/nut.c:40:2: error: "Unable to determine the UPS connection type."
#error "Unable to determine the UPS connection type."
 ^
src/nut.c:46:3: error: unknown type name 'collectd_upsconn_t'
  collectd_upsconn_t *conn;
  ^
src/nut.c:89:66: warning: incompatible pointer types passing 'int *' to parameter of type 'uint16_t *' (aka 'unsigned short *') [-Wincompatible-pointer-types]
  status = upscli_splitname(name, &ups->upsname, &ups->hostname, &ups->port);
                                                                 ^~~~~~~~~~
/usr/local/include/upsclient.h:109:14: note: passing argument to parameter 'port' here
                        uint16_t *port);
                                  ^
1 warning and 2 errors generated.
gmake[2]: *** [Makefile:8330: src/nut_la-nut.lo] Error 1
gmake[2]: Leaving directory '/wrkdirs/usr/ports/net-mgmt/collectd5/work/collectd-5.12.0'
gmake[1]: *** [Makefile:5455: all] Error 2
gmake[1]: Leaving directory '/wrkdirs/usr/ports/net-mgmt/collectd5/work/collectd-5.12.0'
*** Error code 1

Please see the attached Poudriere build log for more details.

When NUT is downgraded to version 2.7.4_20 (from Quarterly) the port (and plugin) builds fine.
Comment 1 Krzysztof 2022-05-06 06:33:33 UTC
What can I say?

I've checked collectd github repository. I did not find any issues relating to newer version of nut.

So I think we should make some patches which will support new version of nut. Because main github repo seems very stable - there is one commit per month...

@Petteri: do you have some ideas what to change?
Comment 2 Cy Schubert freebsd_committer freebsd_triage 2022-05-07 01:59:13 UTC
Have you checked config.log? It should tell you what the problem is.
Comment 3 Cy Schubert freebsd_committer freebsd_triage 2022-05-07 02:10:47 UTC
Created attachment 233781 [details]
This will fix it

This will fix your problem.

I'll push this commit sometime Monday or Tuesday.
Comment 4 Cy Schubert freebsd_committer freebsd_triage 2022-05-07 02:24:38 UTC
Created attachment 233782 [details]
Use this patch instead.

There was something odd about the previous patch. It didn't take into account the post-patch target. This one is correct.
Comment 5 Cy Schubert freebsd_committer freebsd_triage 2022-05-07 02:36:09 UTC
@Krzysztof,

These outside of the scope of this PR but it's recommended that these be fixed these too.

====> Running Q/A tests (stage-qa)
Error: /usr/local/lib/collectd/cpu.so is linked to /usr/local/lib/libstatgrab.so.10 from devel/libstatgrab but it is not declared as a dependency
Warning: you need LIB_DEPENDS+=libstatgrab.so:devel/libstatgrab
Error: /usr/local/lib/collectd/dns.so is linked to /usr/local/lib/libpcap.so.1 from net/libpcap but it is not declared as a dependency
Warning: you need LIB_DEPENDS+=libpcap.so:net/libpcap
====> Checking for pkg-plist issues (check-plist)
Comment 6 commit-hook freebsd_committer freebsd_triage 2022-05-09 18:12:36 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=91943263b3fab0662169ae5b4a73488022ec6ee1

commit 91943263b3fab0662169ae5b4a73488022ec6ee1
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2022-05-07 02:22:31 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2022-05-09 17:49:53 +0000

    net-mgmt/collectd5: Chase 31418910e0f4, update sysutils/nut to 2.8.0

    Nut upsclient.h no longer includes time.h. Apps which build against
    upsclient.h must now include time.h or fail to detect nut libraries
    due to missing time_t.

    PR:             263791
    Reported by:    Petteri Valkonen <petteri.valkonen@iki.fi>

 net-mgmt/collectd5/files/patch-configure.ac | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
Comment 7 Petteri Valkonen 2022-05-10 10:25:25 UTC
Created attachment 233833 [details]
Poudriere build log for collectd5-5.12.0_5 w/ configure failure
Comment 8 Petteri Valkonen 2022-05-10 10:29:45 UTC
@Cy, the port is still failing to build for me on Poudriere, albeit now with a different error.

Firstly, configure is saying that it doesn't recognise the 'with-upsclient' option:

configure: WARNING: unrecognized options: --disable-lvm, --without-liblvm2app, --without-libjvm, --without-libnotify, --with-upsclient, --without-perl, --without-postgresql, --without-python, --disable-rabbitmq, --without-libsigrok, --without-virt, --without-libzookeeper

Which results in an error later on:

 nut . . . . . . . . . no (pkg-config doesn't know libupsclient) (dependency error)

...

configure: error: "Some plugins are missing dependencies - see the summary above for details"
===>  Script "configure" failed unexpectedly.

I've attached the Poudriere build log again.
Comment 9 Petteri Valkonen 2022-05-10 11:28:02 UTC
Created attachment 233834 [details]
Config.log for configure failure

Here's the config.log for the failing build.