Bug 231824

Summary: devel/glib20: Fails to package with DEFAULT_VERSIONS=python=3.7
Product: Ports & Packages Reporter: Tobias Kortkamp <tobik>
Component: Individual Port(s)Assignee: Antoine Brodin <antoine>
Status: Closed FIXED    
Severity: Affects Only Me CC: python, raivo, vishwin, yasu
Priority: --- Flags: bugzilla: maintainer-feedback? (gnome)
Version: Latest   
Hardware: Any   
OS: Any   

Description Tobias Kortkamp freebsd_committer freebsd_triage 2018-09-30 14:40:41 UTC
After ports r480951 glib20 fails to package with DEFAULT_VERSIONS=python=3.7. It was fine before.

=======================<phase: package        >============================
===>  Building package for glib-2.56.1_1,1
pkg-static: Unable to access file /wrkdirs/usr/ports/devel/glib20/work/stage/usr/local/share/glib-2.0/codegen/__pycache__/__init__.opt-1.cpython-37.pyc:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/devel/glib20/work/stage/usr/local/share/glib-2.0/codegen/__pycache__/codegen.opt-1.cpython-37.pyc:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/devel/glib20/work/stage/usr/local/share/glib-2.0/codegen/__pycache__/codegen_docbook.opt-1.cpython-37.pyc:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/devel/glib20/work/stage/usr/local/share/glib-2.0/codegen/__pycache__/codegen_main.opt-1.cpython-37.pyc:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/devel/glib20/work/stage/usr/local/share/glib-2.0/codegen/__pycache__/config.opt-1.cpython-37.pyc:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/devel/glib20/work/stage/usr/local/share/glib-2.0/codegen/__pycache__/dbustypes.opt-1.cpython-37.pyc:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/devel/glib20/work/stage/usr/local/share/glib-2.0/codegen/__pycache__/parser.opt-1.cpython-37.pyc:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/devel/glib20/work/stage/usr/local/share/glib-2.0/codegen/__pycache__/utils.opt-1.cpython-37.pyc:No such file or directory
*** Error code 1
Comment 1 Raivo Hool 2018-09-30 20:45:31 UTC
Same behaviour with DEFAULT_VERSIONS=python=3.6.
Comment 2 Charlie Li freebsd_committer freebsd_triage 2018-10-01 02:26:49 UTC
This port's plist conflicts with Mk/Uses/python.mk in how PYTHON_PYOEXTENSION is defined. Currently, for the cases of Python 3.5 and later (which this bug applies to), PYTHON_PYOEXTENSION is just opt-1.pyc. But in this plist, the opt-1 part comes before the .cpython-%%PYTHON_SUFFIX%%.pyc, with the ending becoming opt-1.cpython-%%PYTHON_SUFFIX%%.pyc, which results in this build failure when python>=3.5.

CCing python@ for more input.
Comment 3 Charlie Li freebsd_committer freebsd_triage 2018-10-01 03:23:57 UTC
(In reply to Charlie Li from comment #2)
The offending line seems to be https://svnweb.freebsd.org/ports/head/Mk/Uses/python.mk?view=markup#l621

The .cpython-%%PYTHON_SUFFIX%% bit is placed between opt-1 and .pyc (resulting in opt1-cpython-%%PYTHON_SUFFIX%%.pyc), where instead should be before opt-1.pyc. The stage process for this port results in the correct locations and filenames, but the script that converts PYTHON_PYOEXTENSION for python >= 3.5 needs fixing. Unfortunately, my awk-fu is nearly nonexistent so it may take a while for me to prepare a patch (if it ends up being the case).
Comment 4 Charlie Li freebsd_committer freebsd_triage 2018-10-01 06:25:28 UTC
Looks like antoine@ fixed the plist. This can probably be closed now.
Comment 5 Kubilay Kocak freebsd_committer freebsd_triage 2018-10-02 07:40:19 UTC
See: ports r480998