Skip to content

Conversation

joerick
Copy link
Contributor

@joerick joerick commented Sep 8, 2025

Fix #2570.

Don't constrain the versions installed during the package build using dependency-versions. See #2570 for full discussion. AI summary of the change below


This change stops cibuildwheel's dependency-versions from being applied as constraints within the isolated build environment used for the package build. This resolves an issue where conflicts between cibuildwheel's internal requirements and a project's build-system.requires would cause cryptic build failures.

The Problem
Currently, on macOS, Windows, and Pyodide platforms, cibuildwheel injects its own dependency constraints (from CIBW_DEPENDENCY_VERSIONS or the defaults) into the isolated environment where a project's build-time dependencies are installed.

This leads to an issue: if a project specifies a build requirement in pyproject.toml (e.g., conan) that has a dependency conflict with cibuildwheel's constraints (e.g., on urllib3), the build fails with an unhelpful subprocess.CalledProcessError traceback.

This behaviour is also inconsistent, as it does not occur on Linux, which invokes the build without injecting these internal constraints.

The Solution
Remove the logic that sets the PIP_CONSTRAINT and UV_CONSTRAINT environment variables on the build_env before invoking the build frontend (pip wheel or build).

The effect is:

  • The user's project's build-time dependencies are now resolved independently, without interference from cibuildwheel's toolchain constraints.

  • The build process behaviour is now the same across all platforms (Linux, macOS, Windows, and Pyodide)

Copy link
Member

@agriyakhetarpal agriyakhetarpal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @joerick! While this is a very rare problem to occur, as noted via #2570's reproducer, it’s good that we are aligning our process with Linux/Docker builds.

@joerick joerick marked this pull request as draft September 8, 2025 15:31
@joerick
Copy link
Contributor Author

joerick commented Sep 8, 2025

The tests are asserting on the version of pip in the build venv, which is reasonable to pin. So I'll try to pin that. But the current structure of the integration test checks the versions in the venv during build of the package, whereas we're more interested in the versions of the tools like virtualenv, or delocate. So I'll think about how we might change that test.

Copy link
Contributor

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Seems reasonable to me from an iOS perspective, and I can't fault the general logic.

Copy link
Member

@ryanking13 ryanking13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good for Pyodide

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cibuildwheel fails without diagnostic on dependency conflict
4 participants