@@ -89,14 +89,26 @@ jobs:
8989 cache-suffix : -${{ matrix.python }}-${{ matrix.platform.cibw_system }}_${{ matrix.platform.arch }}
9090 python-version : ${{ matrix.python }}
9191
92+ # Load MSVC environment, needed for Windows - ninja builds
93+ # Without this, the linking step will fail.
94+ # Note: CIBW uses the host environment for windows, rather than an isolated container
95+ - uses : ilammy/msvc-dev-cmd@v1
96+ if : ${{ matrix.platform.cibw_system == 'win' }}
97+ with :
98+ arch : ${{ matrix.platform.arch }}
99+
92100 - name : Build${{ inputs.testsuite != 'none' && ' and test ' || ' ' }}wheels
9310194102 env :
95103 CIBW_ARCHS : ${{ matrix.platform.arch == 'amd64' && 'AMD64' || matrix.platform.arch }}
96104 CIBW_BUILD : ${{ matrix.python }}-${{ matrix.platform.cibw_system }}_${{ matrix.platform.arch }}
97- # PYTHON_GIL=1: Suppresses the RuntimeWarning that the GIL is enabled on free-threaded builds.
98- # TODO: Remove PYTHON_GIL=1 when free-threaded is supported.
105+ # PYTHON_GIL=1: Suppresses the RuntimeWarning that the GIL is enabled on free-threaded builds.
106+ # TODO: Remove PYTHON_GIL=1 when free-threaded is supported.
107+ # CMAKE_BUILD_TYPE=Release: Override Debug default when MSVC dev environment is loaded
99108 CIBW_ENVIRONMENT : PYTHON_GIL=1
109+ # For Windows, msvc-dev-cmd sets build to Debug. So, override it back to Release.
110+ # This is a problem because Debug enables Jemalloc, which fails to build on Windows
111+ CIBW_ENVIRONMENT_WINDOWS : PYTHON_GIL=1 CMAKE_BUILD_TYPE=Release
100112 - name : Upload wheel
101113 uses : actions/upload-artifact@v4
102114 with :
0 commit comments