Bug 260194

Summary: net-mgmt/pmacct: Update to 1.7.7
Product: Ports & Packages Reporter: Robert Clausecker <fuz>
Component: Individual Port(s)Assignee: Kurt Jaeger <pi>
Status: Closed FIXED    
Severity: Affects Only Me CC: pi
Priority: --- Flags: pi: maintainer-feedback+
fuz: merge-quarterly?
Version: Latest   
Hardware: Any   
OS: Any   
URL: http://www.pmacct.net/ChangeLog-1.7.7
Attachments:
Description Flags
net-mgmt/pmacct: update to 1.7.7
fuz: maintainer-approval+
extra-patch-i386
none
net-mgmt/pmacct: fix build on armv7 fuz: maintainer-approval? (pi)

Description Robert Clausecker freebsd_committer freebsd_triage 2021-12-03 23:06:12 UTC
Created attachment 229865 [details]
net-mgmt/pmacct: update to 1.7.7

net-mgmt/pmacct: update to 1.7.7

 - remove -Werror as per policy
 - touch up patches
 - remove PLABEL option for feature removed in 1.7.6

Changes: http://www.pmacct.net/ChangeLog-1.7.7

Tested with Poudriere on i386 amd64 armv7 arm64 FreeBSD 13.

Unfortunately the port doesn't seem to build without Poudriere:
configuring one of the subcomponents fails with "compiler cannot
create executable."  I was unable to solve this problem.  So please
review this patch before you merge it.
Comment 1 Robert Clausecker freebsd_committer freebsd_triage 2021-12-20 00:36:13 UTC
Comment on attachment 229865 [details]
net-mgmt/pmacct: update to 1.7.7

maintainer timeout
Comment 2 Robert Clausecker freebsd_committer freebsd_triage 2021-12-20 00:36:22 UTC
maintainer timeout
Comment 3 Kurt Jaeger freebsd_committer freebsd_triage 2022-01-26 17:32:22 UTC
Thanks for the patch. It fails to build on i386, because of this:

sql_common_m.c:262:48: error: format specifies type 'unsigned long' but the argument has type 'time_t' (aka 'int') [-Werror,-Wformat]
    snprintf(tmpptr, envbuf.end-tmpptr, "%lu", idata->elap_time);
                                         ~~~   ^~~~~~~~~~~~~~~~
                                         %d
sql_common_m.c:295:48: error: format specifies type 'unsigned long' but the argument has type 'time_t' (aka 'int') [-Werror,-Wformat]
    snprintf(tmpptr, envbuf.end-tmpptr, "%lu", idata->basetime);
                                         ~~~   ^~~~~~~~~~~~~~~
                                         %d
sql_common_m.c:306:48: error: format specifies type 'unsigned long' but the argument has type 'time_t' (aka 'int') [-Werror,-Wformat]
    snprintf(tmpptr, envbuf.end-tmpptr, "%lu", idata->timeslot);
                                         ~~~   ^~~~~~~~~~~~~~~
                                         %d
3 errors generated.

