Bug 249298 - net-mgmt/net-snmp: 'make check-plist' fails with PYTHON on (5.9)
Summary: net-mgmt/net-snmp: 'make check-plist' fails with PYTHON on (5.9)
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: Ryan Steinmetz
URL:
Keywords: needs-patch, needs-qa
Depends on:
Blocks:
 
Reported: 2020-09-14 02:26 UTC by John Hein
Modified: 2020-09-14 15:48 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (zi)
koobs: merge-quarterly?


Attachments
[patch] fix missing .pyo and support python3 (4.11 KB, patch)
2020-09-14 15:00 UTC, John Hein
jcfyecrayz: maintainer-approval? (zi)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Hein 2020-09-14 02:26:04 UTC
% make -C /usr/ports/net-mgmt/net-snmp stage check-plist WITH=PYTHON
  .
  .
====> Checking for pkg-plist issues (check-plist)
===> Parsing plist
===> Checking for items in STAGEDIR missing from pkg-plist
===> Checking for items in pkg-plist which are not in STAGEDIR
Error: Missing: %%PYTHON_SITELIBDIR%%/netsnmp/__init__.pyo
Error: Missing: %%PYTHON_SITELIBDIR%%/netsnmp/client.pyo
Error: Missing: %%PYTHON_SITELIBDIR%%/netsnmp/tests/__init__.pyo
Error: Missing: %%PYTHON_SITELIBDIR%%/netsnmp/tests/test.pyo
===> Error: Plist issues found.
*** Error code 1


% ls work/usr/loc/lib/python2.7/site-packages/netsnmp
__init__.py
__init__.pyc
client.py
client.pyc
client_intf.so
tests
Comment 1 John Hein 2020-09-14 03:29:21 UTC
By the way, 5.9 seems to build fine with USES=python (instead of python:2.7).
Comment 2 John Hein 2020-09-14 15:00:23 UTC
Created attachment 217958 [details]
[patch] fix missing .pyo and support python3

Note that importing the netsnmp python support fails when using python2.7 (and there's a warning during the build that hints at the problem as well):

% python2.7 -c 'import netsnmp'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python2.7/site-packages/netsnmp/__init__.py", line 1, in <module>
    from .client import *
  File "/usr/local/lib/python2.7/site-packages/netsnmp/client.py", line 5, in <module>
    import netsnmp.client_intf
ImportError: /usr/local/lib/python2.7/site-packages/netsnmp/client_intf.so: Undefined symbol "PyUnicode_AsUTF8AndSize"



Patch attached:

 - add back PYDISTUTILS_INSTALL_ARGS (see patch-Makefile.in)

 - remove python 2.7 support (see above run-time failure and changes to Makefile)

 - add python3 support (3.5+)


QA:

 - poudriere build with default python (3.7) (ok)
 - portlint (no errors, no new warnings)
 - basic run test: python -c 'import netsnmp'
Comment 3 Ryan Steinmetz freebsd_committer freebsd_triage 2020-09-14 15:48:13 UTC
Thanks!
Comment 4 commit-hook freebsd_committer 2020-09-14 15:48:42 UTC
A commit references this bug:

Author: zi
Date: Mon Sep 14 15:48:19 UTC 2020
New revision: 548623
URL: https://svnweb.freebsd.org/changeset/ports/548623

Log:
  - Fix PYTHON OPTION
  - Require python 3.5+

  PR:		249298
  Submitted by:	John Hein <jcfyecrayz@liamekaens.com>

Changes:
  head/net-mgmt/net-snmp/Makefile
  head/net-mgmt/net-snmp/files/patch-Makefile.in
  head/net-mgmt/net-snmp/pkg-plist