Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Location warning from incorrect Python patch from Slackware #10668

Closed
uranusjr opened this issue Nov 19, 2021 · 2 comments · Fixed by #10671
Closed

Location warning from incorrect Python patch from Slackware #10668

uranusjr opened this issue Nov 19, 2021 · 2 comments · Fixed by #10671
Assignees
Milestone

Comments

@uranusjr
Copy link
Member

Context: #10151 (comment)

WARNING: Value for scheme.purelib does not match. Please report this to <https://github.com/pypa/pip/issues/10151>
distutils: /home/ali/.local/lib/python3.9/site-packages
sysconfig: /home/ali/.local/lib64/python3.9/site-packages
WARNING: Additional context:
user = True
home = None
root = None
prefix = None

it is 'Slackware 15.0 x86_64'
I know that there is some docker image online but never used any. The source for the python3 package > could be downloaded from https://mirrors.slackware.com/slackware/slackware64-current/source/d/python3/
will it help if I give you access to a VM running slackware 15?
PS: I gave python3-10 a try some weeks ago and pip is not usable without some manual setup.


Diagnosis:

Thanks a ton @alijkl!

I just verified—this is (arguably) a bug in Slackware’s CPython patch. It patches sysconfig like this:

    'posix_user': {
        'stdlib': '{userbase}/{platlibdir}/python{py_version_short}',
        'platstdlib': '{userbase}/{platlibdir}/python{py_version_short}',
        'purelib': '{userbase}/lib64/python{py_version_short}/site-packages',
        'platlib': '{userbase}/{platlibdir}/python{py_version_short}/site-packages',
        'include': '{userbase}/include/python{py_version_short}',
        'scripts': '{userbase}/bin',
        'data': '{userbase}',
        },

These are the corresponding lines in upstream CPython for comparison:

https://github.com/python/cpython/blob/v3.9.7/Lib/sysconfig.py#L69-L77

The difference is Slackware’s Python patches purelib to use lib64 instead of lib. This is OK on its own, but Slackware needs to but did not also patch site to match this:

chung@darkstar:~$ python3 -m site
sys.path = [
    '/home/chung',
    '/usr/lib64/python39.zip',
    '/usr/lib64/python3.9',
    '/usr/lib64/python3.9/lib-dynload',
    '/home/chung/.local/lib/python3.9/site-packages',
    '/usr/lib64/python3.9/site-packages',
]
USER_BASE: '/home/chung/.local' (exists)
USER_SITE: '/home/chung/.local/lib/python3.9/site-packages' (exists)
ENABLE_USER_SITE: True

which causes the warning because pip correctly detects that packages installed to the incorrectly patches sysconfig locations will work (because the incorrect path is not in USER_SITE or sys.path). So Slackware should either patch site, or remove the posix_user patch in sysconfig. Fedora had a similar issue and chose to do the latter, see bpo-44860.

So the bottom line is Slackware should fix this bug. In the meantime though, I’ll submit a patch in pip to detect and slience the warning since there’s nothing pip can do in this situation.

@uranusjr
Copy link
Member Author

p.s. Do you happen to know where Slackware hosts the development repository, in particular those distribution-specific patches?

@alijkl
Copy link

alijkl commented Nov 20, 2021 via email

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants