PEP 517 build environment dependencies fail to install with use of --build-option #7991
Labels
C: build isolation
C: PEP 517 impact
Affected by PEP 517 processing
PEP implementation
Involves some PEP
S: needs triage
Issues/PRs that need to be triaged
Environment
Description
use of --build-option causes build front-end dependencies to fail to install when using PEP517 build configuration. This is confusing and leads to errors.
The basic issue (shown in logs below) is that by using the --build-option flag pip decides not to use wheels for build dependencies (which is confusing). This is an issue when using PEP517/518 which attempts to create an environment in which to build the pip wheel, but whose environment setup is altered by trying to alter the build itself
Expected behavior
The build environment should be isolated from build commands used within that environment. I should be able to control how my wheel is built in the backend without breaking the installation of my build front-end requirements. I would hope that front-end build requirements would be installed without passing --build-option down to pip wheel command. It is confusing to try to fetch build-time requirements and build them from source. If the front-end needs additional options to install them, they should be controlled using different flags then those that control building my package.
It seems like a chicken-and-egg problem to me, where using build flags means I have to build build-dependencies, which requires another level of abstraction or dependency requirements. I would somehow have to tell pip that the environment used to build build-dependencies itself has build requirements. I believe PEP 517 is meant to protect us from this entangled mess?
How to Reproduce
pip wheel path/to/source --build-option="-DCMAKE_MAKE_PROGRAM=Unix Makefiles"
Output
Alternative
Similarly, the same error occurs when configuring the back-end environment if I shift responsibilities to the build backend by using a pyproject.toml with fewer requirements:
and moving some dependencies to the back-end by using a setup.py with setup_requires thusly:
then I get similar output, but complaining about the build backend instead of the frontend:
The text was updated successfully, but these errors were encountered: