Roundup Tracker - Issues

Issue 2551185

classification
must set PYTHONPATH=/tmp/r2/lib/python2.7/site-packages python2 ./setup.py install --prefix /tmp/r2
Type: behavior Severity: major
Components: Installation Versions:
process
Status: fixed fixed
:
: rouilj : rouilj
Priority: high : Blocker

Created on 2021-12-23 21:24 by rouilj, last changed 2021-12-23 22:27 by rouilj.

Messages
msg7428 Author: [hidden] (rouilj) Date: 2021-12-23 21:24
E.G. not setting PYTHONPATH in:

 PYTHONPATH=/tmp/r2/lib/python2.7/site-packages python2 ./setup.py install --prefix /tmp/r2

results in:

  running install
  Checking .pth file support in /tmp/r2/lib/python2.7/site-packages/
  /usr/bin/python2 -E -c pass
  TEST FAILED: /tmp/r2/lib/python2.7/site-packages/ does NOT support .pth files
  error: bad install directory or PYTHONPATH

  You are attempting to install a package to a directory that is not
  on PYTHONPATH and which Python does not read ".pth" files from.  The
  ...

The same command under python3 works fine. Is this more setuptools fallout?

Note the end of the error message references easy-install:

  * You can set up the installation directory to support ".pth" files by
    using one of the approaches described here:

  https://setuptools.readthedocs.io/en/latest/easy_install.html#custom-installation-
locations

why is easy-install being invoked??
msg7429 Author: [hidden] (rouilj) Date: 2021-12-23 22:14
Even worse, if the /tmp/r2/lib/python-2.7/site-packages directory doesn't exist
it blows up.

Running:

 python2 ./setup.py install --prefix /tmp/r2

to create the full path then running with PYTHONPATH works. 8-(.

I tracked it down to it's doing an egg install at:

> /usr/lib/python2.7/dist-packages/setuptools/command/install.py(67)run()
-> self.do_egg_install()
(Pdb) l
 62
 63 B           if not self._called_from_setup(inspect.currentframe()):
 64                 # Run in backward-compatibility mode to support bdist_* commands.
 65                 orig.install.run(self)
 66             else:
 67  ->             self.do_egg_install()

even though:

  (Pdb) p not self._called_from_setup(inspect.currentframe())
  True

so it should be running orig.install.run(self). WTH?

Also running:

 (Pdb)  p orig.install.run(self)

does exactly what is expected.
msg7430 Author: [hidden] (rouilj) Date: 2021-12-23 22:27
changeset:   6573:4b627102b344

force addition of:

    if sys.version_info[0] < 3:
        for arg in sys.argv:
            if arg == 'install':
                sys.argv.append('--old-and-unmanageable')

Not a good solution but the setuptools code is not behaving like it should
and the code path enabled by this option calls orig.install.run(self).
History
Date User Action Args
2021-12-23 22:27:47rouiljsetkeywords: + Blocker
priority: high
messages: + msg7430
status: open -> fixed
resolution: fixed
2021-12-23 22:14:51rouiljsetstatus: new -> open
assignee: rouilj
messages: + msg7429
2021-12-23 21:24:35rouiljcreate