Bug 233715 - databases/py-psycopg2: Flavor @py36 does not install because of wrong PYTHON*_SITELIBDIR
Summary: databases/py-psycopg2: Flavor @py36 does not install because of wrong PYTHON*...
Status: Closed Unable to Reproduce
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Sunpoet Po-Chuan Hsieh
Keywords: needs-qa
Depends on:
Blocks: 233726
  Show dependency treegraph
Reported: 2018-12-02 11:06 UTC by Rainer Hurling
Modified: 2019-01-05 20:11 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (sunpoet)
koobs: maintainer-feedback? (se)

patch SITELIBDIR for @py36 (605 bytes, patch)
2018-12-02 11:06 UTC, Rainer Hurling
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rainer Hurling 2018-12-02 11:06:45 UTC
Created attachment 199742 [details]
patch SITELIBDIR for @py36

In the process of preparing my new port graphics/qgis with QGIS 3, I found databases/py-psycopg2 as a showstopper, because it is not able to install for flavor @py36.

I think, this is because databases/py-psycopg2@py37 tries to install the Python files wrongly in PYTHON_SITELIBDIR instead of PYTHONPREFIX_SITELIBDIR.

The attached patch seems to solve the problem, now both @py27 and @py36 are installable at the same time.

Tested with Poudriere (F11.2i/a, F12.0-RC1i/a, and HEADi/a).

'portlint -AC' seems fine.
Comment 1 Sunpoet Po-Chuan Hsieh freebsd_committer 2018-12-03 15:00:04 UTC
I cannot reproduce the problem.
And our building cluster generates the packages successfully [1][2].

[1] https://pkg.freebsd.org/FreeBSD:11:amd64/latest/All/py36-psycopg2-
[2] https://pkg.freebsd.org/FreeBSD:12:amd64/latest/All/py36-psycopg2-
Comment 2 Rainer Hurling 2018-12-03 19:47:47 UTC
(In reply to Sunpoet Po-Chuan Hsieh from comment #1)

I am sorry my analysis in the initial report was wrong, because I did not understand, what happens. Investigating again in this problem turns out, that there is something wrong with the behaviour of portmaster in this situation.

This happens only on real world boxes (not in Poudriere), when I use Portmaster AND @py36 (a non default flavor) is not installed before (first time install):

#portmaster databases/py-psycopg2@py36

===>  Installing for py36-psycopg2-
===>  Checking if py36-psycopg2 already installed
===>   Registering installation for py36-psycopg2-
Installing py36-psycopg2-
===>>> Installation of databases/py-psycopg2@py36 (py27-psycopg2- complete
                                             ^^^^  ^^^^

In fact, after that, the correct @py36 flavor is installed:

#pkg info | grep psycopg2

But, in /var/db/pkg there is instead an entry (directory) with the wrong flavor:

#ls -ldU /var/db/pkg/*-psycopg2-*
drwxr-xr-x  2 root  wheel  512  3 Dez. 20:36 /var/db/pkg/py27-psycopg2-

This does not happen, if I install via:
cd /usr/ports/databases/py-psycopg2
make clean install FLAVOR=py36

or if I reinstall the already existing port a second time with Portmaster.

So it seems, that Portmaster does something wrong here. The right port and flavor is installed, but the bookkeeping under /var/db/pkg is wrong in the first time.
Comment 3 Kubilay Kocak freebsd_committer freebsd_triage 2019-01-04 02:40:41 UTC
@Rainer Is this still an issue?

Get Stefans thoughts on potential issue with portmaster. Please re-assign and update summary according to investigation results
Comment 4 Sunpoet Po-Chuan Hsieh freebsd_committer 2019-01-05 20:11:04 UTC
I cannot reproduce this problem as I mentioned in bug #233716.
I'm going to close this PR.
Please feel free to reopen it if necessary.