[issue31114] 'make install' fails when the configure 'prefix' is '/' and DESTDIR is used

2019-12-10 Thread Xavier de Gaye


Change by Xavier de Gaye :


--
nosy:  -xdegaye

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31114] 'make install' fails when the configure 'prefix' is '/' and DESTDIR is used

2017-10-30 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

Actually, sys.prefix is '/usr' because '/usr/bin' is in PATH while '/bin' is 
not in PATH. After adding '/bin' to the start of PATH, then sys.prefix becomes 
'/.' when Python is run as 'python3'. The confusion comes from the '/bin' 
symlink (archlinux is not a perfect choice for those tests). Whatever the value 
of PATH, '/bin/python3' has also '/.' as its sys.prefix.

So Modules/getpath.c fails to get '/' as the prefix in step 3 of the algorithm 
described at the top of the source code and uses '/.' (i.e. PREFIX) instead. 
This is caused by its reduce() function not handling the corner case where 
Python is installed on '/'. I will update the PR shortly.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31114] 'make install' fails when the configure 'prefix' is '/' and DESTDIR is used

2017-10-30 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

Clarification about the test results:
On archlinux /bin is a symlink to /usr/bin, so on archlinux the value of 
sys.prefix is '/usr' instead of the expected '/'. This is because in 
Modules/getpath.c, 'argv0_path' is the directory of the link target when the 
executable location is a symbolic link.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31114] 'make install' fails when the configure 'prefix' is '/' and DESTDIR is used

2017-10-30 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

To test PR 4172 on linux one needs a chroot. The following test is run on 
archlinux using systemd-nspawn (a chroot on steroids, see 
https://wiki.archlinux.org/index.php/Systemd-nspawn).

1) Setup systemd-nspawn by installing arch-install-scripts and by using 
pacstrap to install the archlinux 'base' package group in the /tmp/chroot 
container, this installs about 600M of archlinux packages in the chroot:
  $ mkdir /tmp/chroot
  $ pacman -S arch-install-scripts
  # pacstrap -i -c -d /tmp/chroot base --ignore linux

2) Build and install Python in the /tmp/python-build DESTDIR directory:
  $ mkdir /tmp/python-build
  $ ./configure --prefix=/ --without-ensurepip && make
  $ make DESTDIR=/tmp/python-build install

3) Copy the Python distribution to the chroot directory (note the trailing 
slash in the source directory):
  # rsync -av --keep-dirlinks /tmp/python-build/ /tmp/chroot

4) Boot into the chroot container and run python:
  # systemd-nspawn -b -D /tmp/chroot
  ...
  [  OK  ] Started Console Getty.
  [  OK  ] Reached target Login Prompts.
  [  OK  ] Started Login Service.
  [  OK  ] Reached target Multi-User System.
  [  OK  ] Reached target Graphical Interface.
  [  OK  ] Started Rotate log files.

  Arch Linux 4.13.4-1-ARCH (console)

  chroot login: root
  Last login: Mon Oct 30 10:54:11 on console
  [root@chroot ~]# python3.7
  Python 3.7.0a2+ (heads/bpo-31114:ffa5bff252, Oct 30 2017, 11:24:54)
  [GCC 7.2.0] on linux
  Type "help", "copyright", "credits" or "license" for more information.
  >>> import abc, _bisect, sysconfig, sys
  >>> sys.prefix
  '/usr'
  >>> sysconfig.get_config_var('prefix')
  '/.'
  >>> sys.exit(0)
  [root@chroot ~]# poweroff
  ...
  [  OK  ] Reached target Shutdown.
  Container chroot has been shut down.

--
nosy: +martin.panter, pitrou

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31114] 'make install' fails when the configure 'prefix' is '/' and DESTDIR is used

2017-10-30 Thread Xavier de Gaye

Change by Xavier de Gaye :


--
keywords: +patch
pull_requests: +4141
stage: needs patch -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31114] 'make install' fails when the configure 'prefix' is '/' and DESTDIR is used

2017-10-30 Thread Xavier de Gaye

Change by Xavier de Gaye :


--
components: +Cross-Build -Build
nosy: +Alex.Willmer
stage:  -> needs patch
title: 'make install' fails when exec_prefix is '/' and DESTDIR not empty -> 
'make install' fails when the configure 'prefix' is '/' and DESTDIR is used
versions:  -Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com