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

Xavier de Gaye report at bugs.python.org
Mon Oct 30 06:48:44 EDT 2017


Xavier de Gaye <xdegaye at gmail.com> 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 at 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 at chroot ~]# poweroff
  ...
  [  OK  ] Reached target Shutdown.
  Container chroot has been shut down.

----------
nosy: +martin.panter, pitrou

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31114>
_______________________________________


More information about the Python-bugs-list mailing list