Bug 269472 - python.mk: PEP-517 installs/stages to ${PYTHONBASE} rather than ${PREFIX}
Summary: python.mk: PEP-517 installs/stages to ${PYTHONBASE} rather than ${PREFIX}
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Charlie Li
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-10 18:57 UTC by John Hein
Modified: 2023-02-25 17:39 UTC (History)
3 users (show)

See Also:
jcfyecrayz: maintainer-feedback?


Attachments
v1 (1.80 KB, patch)
2023-02-10 20:07 UTC, Charlie Li
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Hein 2023-02-10 18:57:23 UTC
This seems to be a python.mk problem with the pep517 framework, but I just happened to notice it in this port first.

sed: /usr/ports/textproc/py-pyphen/work-py39/stage/opt/lib/python3.9/site-packages/pyphen-0.13.0.dist-info/RECORD: No such file or directory

The RECORD file is actually in stage/usr/local/... instead.  It seems PREFIX is at least partially ignored for pep517.
Comment 1 John Hein 2023-02-10 18:58:38 UTC
CC'd vishwin@ for a pep517 look.
Comment 2 Charlie Li freebsd_committer freebsd_triage 2023-02-10 19:11:03 UTC
It's using ${PYTHONPREFIX_SITELIBDIR}, which includes ${PREFIX} by default.
Comment 3 John Hein 2023-02-10 19:35:18 UTC
(In reply to Charlie Li from comment #2)
Yes.  But 'make stage' did not install to PREFIX.  It installed to LOCALBASE.  Just as a check, I reverted to distutils, and 'make stage' succeeds and it installs to PREFIX.
Comment 4 Charlie Li freebsd_committer freebsd_triage 2023-02-10 19:44:41 UTC
What is the output of sys.prefix when run in the Python interpreter used during stage?
Comment 5 Charlie Li freebsd_committer freebsd_triage 2023-02-10 20:07:31 UTC
Created attachment 240056 [details]
v1

Try this
Comment 6 John Hein 2023-02-10 20:20:23 UTC
(In reply to Charlie Li from comment #4)
sys.prefix is /usr/local as expected (that is what LOCALBASE is set to).
Comment 7 John Hein 2023-02-10 20:22:46 UTC
(In reply to John Hein from comment #6)
That makes 'make stage PREFIX=/whatever' work now, and the files are in the correct location (under PREFIX) in stage/.

I'll try a few more ports to verify this in the next day or two.  But that seems like the right fix.
Comment 8 commit-hook freebsd_committer freebsd_triage 2023-02-25 17:36:09 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=9fbe5f4d774c1f818ec604a438356311f3bc76ee

commit 9fbe5f4d774c1f818ec604a438356311f3bc76ee
Author:     Charlie Li <vishwin@FreeBSD.org>
AuthorDate: 2023-02-10 20:04:58 +0000
Commit:     Charlie Li <vishwin@FreeBSD.org>
CommitDate: 2023-02-25 17:35:32 +0000

    python.mk: explicitly pass ${PREFIX} to ${PEP517_INSTALL_CMD}

    Otherwise the stage prefix is ${PYTHONBASE} by default.

    Reported by: John Hein <jcfyecrayz[at]liamekaens[point]com>
    PR: 269472

 Mk/Uses/python.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 9 Charlie Li freebsd_committer freebsd_triage 2023-02-25 17:39:19 UTC
Committed, thanks!