Skip to content

WIP: bpo-31046: ensurepip should honour the value of $(prefix) #19068

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

Closed
wants to merge 1 commit into from
Closed

WIP: bpo-31046: ensurepip should honour the value of $(prefix) #19068

wants to merge 1 commit into from

Conversation

mcepl
Copy link
Contributor

@mcepl mcepl commented Mar 19, 2020

(patch attached by Xavier de Gaye xdegaye@gmail.com to the ticket)

When cross-compiling, the local Python interpreter that is used to run ensurepip may not have the same value of sys.prefix as the value of the 'prefix' variable that is set in the Makefile.

With the following values used to install Python locally for a later copy to the files hierarchy owned by the 'termux' application on an Android device:

    DESTDIR=/tmp/android
    prefix=/data/data/com.termux/files/usr/local

'make install' causes ensurepip to install pip in $(DESTDIR)/usr/local instead of the expected $(DESTDIR)/$(prefix) where is installed the standard library.

The attached patch fixes the problem. The patch was implemented assuming that pip uses distutils for the installation (note that setup.py also uses the --prefix option in the Makefile), but I know nothing about pip so forgive me if the patch is wrong and please just assume it is just a way to demonstrate the problem.

https://bugs.python.org/issue31046

When cross-compiling, the local Python interpreter that is used
to run ensurepip may not have the same value of sys.prefix as the
value of the 'prefix' variable that is set in the Makefile.

With the following values used to install Python locally for
a later copy to the files hierarchy owned by the 'termux'
application on an Android device:

    DESTDIR=/tmp/android
    prefix=/data/data/com.termux/files/usr/local

'make install' causes ensurepip to install pip in
$(DESTDIR)/usr/local instead of the expected $(DESTDIR)/$(prefix)
where is installed the standard library.

The attached patch fixes the problem. The patch was implemented
assuming that pip uses distutils for the installation (note that
setup.py also uses the --prefix option in the Makefile), but
I know nothing about pip so forgive me if the patch is wrong and
please just assume it is just a way to demonstrate the problem.

bpo-31046
@mcepl
Copy link
Contributor Author

mcepl commented Mar 19, 2020

Duplicate of #17634.

@mcepl mcepl closed this Mar 19, 2020
@mcepl mcepl deleted the bpo31046_ensurepip_prefix branch March 19, 2020 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants