Bug 257660 - mail/mailutils: PYTHON option can fail if python-config (from lang/python) is installed
Summary: mail/mailutils: PYTHON option can fail if python-config (from lang/python) is...
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: Alexey Dokuchaev
URL:
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2021-08-06 14:54 UTC by John Hein
Modified: 2021-08-11 06:34 UTC (History)
5 users (show)

See Also:
koobs: maintainer-feedback? (danfe)
koobs: maintainer-feedback? (zeus)
koobs: merge-quarterly?


Attachments
[patch] set PYTHON_CONFIG to match PYTHON_CMD (438 bytes, patch)
2021-08-06 15:07 UTC, John Hein
koobs: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Hein 2021-08-06 14:54:21 UTC
If lang/python is installed, python-config is a symlink to python3-config (or in the old days, python2-config).  If lang/python was installed when an older python was the default python than the current default python, then python-config will point to the older version.

example:
% ls -al /usr/local/bin/python-config /usr/local/bin/python3-config
lrwxr-xr-x  1 root  wheel  14 Dec 18  2019 /usr/local/bin/python-config@ -> python3-config
lrwxr-xr-x  1 root  wheel  16 Aug 18  2020 /usr/local/bin/python3-config@ -> python3.7-config
% make -C /usr/ports/lang/python -V PYTHON_CMD
/usr/local/bin/python3.8

The configure script for mail/mailutils has a seat belt to verify that python-config (or $PYTHON_CONFIG) matches the version in the python header files it is using.  When it doesn't match, configure overrides --enable-python and disables it.

From the configure script:

$as_echo_n "checking whether python-config ($PYTHON_CONFIG) is of same version as python... " >&6; }
 .
 .

As a result of that, none of the python files are installed and pkg-plist does not reflect that (it expects the python files).  'make check-plist' and 'make package' fail.


% make stage check-plist
 .
 .
===> Checking for items in pkg-plist which are not in STAGEDIR
Error: Missing: lib/libmu_py.a
Error: Missing: lib/libmu_py.so
Error: Missing: lib/libmu_py.so.8
Error: Missing: lib/libmu_py.so.%%LIBVERSION%%
Error: Missing: %%PYTHON_SITELIBDIR%%/mailutils/__init__.py
Error: Missing: %%PYTHON_SITELIBDIR%%/mailutils/__pycache__/__init__%%PYTHON_EXT_SUFFIX%%.opt-1.pyc
Error: Missing: %%PYTHON_SITELIBDIR%%/mailutils/__pycache__/__init__%%PYTHON_EXT_SUFFIX%%.pyc


If you don't have the PYTHON option enabled or python-config matches PYTHON_CMD, then you won't hit this problem.

It's possible that when changing python defaults, we should be bumping PORTRE
Comment 1 Bugzilla Automation freebsd_committer 2021-08-06 14:54:21 UTC
Maintainer informed via mail
Comment 2 John Hein 2021-08-06 14:57:43 UTC
(In reply to Bugzilla Automation from comment #1)
That last bit was truncated... sorry.  I meant to write:

It's possible that when changing the ports tree's default python version, we should be bumping PORTREVISION for lang/python and lang/python3.  python@ cc'd.  I think this sometimes occurred in the past for some updates of the default python version, but not always.
Comment 3 John Hein 2021-08-06 15:07:31 UTC
Created attachment 226989 [details]
[patch] set PYTHON_CONFIG to match PYTHON_CMD

This patch makes it more explicit - telling configure exactly what python config script to use via PYTHON_CONFIG.  This helps avoid the edge case described by this PR.

No need to bump PORTREVISION with this patch as it fixes a build breakage and does not change a successfully built package.

QA:
  poudriere - ok
  portlint - ok (no new warnings)
Comment 4 John Hein 2021-08-06 15:10:02 UTC
Note: the maintainer does not have his email registered with bugzilla, so he will not get automatic notifications regarding this bug.
Comment 5 Kubilay Kocak freebsd_committer freebsd_triage 2021-08-07 02:27:21 UTC
^Triage: Requested maintainer update bugzilla or maintainer email to match each other in bug 235890 comment 2 (2019).

Request feedback from committer of previous updates to this port (commented as approved by maintainer in the past), to address this update and MAINTAINER line.
Comment 6 Kubilay Kocak freebsd_committer freebsd_triage 2021-08-07 02:27:59 UTC
Comment on attachment 226989 [details]
[patch] set PYTHON_CONFIG to match PYTHON_CMD

Pending QA confirmation, this change is:

Approved by: portmgr (blanket: bugfix, python compliance)
MFH: 202Q3
Comment 7 Kubilay Kocak freebsd_committer freebsd_triage 2021-08-07 02:30:29 UTC
^Triage: Identified two accounts in Bugzilla that match first/lastname of MAINTAINER, request feedback from both on which email address to change MAINTAINER or Bugzilla account to
Comment 8 Kubilay Kocak freebsd_committer freebsd_triage 2021-08-07 02:31:06 UTC
^Triage: Take this for now to coordinate MAINTAINER issue
Comment 9 Zeus Panchenko 2021-08-10 08:46:03 UTC
(In reply to Kubilay Kocak from comment #8)

greetings

The email set as MAINTAINER value in port is the valid one

What am I expected to do further, please?
Comment 10 Kubilay Kocak freebsd_committer freebsd_triage 2021-08-10 11:40:46 UTC
(In reply to Zeus Panchenko from comment #9)

If you could update one of your accounts in Bugzilla to have the email match the MAINTAINER line that would be great. You can do that from: https://bugs.freebsd.org/bugzilla/userprefs.cgi?tab=account
Comment 11 Zeus Panchenko 2021-08-10 12:53:23 UTC
(In reply to Kubilay Kocak from comment #10)
I've done that before my previous reply
Comment 12 Kubilay Kocak freebsd_committer freebsd_triage 2021-08-11 01:01:44 UTC
(In reply to Zeus Panchenko from comment #11)

Thank you.

^Triage: Open to take
Comment 13 commit-hook freebsd_committer 2021-08-11 06:32:49 UTC
A commit in branch main references this bug:

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

commit 610f18d6b3783f6adaf27541a5228ba2e502a6e6
Author:     Alexey Dokuchaev <danfe@FreeBSD.org>
AuthorDate: 2021-08-11 06:31:24 +0000
Commit:     Alexey Dokuchaev <danfe@FreeBSD.org>
CommitDate: 2021-08-11 06:31:31 +0000

    mail/mailutils: pass correct python-config to the configure script.

    PR:     257660

 mail/mailutils/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 14 Alexey Dokuchaev freebsd_committer 2021-08-11 06:34:31 UTC
Committed, thank you.