Skip to content

Problems building Python 3.13t wheels on Windows with git dependency and uv #1975

@burgholzer

Description

@burgholzer

Description

Hi 👋🏼

First things first: I am not 100% sure what I am about to describe is a cibuildwheel issue, but it was the only scenario under which I could reproduce the issue. Feel free to transfer this issue to its appropriate place or point me there.

Context

We are currently working on improving one of our libraries (https://github.com/cda-tum/mqt-qcec, built in C++, exposed to Python via pybind11, using scikit-build-core as a build backend) to get some of its build time dependencies (including C++ shared libraries) via another one of our packages (https://github.com/cda-tum/mqt-core; same setup as the other tool) kind of similar to how pybind11 is distributed as a Python package and can then be found via find_package in CMake.

The respective PRs in question are: munich-quantum-toolkit/qcec#432 and munich-quantum-toolkit/core#662

For the development, we added mqt.core as a git dependency to the mqt.qcec package configuration (see here):

[build-system]
requires = [
  "scikit-build-core>=0.10.1",
  "setuptools-scm>=7",
  "pybind11>=2.13",
  "mqt.core @ git+https://github.com/cda-tum/mqt-core@shared-libs",
]
build-backend = "scikit_build_core.build"

Almost everything works smoothly with this setup and nearly all the CI workflows are green, except one:

Problem

Running cibuildwheel on Windows to build Python 3.13 free-threading wheels.
A corresponding failing CI log can be found here.
Interestingly, it fails to properly build the mqt.core git dependency from the build requirements.
The errors from the CI log all boil down to something similar as

< //?/C:/Users/runneradmin/AppData/Local/uv/cache/builds-
v0/.tmphbUzYj/Lib/site-
packages/pybind11\include\pybind11/detail/class.h(12,10): error: '../attr.h'
file not found, did you mean 'attr.h'?

indicating that something is messed up with the pybind11 include directories.

Note that the same job succeeds on Ubuntu (also with emulation based on QEMU), macOS (x86 and arm64), as well as Windows (despite the 3.13t job), as can be seen from all the build logs here.

The cibuildwheel configuration of the mqt.qcec project is here.

What I tried to narrow down the problem

  • This is only happening on Windows and for Python 3.13t

  • We are using the build[uv] build frontend and the errors are isolated to that particular choice. More precisely, they are limited to the use of uv as the installer. Both, choosing just build as well as the regular pip frontend in the cibuildwheel config makes the job succeed.

  • Installing Python 3.13t from the official website, creating a new virtual environment with uv using that Python version and running uv pip install . in a fresh clone of the mqt-qcec branch also succeeds without issues

  • Running python -m build --wheel --installer=uv in a newly created uv Python 3.13t venv also succeeds.

  • This was tested with uv 0.2.37, but also failed with a couple versions before that.

  • Running cibuildwheel on the mqt.core sub-project runs successfully, even on windows with Python 3.13t. See the corresponding CI log.

  • Running pipx run cibuildwheel --only cp313t-win_amd64 consistently fails with the above errors.

Steps to reproduce the problem

On a Windows machine with pipx installed:

git clone https://github.com/cda-tum/mqt-qcec.git
cd mqt-qcec
git checkout use-mqt-core-package
pipx run cibuildwheel --only cp313t-win_amd64

The issue is probably right at the intersection of cibuildwheel, scikit-build-core, pybind11, uv and some Python 3.13 free-threading change.
However, even after longer sessions of debugging, I couldn't really make sense of it.

Build log

https://github.com/cda-tum/mqt-qcec/actions/runs/10392166048/job/28783894623

CI config

https://github.com/cda-tum/mqt-workflows/blob/a9a471582a6aefc2a71ab50772707829edb2abc3/.github/workflows/reusable-python-packaging.yml#L67-L118

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions