Bug 205248 - net-mgmt/collectd5: Fails to build due to lang/perl5.20 warning. Remove -Werror
Summary: net-mgmt/collectd5: Fails to build due to lang/perl5.20 warning. Remove -Werror
Status: Closed Not A Bug
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Jason Unovitch
URL:
Keywords: easy, patch, patch-ready
Depends on:
Blocks:
 
Reported: 2015-12-11 15:52 UTC by Ruben Kerkhof
Modified: 2016-04-03 00:43 UTC (History)
4 users (show)

See Also:
ports: maintainer-feedback+
koobs: merge-quarterly?


Attachments
collectd5-perl.patch (608 bytes, patch)
2015-12-14 22:23 UTC, Krzysztof
ports: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ruben Kerkhof 2015-12-11 15:52:32 UTC
Collectd links against libperl
Since Collectd compiles with -Werror, this results in:

  CC       perl_la-perl.lo
In file included from perl.c:46:
In file included from /usr/local/lib/perl5/5.20/mach/CORE/perl.h:5199:
/usr/local/lib/perl5/5.20/mach/CORE/inline.h:311:9: error: nonnull parameter 'pv' will evaluate to 'true' on first encounter [-Werror,-Wpointer-bool-conversion]
    if (pv && len > 1) {
        ^~ ~~
1 error generated.
Makefile:4321: recipe for target 'perl_la-perl.lo' failed
gmake[3]: *** [perl_la-perl.lo] Error 1
gmake[3]: Leaving directory '/usr/home/ruben/src/collectd/src'
Makefile:4741: recipe for target 'all-recursive' failed
gmake[2]: *** [all-recursive] Error 1
gmake[2]: Leaving directory '/usr/home/ruben/src/collectd/src'
Makefile:3147: recipe for target 'all' failed
gmake[1]: *** [all] Error 2
gmake[1]: Leaving directory '/usr/home/ruben/src/collectd/src'
Makefile:553: recipe for target 'all-recursive' failed
gmake: *** [all-recursive] Error 1

Not a big issue, but I wanted to report it anyway.
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2015-12-12 04:32:51 UTC
Correctly report this as a net-mgmt/collectd5 issue, cc maintainers of both ports
Comment 2 Krzysztof 2015-12-14 22:22:29 UTC
I've made a quick patch to cover this issue. See attachment.
Comment 3 Krzysztof 2015-12-14 22:23:18 UTC
Created attachment 164245 [details]
collectd5-perl.patch
Comment 4 Krzysztof 2015-12-14 22:25:07 UTC
Of course I've tested this patch in my lab:
https://rtm.bsdserwis.com/poudriere/data/a1amd64-testing/2015-12-14_15h32m45s/logs/collectd5-5.5.0_5.log
Comment 5 Ruben Kerkhof 2015-12-15 08:47:33 UTC
Thanks for the patch, but I was hoping this could be solved in libperl, since this would fix it for everyone linking against it, not just collectd.

For what it's worth, I already added an option to build collectd without Werror upstream: https://github.com/collectd/collectd/commit/71e07cf654c476ab13bf30421524b442cc9ad5a7 and this will be in the next release.
Comment 6 Mathieu Arnold freebsd_committer freebsd_triage 2015-12-15 10:10:49 UTC
Building with -Werror in production while linking with outside code is a very bad idea to begin with.
Comment 7 Ruben Kerkhof 2015-12-15 11:38:42 UTC
FWIW I fully agree, but unfortunately not everyone shares that opinion.
Comment 8 Jason Unovitch freebsd_committer freebsd_triage 2016-01-12 01:05:03 UTC
The delay was I was trying to figure out if this was something I missed when testing the last net-mgmt/collectd5 updates.  However with perl5=5.18, perl5=5.20, and perl5-5.22 set as DEFAULT_VERSIONS this port builds just fine.  Then I realized this was built from "/usr/home/ruben/src/collectd/src" and is not the net-mgmt/collectd5 port.  What really needs to be done here?  I'm not seeing a before and after "fix" from the patch as the net-mgmt/collectd5 port has been building just fine with all versions of Perl.
Comment 9 Ruben Kerkhof 2016-01-12 09:35:28 UTC
I opened this issue against perl, not collectd. I was indeed building collectd from its master branch.

Collectd from ports builds just fine since it already patches out -Werror. The patch from comment #3 has no effect.

All I'm asking is for a small fix in perl.h which fixes the warning shown in comment #1. This will benefit every program building against libperl.
Comment 10 Mathieu Arnold freebsd_committer freebsd_triage 2016-01-12 22:47:34 UTC
(In reply to Ruben Kerkhof from comment #9)
> All I'm asking is for a small fix in perl.h which fixes the warning shown in
> comment #1. This will benefit every program building against libperl.

All you have to do is to submit your patch upstream, have it included, and it'll be fixed in future versions of Perl.
Comment 11 Jason Unovitch freebsd_committer freebsd_triage 2016-04-03 00:43:08 UTC
(In reply to Ruben Kerkhof from comment #9)
I hadn't seen a confirmation that this was reported to Perl upstream but as this is "not a (FreeBSD ports) bug" I'm setting this PR as such now.