distutils: install_headers doesn't give the package its own folder by default

Create issue
Issue #3140 resolved
Peter Bell created an issue

Running pypy3 -m pip install pybind11 from a conda environment results in the headers being installed directly into $CONDA_PREFIX/include. Whereas for a CPython distribution, it would install to something like $CONDA_PREFIX/include/python3.6m/pybind11. With pypy's defaults, this breaks the include paths for extensions. Also, since every library’s headers are dumped into the same folder, you end up with name collisions and files being overwritten.

The defaults seem to all be configured in distutils/command/install.py , with the 'pypy' scheme being the only broken one:

https://bitbucket.org/pypy/pypy/src/73c04f01d5224a7c236d9f84e841483ec05f202a/lib-python/3/distutils/command/install.py#lines-46

Comments (8)

  1. mattip

    When you say “broken” - do you have a clue what the correct values should be? These values are not very well documented in a design spec, so we rely on users to help us determine what they should be.

  2. Peter Bell reporter

    All other header install locations create a subfolder $dist_name which would be the name of the package.

  3. Peter Bell reporter

    Yup, that fixed the filename conflicts. select_scheme('unix_prefix') is likely also a bug though.

  4. mattip

    select_scheme('unix_prefix') is likely also a bug though

    There is code in select_scheme that intercepts anything not _home nor _user and turns unix_prefix into pypy. Is there a problem with the resulting layout?

  5. Peter Bell reporter

    I thought it was odd that _home and _user follow CPython exactly but not _prefix. However, thinking about it again, I guess it might be an attempt to avoid system CPython installs clashing? Either way, the folder naming was the main issue so I suppose I can close this.

  6. Log in to comment