-
Notifications
You must be signed in to change notification settings - Fork 3k
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
pip installs headers to incorrect location when using '--root' #8477
Comments
I managed to The test I used for bisecting simply checks that the #!/bin/bash
rm -rf /tmp/greenlet
python3.8 -m pip install --no-deps -vvv --no-binary :all: --root /tmp/greenlet greenlet==0.4.16 &>/dev/null
[ -e /tmp/greenlet/tmp ] && exit 1
exit 0 The change in the above mentioned commit results in I was trying to check if there are any existing tests for this and found I don't know what the correct fix is. Resurrecting the old logic would probably work, but the I suspect that |
Probably related to #8521? |
An alternative approach is that we can explicitly pass all of the |
I just filed #8556. Once that's in we can unravel the logic around passing location-related arguments to setuptools and fix this bug. I think a proper automated test will be harder, since we don't currently have properly isolated tests. The comments in #7813 describes one possible approach for that. |
Now that #8556 has been landed, I took another look to see how this could be fixed. The issue is that the pip/src/pip/_internal/utils/setuptools_build.py Lines 162 to 177 in a13f201
Either the Schema class should not take prefix directories into account, or the call into There might be much better alternatives, but I'm not that familiar with the |
I made a draft PR following @chrahunt's suggestion to pass the |
The PR is ready for review. I've added a regression test as well. |
We have been using #8881 for a while and ran into an issue with it: the generated Example
The correct contents would be (
@pradyunsg suggested using |
Environment
Description
Installing an extension from source which ships headers results in installing the headers in the wrong destination. It appears that the value of
--install-headers
is appended to--root
.Expected behavior
The headers should be installed into the includes directory under the prefix location (
--root
).How to Reproduce
As seen above the
greenlet.h
file is installed into/tmp/greenlet/tmp/greenlet/usr/local/include/python3.8/greenlet
. It seems that the value of--install-headers
is appended to the value of--root
.To get the correct behaviour one needs to modify the
setuptools
arguments and remove the prefix from--install-headers
:I wonder if this was introduced by the
Scheme
class. Judging from 6fa64a6 this used to be only set undervirtualenv
(and then it was set without the prefix directory). I checked and removing the--install-headers
in thesetuptools
call works correctly in conjunction with--root
and the header is installed into the prefix directory.The text was updated successfully, but these errors were encountered: