@@ -8,43 +8,65 @@ set PATH=%PATH%;c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin
88set
99
1010rem Download and install librdkafka from NuGet.
11- call tools\windows-install-librdkafka.bat %LIBRDKAFKA_NUGET_VERSION% dest || exit /b 1
11+ rem Check if LIBRDKAFKA_DIR is already set for Windows ARM64
12+ if not defined LIBRDKAFKA_DIR (
13+ rem Download and install librdkafka from NuGet.
14+ call tools\windows-install-librdkafka.bat %LIBRDKAFKA_NUGET_VERSION% dest || exit /b 1
15+ ) else (
16+ call tools\windows-install-librdkafka-arm64.bat %LIBRDKAFKA_VERSION% %LIBRDKAFKA_DIR% || exit /b 1
17+ )
1218
1319pip install -r requirements\requirements-tests-install.txt || exit /b 1
1420pip install cibuildwheel== 3.2.1 || exit /b 1
1521
1622rem Build wheels (without tests)
17- cibuildwheel --platform windows --output-dir wheelhouse || exit /b 1
18-
23+ if defined LIBRDKAFKA_DIR (
24+ cibuildwheel --platform windows --archs ARM64 --output-dir wheelhouse || exit /b 1
25+ ) else (
26+ cibuildwheel --platform windows --output-dir wheelhouse || exit /b 1
27+ )
1928dir wheelhouse
2029
2130rem cibuildwheel installs the generated packages, but they're not ready yet,
2231rem so remove them.
2332rem FIXME: this only covers python27 (default)
2433pip uninstall -y confluent_kafka[dev]
2534
26-
27- rem Copy the librdkafka DLLs to a path structure that is identical to cimpl.pyd's location
28- md stage\x86\confluent_kafka
29- copy dest\librdkafka.redist.%LIBRDKAFKA_VERSION% \runtimes\win-x86\native\*.dll stage\x86\confluent_kafka\ || exit /b 1
30-
31- md stage\x64\confluent_kafka
32- copy dest\librdkafka.redist.%LIBRDKAFKA_VERSION% \runtimes\win-x64\native\*.dll stage\x64\confluent_kafka\ || exit /b 1
33-
34- rem For each wheel, add the corresponding x86 or x64 dlls to the wheel zip file
35- cd stage\x86
36- for %%W in (..\..\wheelhouse\*win32.whl) do (
37- 7z a -r %%~W confluent_kafka\*.dll || exit /b 1
38- unzip -l %%~W
35+ rem Only copy x86/x64 DLLs if building from NuGet
36+ for %%A in (x86 x64 arm64) do (
37+ md stage\%%A \confluent_kafka 2 > nul
38+ )
39+ if not defined LIBRDKAFKA_DIR (
40+ copy dest\librdkafka.redist.%LIBRDKAFKA_VERSION% \runtimes\win-x86\native\*.dll stage\x86\confluent_kafka\ || exit /b 1
41+ copy dest\librdkafka.redist.%LIBRDKAFKA_VERSION% \runtimes\win-x64\native\*.dll stage\x64\confluent_kafka\ || exit /b 1
3942)
4043
41- cd ..\x64
42- for %%W in (..\..\wheelhouse\*amd64.whl) do (
43- 7z a -r %%~W confluent_kafka\*.dll || exit /b 1
44- unzip -l %%~W
44+ rem Handle Windows ARM64 if LIBRDKAFKA_DIR is defined
45+ if defined LIBRDKAFKA_DIR (
46+ copy %LIBRDKAFKA_DIR% \bin\*.dll stage\arm64\confluent_kafka\ || exit /b 1
4547)
4648
47- cd ..\..
49+ rem Only process x86/x64 wheels if not ARM64 build
50+ if not defined LIBRDKAFKA_DIR (
51+ cd stage\x86
52+ for %%W in (..\..\wheelhouse\*win32.whl) do (
53+ 7z a -r %%~W confluent_kafka\*.dll || exit /b 1
54+ unzip -l %%~W
55+ )
56+ cd ..\x64
57+ for %%W in (..\..\wheelhouse\*amd64.whl) do (
58+ 7z a -r %%~W confluent_kafka\*.dll || exit /b 1
59+ unzip -l %%~W
60+ )
61+ cd ..\..
62+ ) else (
63+ cd stage\arm64
64+ for %%W in (..\..\wheelhouse\*arm64.whl) do (
65+ 7z a -r %%~W confluent_kafka\*.dll || exit /b 1
66+ unzip -l %%~W
67+ )
68+ cd ..\..
69+ )
4870
4971rem Basic testing
5072for %%W in (wheelhouse\confluent_kafka-*cp%PYTHON_SHORTVER% *win*%PYTHON_ARCH% .whl) do (
0 commit comments