Bug 262823 - textproc/py-libxml2: Include bytecode files in package
Summary: textproc/py-libxml2: Include bytecode files in package
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-desktop (Team)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-26 12:09 UTC by Daniel Engberg
Modified: 2022-04-10 20:36 UTC (History)
4 users (show)

See Also:
bugzilla: maintainer-feedback? (desktop)


Attachments
Patch for py-libxml2 (1.45 KB, patch)
2022-03-26 12:09 UTC, Daniel Engberg
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Engberg freebsd_committer freebsd_triage 2022-03-26 12:09:19 UTC
Created attachment 232731 [details]
Patch for py-libxml2

This fixes build_fs_violation while running "poudriere bulk" with -t flag

Reported by sunpoet

Compile tested on FreeBSD 13.0-STABLE #2 stable/13-n248607-93a95ebbf7c (amd64) (make, make check-plist)
Poudriere testport OK 12.2-RELEASE (amd64)
Poudriere testport OK 13.0-RELEASE (i386)
Comment 1 commit-hook freebsd_committer freebsd_triage 2022-03-28 07:19:55 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=25c952626c32a1830793a770b8f401a7d5370905

commit 25c952626c32a1830793a770b8f401a7d5370905
Author:     Daniel Engberg <diizzy@FreeBSD.org>
AuthorDate: 2022-03-28 07:16:43 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2022-03-28 07:16:50 +0000

    textproc/py-libxml2: Include bytecode files in package

    This fixes build_fs_violation while running "poudriere bulk" with -t flag

    PR:             262823
    Reported by:    sunpoet
    Approved by:    portmgr (blanket)

 textproc/py-libxml2/Makefile | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
Comment 2 Daniel Engberg freebsd_committer freebsd_triage 2022-03-29 06:20:21 UTC
This fails on 3.7 due to https://cgit.freebsd.org/ports/tree/Mk/Uses/python.mk#n474, ideas on how to fix this are welcome.
Comment 3 Po-Chuan Hsieh freebsd_committer freebsd_triage 2022-03-30 10:30:59 UTC
(In reply to Daniel Engberg from comment #2)

It should be fixed in dbb6ff22e43fd044b38e42c06a65237eda34302c. Thanks.
Comment 4 Daniel Engberg freebsd_committer freebsd_triage 2022-03-30 18:54:39 UTC
Thanks, I was a bit concerned about that being fragile but lets go with that for now.
Comment 5 John Hein 2022-04-07 16:47:25 UTC
After this commit (ports 25c952626c32a1830793a770b8f401a7d5370905), the port is broken with default python version set to 3.7.

make check-plist fails:


===> Parsing plist
===> Checking for items in STAGEDIR missing from pkg-plist
Error: Orphaned: %%PYTHON_SITELIBDIR%%/__pycache__/drv_libxml2.cpython-37.opt-1.pyc
Error: Orphaned: %%PYTHON_SITELIBDIR%%/__pycache__/drv_libxml2.cpython-37.pyc
Error: Orphaned: %%PYTHON_SITELIBDIR%%/__pycache__/libxml2.cpython-37.opt-1.pyc
Error: Orphaned: %%PYTHON_SITELIBDIR%%/__pycache__/libxml2.cpython-37.pyc
===> Checking for items in pkg-plist which are not in STAGEDIR
Error: Missing: %%PYTHON_SITELIBDIR%%/__pycache__/drv_libxml2.opt-1.pyc
Error: Missing: %%PYTHON_SITELIBDIR%%/__pycache__/drv_libxml2.pyc
Error: Missing: %%PYTHON_SITELIBDIR%%/__pycache__/libxml2.opt-1.pyc
Error: Missing: %%PYTHON_SITELIBDIR%%/__pycache__/libxml2.pyc
===> Error: Plist issues found.



make install fails for the same reason (.pyc files have an unexpected name based on the new PLIST changes):


===>   Registering installation for py37-libxml2-2.9.13_2
pkg-static: Unable to access file /wrkdirs/usr/ports/textproc/py-libxml2/work-py37/stage/usr/local/lib/python3.7/site-packages/__pycache__/drv_libxml2.opt-1.pyc:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/textproc/py-libxml2/work-py37/stage/usr/local/lib/python3.7/site-packages/__pycache__/drv_libxml2.pyc:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/textproc/py-libxml2/work-py37/stage/usr/local/lib/python3.7/site-packages/__pycache__/libxml2.opt-1.pyc:No such file or directory
pkg-static: Unable to access file /wrkdirs/usr/ports/textproc/py-libxml2/work-py37/stage/usr/local/lib/python3.7/site-packages/__pycache__/libxml2.pyc:No such file or directory


If no one wants to re-open this, I will create a new bug.

The issue is that the .pyc fileas are created as *.cpython-37.*.pyc (similar to *.cpython-38.*.pyc for py38 builds) and PYTHON_EXT_SUFFIX is empty for < py38.
Comment 6 Charlie Li freebsd_committer freebsd_triage 2022-04-10 20:36:17 UTC
textproc/py-libxml2 has reverted to USE_PYTHON=setuptools, so compiled bytecode should be present and in the proper naming structures again.

As an aside, python@ will gradually transition to not including compiled bytecode files in packages, instead using pkg(8) triggers to compile them at install-time.