It's fine otherwise. I try to find a way to find a patch that is applied
on i386 only.
Comment 4 Robert Clausecker freebsd_committer freebsd_triage 2022-01-26 17:44:29 UTC
(In reply to Kurt Jaeger from comment #3)

Hi Kurt,

No need to that.  I'll update the patch such that it does not fail on i386 either.  It should be as simple as casting idata->elap_time, idata->basetime, and idata->timeslot to (long).
Comment 5 Kurt Jaeger freebsd_committer freebsd_triage 2022-01-26 18:27:43 UTC
Created attachment 231364 [details]
extra-patch-i386

Together with some change to the ports Makefile, this patch works.
Comment 6 Robert Clausecker freebsd_committer freebsd_triage 2022-01-26 19:51:56 UTC
Looks good!
Comment 7 Kurt Jaeger freebsd_committer freebsd_triage 2022-01-26 20:05:22 UTC
Committed, thanks!
Comment 8 commit-hook freebsd_committer freebsd_triage 2022-01-26 20:05:24 UTC
A commit in branch main references this bug:

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

commit c2da42cc80a9b3f707f6186c1e8c4ecbf1efb0f1
Author:     Robert Clausecker <fuz@fuz.su>
AuthorDate: 2022-01-26 20:03:41 +0000
Commit:     Kurt Jaeger <pi@FreeBSD.org>
CommitDate: 2022-01-26 20:03:41 +0000

    net-mgmt/pmacct: update 1.7.5 -> 1.7.7

    - remove -Werror as per policy
    - touch up patches
    - remove PLABEL option for feature removed in 1.7.6

    PR:             260194
    Changes:        http://www.pmacct.net/ChangeLog-1.7.7

 net-mgmt/pmacct/Makefile                           | 20 ++++++-------
 net-mgmt/pmacct/distinfo                           |  6 ++--
 net-mgmt/pmacct/files/extra-patch-i386 (new)       | 29 ++++++++++++++++++
 net-mgmt/pmacct/files/patch-Makefile.in            |  4 +--
 net-mgmt/pmacct/files/patch-src_nfacctd.c (gone)   | 11 -------
 .../files/patch-src_nfprobe__plugin_netflow9.c     |  4 +--
 net-mgmt/pmacct/files/patch-src_pgsql__plugin.c    |  4 +--
 net-mgmt/pmacct/files/patch-src_pmacct.c           |  8 ++---
 net-mgmt/pmacct/files/patch-src_pmacctd.c (gone)   | 11 -------
 net-mgmt/pmacct/files/patch-src_pmbgpd.c (gone)    | 11 -------
 net-mgmt/pmacct/files/patch-src_pmbmpd.c (gone)    | 11 -------
 .../pmacct/files/patch-src_pmtelemetryd.c (gone)   | 11 -------
 net-mgmt/pmacct/files/patch-src_sfacctd.c (gone)   | 11 -------
 .../pmacct/files/patch-src_sql__common.c (gone)    | 34 ----------------------
 net-mgmt/pmacct/files/patch-src_sqlite3__plugin.c  |  4 +--
 net-mgmt/pmacct/files/patch-src_util.c             | 13 ++-------
 net-mgmt/pmacct/pkg-plist                          |  2 ++
 17 files changed, 58 insertions(+), 136 deletions(-)
Comment 9 Robert Clausecker freebsd_committer freebsd_triage 2022-05-28 08:09:04 UTC
The port still fails to build on armv7 because you removed the part of my patch that removes -Werror.  Why did you do that?  -Werror is against policy as it leads to spurious build failures due to often benign things.

Now I have to produce yet another patch.  This sucks!
Comment 10 Robert Clausecker freebsd_committer freebsd_triage 2022-05-28 08:49:41 UTC
Reopening as the port still fails to build on armv7 due to a botched patch application.
Comment 11 Robert Clausecker freebsd_committer freebsd_triage 2022-05-28 09:06:09 UTC
Created attachment 234286 [details]
net-mgmt/pmacct: fix build on armv7

Here is another patch which has the parts you decided not to commit in the first round.  These are actually important.  Spurious warnings tend to cause random build failures so -Werror must be patched out.  I don't want to have to come and submit another patch.

The other part of the patch fixes a wrong type in a log call.  This causes a problem when the bgp session is more than 2^31 - 1 seconds out of date in which case it'll not show the correct amount of seconds by which it is out of date.  Terrifying issue, isn't it?  Good thing -Werror caught this one!
Comment 12 Kurt Jaeger freebsd_committer freebsd_triage 2022-06-12 19:33:45 UTC
(In reply to Robert Clausecker from comment #9)
Yes, I messed up the commit by missing out the two patch files.

I'll work to get your patch in.
Comment 13 Kurt Jaeger freebsd_committer freebsd_triage 2022-06-12 19:54:41 UTC
Committed fix for armv7.
Comment 14 commit-hook freebsd_committer freebsd_triage 2022-06-12 19:54:52 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=16f00133d92bda820f660e0c51575865d7a259b7

commit 16f00133d92bda820f660e0c51575865d7a259b7
Author:     Robert Clausecker <fuz@fuz.su>
AuthorDate: 2022-06-12 19:53:01 +0000
Commit:     Kurt Jaeger <pi@FreeBSD.org>
CommitDate: 2022-06-12 19:53:01 +0000

    net-mgmt/pmacct: fix build on armv7

    PR:             260194
    Author:    Robert Clausecker <fuz@fuz.su>

 net-mgmt/pmacct/Makefile                             |  2 +-
 net-mgmt/pmacct/files/patch-configure.ac (new)       | 20 ++++++++++++++++++++
 net-mgmt/pmacct/files/patch-src_bgp_bgp.c (new)      | 14 ++++++++++++++
 .../files/patch-src_external__libs_Makefile.am (new) | 16 ++++++++++++++++
 4 files changed, 51 insertions(+), 1 deletion(-)
Comment 15 Robert Clausecker freebsd_committer freebsd_triage 2022-06-21 21:30:19 UTC
And you've still not patched out -Werror.  See you next update I guess. :-(