Bug 193811

Summary: Uses/python.mk: PYDISTUTILS_EGGINFODIR got expanded into wrong dir because of staging
Product: Ports & Packages Reporter: Gleb Popov <arrowd>
Component: Ports FrameworkAssignee: Marcus von Appen <mva>
Status: Closed FIXED    
Severity: Affects Some People CC: portmgr, python
Priority: --- Keywords: patch
Version: LatestFlags: mva: exp-run+
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Patch to fix the problem.
none
Proper egginfo fix, needs an exp-run none

Description Gleb Popov freebsd_committer freebsd_triage 2014-09-21 14:29:05 UTC
Created attachment 147526 [details]
Patch to fix the problem.

When i install my port (devel/tortisehg) into custom PREFIX, it fails on package registering phase because of wrong paths to egginfo files.

How to reproduce:
$ make -C /usr/ports/devel/tortoisehg PREFIX=/tmp/thg install clean

Attached patch fixes this. Relevant PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=116278
Comment 1 Marcus von Appen freebsd_committer freebsd_triage 2014-10-03 16:47:49 UTC
Created attachment 147938 [details]
Proper egginfo fix, needs an exp-run

Your attached patch seems to be wrong. We already set 

PYDISTUTILS_EGGINFODIR?=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}

Rather than PYDISTUTILS_EGGINFODIR, the replacement in

add-plist-egginfo:
... 
 ${ECHO_CMD} ${PYDISTUTILS_EGGINFODIR:S;^${STAGEDIR}${PYTHONBASE}/;;}/${egginfo}/$${f} >> ${TMPPLIST}; 

is wrong, since it assumes PREFIX == PYTHONBASE. This however is not true for a custom prefix, so the line should be changed to 

 ${ECHO_CMD} ${PYDISTUTILS_EGGINFODIR:S;^${STAGEDIR}${PREFIX}/;;}/${egginfo}/$${f} >> ${TMPPLIST};
Comment 2 Marcus von Appen freebsd_committer freebsd_triage 2014-10-03 16:49:51 UTC
portmgr@: please exp-run attachment 147938 [details].

6yearold: Can you give my patch another try? It works for me.
Comment 3 Marcus von Appen freebsd_committer freebsd_triage 2014-10-03 16:50:47 UTC
Added python@ and portmgr@ in CC
Comment 4 Gleb Popov freebsd_committer freebsd_triage 2014-10-03 18:34:57 UTC
(In reply to Marcus von Appen from comment #2)
> portmgr@: please exp-run attachment 147938 [details].
> 
> 6yearold: Can you give my patch another try? It works for me.

Yup, seems to work. Now i'm able to install devel/tortoisehg into custom PREFIX.
Comment 5 Antoine Brodin freebsd_committer freebsd_triage 2014-10-04 15:45:27 UTC
bugzilla seems buggy, this bug wasn't assigned to portmgr
Comment 6 Marcus von Appen freebsd_committer freebsd_triage 2014-10-05 06:33:46 UTC
(In reply to Antoine Brodin from comment #5)
> bugzilla seems buggy, this bug wasn't assigned to portmgr

No, I did not reassign it but added portmgr to the CC...
Comment 7 Antoine Brodin freebsd_committer freebsd_triage 2014-10-05 17:49:50 UTC
no regression during the exp-run
Comment 8 commit-hook freebsd_committer freebsd_triage 2014-10-07 16:51:29 UTC
A commit references this bug:

Author: mva
Date: Tue Oct  7 16:51:21 UTC 2014
New revision: 370366
URL: https://svnweb.freebsd.org/changeset/ports/370366

Log:
  - Do not blindly assume PREFIX to be the same as PYTHONBASE, when creating the
    egg-info entries for the plist

  PR:		193811
  Reported by:	6yearold@gmail.com
  Exp-run by:	antoine@
  With hat:	python@

Changes:
  head/Mk/Uses/python.mk
Comment 9 Marcus von Appen freebsd_committer freebsd_triage 2014-10-07 16:51:55 UTC
Committed in ports r370366. Thanks for reporting and testing!
Comment 10 Marcus von Appen freebsd_committer freebsd_triage 2014-10-07 16:52:37 UTC
And we also need to close it...