Skip to content

Windows wheels are not self-contained: _internals.pyd needs unbundled MinGW runtime DLLs (libstdc++-6, libgcc_s_seh-1) #150

@stoiver

Description

@stoiver

The win_amd64 wheels (meshpy 2025.1.1) are MinGW-built and don't bundle the MinGW runtime DLLs, so importing meshpy fails on a clean Windows Python:

ImportError: DLL load failed while importing _internals: The specified module could not be found.

Evidence

  • The wheel ships meshpy/_internals.cp312-win_amd64.dll.a — a GNU/MinGW import library, i.e. a MinGW build.
  • The import table of meshpy/_internals.cp312-win_amd64.pyd (via pefile) lists:
    • libgcc_s_seh-1.dll
    • libstdc++-6.dll
    • and only system DLLs otherwise (KERNEL32.dll, api-ms-win-crt-*, python312.dll).
  • None of the MinGW runtime DLLs are bundled inside the wheel.

So on a clean Windows Python (no MinGW on PATH), libstdc++-6.dll / libgcc_s_seh-1.dll can't be found and _internals fails to load.

Reproduce

In a clean virtualenv on Windows (no MinGW on PATH):

pip install meshpy==2025.1.1
python -c "import meshpy.triangle"
# ImportError: DLL load failed while importing _internals: The specified module could not be found.

Impact

Breaks pip install meshpy on Windows for anyone without a MinGW toolchain on PATH. In particular it breaks pip install anuga on Windows, since ANUGA depends on meshpy as its mesh generator.

Suggested fix

Run delvewheel repair on the Windows wheels in the release build to bundle the MinGW runtime DLLs (libstdc++-6.dll, libgcc_s_seh-1.dll, and libwinpthread-1.dll), making the wheels self-contained — the Windows equivalent of auditwheel (Linux) and delocate (macOS).

Environment

  • meshpy 2025.1.1
  • Python 3.12
  • Windows (GitHub windows-latest runner)

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