Skip to content

Fix Windows stub generation in wheel builds - #4673

Merged
jhale merged 6 commits into
mainfrom
jhale/fix-windows-stub-dll-copy
Oct 26, 2026
Merged

jhale merged 6 commits into
mainfrom
jhale/fix-windows-stub-dll-copy

Conversation

@jhale

@jhale jhale commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Import basix and mpi4py in the fake stub-generation __init__.py so its vendored DLLs are found. This is the same as in the real __init__.py.
  • Build the C++ library with INSTALL_RUNTIME_DEPENDENCIES=ON in the wheel build, so the non-system DLLs dolfinx.dll depends on (for example HDF5, pugixml, spdlog and fmt, plus the BLAS and LAPACK DLLs from Basix) are installed beside it. Before this PR, the install bin held only dolfinx.dll and importing dolfinx.cpp for stub generation failed. This does not replace the delvewheel step later on, which vendors and mangles the DLLs into the wheels fenics_dolfinx.libs as before.
  • Search the Basix wheel's fenics_basix.libs directory when resolving runtime dependencies.
  • Drop the Basix directory copy.
  • Also removes the HDF5 directory for the CMake DLL vendoring - this was needed in the past, but it seems it is no longer needed.

Depends on FEniCS/basix#1106 (merged).

Testing

build-wheels.yml (run 40306051852) with this branch and Basix main: Windows wheel contains the .pyi files, py.typed and vendored DLLs, and the wheel tests pass.

🤖 Generated with Claude Code

Import basix in the stub-generation package so its vendored DLLs are
found, install the DOLFINx runtime dependencies in the wheel build, and
search the Basix wheel's .libs directory when resolving them.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
jhale and others added 5 commits October 26, 2026 10:08
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@jhale
jhale added this pull request to the merge queue Oct 26, 2026
Merged via the queue into main with commit 2416827 Oct 26, 2026
22 checks passed
@jhale
jhale deleted the jhale/fix-windows-stub-dll-copy branch October 26, 2026 12:58
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.

2 participants