Bug 201773 - net-mgmt/collectd5: Fix Python option when building with debug enabled python
Summary: net-mgmt/collectd5: Fix Python option when building with debug enabled python
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Brad Davis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-22 19:51 UTC by Suraj Ravichandran
Modified: 2015-08-14 20:37 UTC (History)
3 users (show)

See Also:
ports: maintainer-feedback-
suraj: merge-quarterly?


Attachments
Patch file fixing net-mgmt/colletd5 port to build with debug python (3.64 KB, patch)
2015-07-22 19:51 UTC, Suraj Ravichandran
no flags Details | Diff
Revised Patch file fixing net-mgmt/collectd5 port (version 5.50) to build with python plugin when using debug enabled python (2.71 KB, patch)
2015-08-11 05:47 UTC, Suraj Ravichandran
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Suraj Ravichandran 2015-07-22 19:51:48 UTC
Created attachment 159084 [details]
Patch file fixing net-mgmt/colletd5 port to build with debug python

The configure file of collectd depends on calling some python routines to obtain the version, library flags and so on.

Example:
python_library_flags=`echo "import distutils.sysconfig;import sys;sys.stdout.write(distutils.sysconfig.get_config_vars(\"BLDLIBRARY\").__getitem__(0))" | "$with_python_prog" 2>&1`

Now on a normal python instance this returns:
-L. -lpython2.7

But on a debug enabled python it results in:
-L. -lpython2.7[20106 refs]

The refcounts sneak in and break the configure process.

A simple fix to this is the redirect stderr to /dev/null:
thus the above example now becomes:
python_include_path=`echo "import distutils.sysconfig;import sys;sys.stdout.write(distutils.sysconfig.get_python_inc())" | "$with_python_prog" 2> /dev/null`

Patch file attached with all such fixes.
Comment 1 Suraj Ravichandran 2015-07-22 19:54:48 UTC
Please Note that this patch is submitted for the net-mgmt/colletd5 port from the 2015q2 branch.
Comment 2 Jason Unovitch freebsd_committer freebsd_triage 2015-07-23 00:52:20 UTC
(In reply to Suraj Ravichandran from comment #0)
Hello,
Your patch bumps PORTREVISION for net-mgmt/collectd but the files you've modified are under net-mgmt/collectd5/files/.  Your patch will need to be adjusted to be just net-mgmt/collectd5.

Also, I don't want to see any of your time spent on this to be in vain.  Bug 201514 is the net-mgmt/collectd5 update to 5.5.0.  Can you check that first and see if that resolves your issue and if it doesn't ensure your patch works on top of the 5.5.0 patch?
Comment 3 Jason Unovitch freebsd_committer freebsd_triage 2015-07-23 00:53:09 UTC
(In reply to Suraj Ravichandran from comment #1)
Please note that 2015Q2 is no longer supported.
Comment 4 Suraj Ravichandran 2015-07-23 00:58:03 UTC
Ok

Shoul i attach relevant diff for 2015Q3 or master?
Comment 5 Kubilay Kocak freebsd_committer freebsd_triage 2015-07-23 02:34:58 UTC
(In reply to Suraj Ravichandran from comment #4)

Always against HEAD, and set the merge-quarterly flag to ? here if it needs to be merged
Comment 6 Kubilay Kocak freebsd_committer freebsd_triage 2015-07-23 02:35:38 UTC
Also, is the fix for this going to be submitted upstream? If so please include breadcrumbs/comments in the patch header to include upstream references/links
Comment 7 Krzysztof 2015-07-23 06:16:12 UTC
Yes, I think this patch sholud be tested against new collectd-5.5.0. Beacuse collectd developers stopped working on collectd4 branch, so I think this port will be deleted (maybe after my vactions :-) ). Bust first https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=201514 must be committed to ports tree.
Comment 8 Suraj Ravichandran 2015-08-11 04:41:00 UTC
Thanks for upgrading to 5.5.0.

I just tested it with DEBUG enabled python and it still does not work.

I have made the relevant patch and this time it is with respect to HEAD and also I have not goofed up regarding changing the wrong port's PORTREVISION :-P

I will upload the patch in an hour or so.

In the meanwhile what am I supposed to add in the header w.r.t to this comment from @Kubilay Kocak
"""Also, is the fix for this going to be submitted upstream? If so please include breadcrumbs/comments in the patch header to include upstream references/links"""

And yes it would be nice if it were upstreamed eventually.

as for the merge-quaterly flag it is set to ? by me now.

Thanks.
Comment 9 Suraj Ravichandran 2015-08-11 05:47:35 UTC
Created attachment 159751 [details]
Revised Patch file fixing net-mgmt/collectd5 port (version 5.50) to build with python plugin when using debug enabled python
Comment 10 Krzysztof 2015-08-14 18:05:41 UTC
Well, I have to merge your patch with new issue bug #202327. So I think it is good idea to close one of these bugs
Comment 11 Suraj Ravichandran 2015-08-14 18:10:00 UTC
(In reply to Krzysztof from comment #10)
Sure, as long as it goes in.

If I am to close this bug (if you can close it that you be best) then what status,etc should I provide it with so that it can show that it links up with that other one.
Comment 12 Krzysztof 2015-08-14 18:37:26 UTC
Your patch is merged into bug #202327, so I will (try to) close this one.
Comment 13 Krzysztof 2015-08-14 18:39:57 UTC
Your patch is merged into bug #202327, so I will (try to) close this one.
Comment 14 Krzysztof 2015-08-14 18:56:51 UTC
Well, this bug should be closed. I'm not able to do it :-))) I hope that someone could :-)
Comment 15 commit-hook freebsd_committer freebsd_triage 2015-08-14 19:31:08 UTC
A commit references this bug:

Author: brd
Date: Fri Aug 14 19:30:13 UTC 2015
New revision: 394253
URL: https://svnweb.freebsd.org/changeset/ports/394253

Log:
  Add native disk metrics thanks to delphij, Ruben Kerkhof
  <ruben@rubenkerkhof.com>, and myself. [1]

  Fix Python option when building with debug enabled python [2]

  PR:		202327 [1]
  PR:		201773 [2]
  Submitted by:	brd [1]
  Submitted by:	Suraj Ravichandran <suraj@ixsystems.com> [2]
  Approved by:	Krzysztof <ports@bsdserwis.com> (maintainer), bdrewery (mentor)

Changes:
  head/net-mgmt/collectd5/Makefile
  head/net-mgmt/collectd5/files/patch-configure.ac
  head/net-mgmt/collectd5/files/patch-src__Makefile.am
  head/net-mgmt/collectd5/pkg-plist
Comment 16 Brad Davis freebsd_committer freebsd_triage 2015-08-14 19:32:16 UTC
Committed, thanks!
Comment 17 Suraj Ravichandran 2015-08-14 20:37:10 UTC
Thanks @Brad and @Krzysztof!