-
Notifications
You must be signed in to change notification settings - Fork 55
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
Should we workaround pip's build isolation bugs? #993
Comments
Oh boy that |
|
Currently, In issue scikit-build/cmake-python-distributions#586, The
|
Wait, this is problematic. It means that the build isolation is escaped and it added a $ PATH=$PATH:/path/to/cmake pip install We want the later case to be respected while the first one stripped. Could you check this scenario in your patch? |
The pip build isolation manipulates python3 -m venv parent-venv
source parent-venv/bin/activate # prepends parent-venv/bin to PATH
pip3 install cmake # creates a console script parent-venv/bin/cmake
pip3 install . # the local package needs cmake The |
That should be intended, although I can see why we should also allow it to be broken with some overloads. I.e. $ python3 -m venv parent-venv
$ source parent-venv/bin/activate # prepends parent-venv/bin to PATH
$ pip3 install cmake # creates a console script parent-venv/bin/cmake
$ pip3 install . # the local package needs cmake
(should fail) $ PATH=/path/to/a/weird/place/bin/cmake pip3 install .
(should pass) $ python3 -m venv parent-venv
$ source parent-venv/bin/activate # prepends parent-venv/bin to PATH
$ pip3 install cmake # creates a console script parent-venv/bin/cmake
$ PATH=$(pwd)/parent-venv/bin/cmake pip3 install .
(should pass) However |
The first and third ones are identical because |
Pip's build isolation doesn't actually set up normal virtual environments, but instead hacks together one with environment variables and other hacks. This causes a bunch of issues, such as site-packages not being reported correctly (which we already work around, see comments in #880), and any tools with Python wrappers being broken, like cmake, ninja, uv, etc. uv has a built-in workaround for this. Should we add a workaround when calling cmake and ninja? We've already seen this with #973, but we could fix it so that it works, I think. The workaround is at https://github.com/astral-sh/ruff/pull/13591/files, we could similarly strip PYTHONPATH when calling cmake/ninja.
I'm probably first going to see if we can workaround it in each package. See scikit-build/cmake-python-distributions#586.
The text was updated successfully, but these errors were encountered: