Feature/add arm64 build targets#5372
Feature/add arm64 build targets#5372Arkadiusz Biel (bielu) wants to merge 12 commits intoconfluentinc:masterfrom
Conversation
Co-authored-by: bielu <2244074+bielu@users.noreply.github.com>
Co-authored-by: bielu <2244074+bielu@users.noreply.github.com>
… feedback Co-authored-by: bielu <2244074+bielu@users.noreply.github.com>
|
🎉 All Contributor License Agreements have been signed. Ready to merge. |
There was a problem hiding this comment.
Pull request overview
This PR adds Windows/MSVC ARM64 build support by extending the win32/ Visual Studio solution and project configurations, and updates CI/packaging to produce ARM64 artifacts.
Changes:
- Added
Debug|ARM64/Release|ARM64configurations across relevant.vcxprojprojects and thewin32/librdkafka.sln. - Updated Windows build + packaging scripts and Semaphore CI to build/package ARM64 artifacts.
- Updated a few
src/codepaths to recognize MSVC ARM64 (_M_ARM64) for Windows-specific intrinsics/sections.
Reviewed changes
Copilot reviewed 21 out of 22 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| win32/win_ssl_cert_store/win_ssl_cert_store.vcxproj | Adds ARM64 Debug/Release configurations for the example app. |
| win32/tests/tests.vcxproj | Updates ToolsVersion and adds ARM64 item definitions for tests. |
| win32/rdkafka_performance/rdkafka_performance.vcxproj | Adds ARM64 Debug/Release item definitions for performance example. |
| win32/rdkafka_example/rdkafka_example.vcxproj | Adds ARM64 Debug/Release item definitions for C++ example. |
| win32/package-zip.ps1 | Updates default toolset and ARM64 DLL naming in packaging. |
| win32/openssl_engine_example/openssl_engine_example.vcxproj | Adds ARM64 Debug/Release configurations for the example app. |
| win32/msbuild.ps1 | Updates default toolset used for CI builds and test runs. |
| win32/librdkafkacpp/librdkafkacpp.vcxproj | Adds ARM64 Debug/Release item definitions for the C++ DLL. |
| win32/librdkafka.vcxproj | Adds ARM64 include/library paths and ARM64 build definitions for the main DLL. |
| win32/librdkafka.sln | Bumps solution VS version and adds ARM64 solution/project configs. |
| win32/interceptor_test/interceptor_test.vcxproj | Adds ARM64 Debug/Release item definitions for interceptor test. |
| win32/common.vcxproj | Adds ARM64 project configs and a VS 18.0 toolset mapping; tweaks shared compile settings. |
| win32/build.bat | Extends the build loop to include ARM64. |
| src/tinycthread.c | Extends Windows TLS callback segment handling to MSVC ARM64. |
| src/snappy.c | Extends MSVC 64-bit intrinsic path to include _M_ARM64. |
| src/lz4.c | Enables fast decode loop for MSVC ARM64 builds. |
| packaging/nuget/templates/librdkafka.redist.targets | Adds ARM64 library resolution paths for consuming projects. |
| packaging/nuget/templates/librdkafka.redist.props | Adds ARM64 runtime DLL content for NuGet output. |
| packaging/nuget/nugetpackage.py | Adds ARM64 artifact mappings into the NuGet package layout. |
| README.win32 | Updates stated Visual Studio version for Windows build instructions. |
| .semaphore/semaphore.yml | Adds a Windows MSVC ARM64 build job. |
| .gitignore | Ignores win32/.idea. |
Comments suppressed due to low confidence (1)
src/snappy.c:241
- rd_ctz64() is meant to count trailing zeros, but this branch uses _BitScanReverse64(), which returns the index of the most-significant set bit (not the least-significant). Expanding this branch to _M_ARM64 will produce incorrect results on ARM64 and may break compression logic. Use the correct trailing-zero intrinsic (e.g., _BitScanForward64 when available) or keep the existing non-x64 fallback for ARM64.
static int inline rd_ctz64(u64 x) {
#if defined(_M_X64) || defined(_M_ARM64)
int r = 0;
if (_BitScanReverse64(&r, x))
return r;
else
return 64;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 23 out of 24 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| [string]$config='Release', | ||
| [string]$platform='x64', | ||
| [string]$toolset='v142' | ||
| [string]$toolset='v145' | ||
| ) |
There was a problem hiding this comment.
Semaphore now invokes win32/msbuild.ps1 -platform ARM64, but this script unconditionally runs outdir\$toolset\$platform\Release\tests.exe after building. An ARM64 tests.exe will not run on the same x64 Windows agent used for the other MSVC jobs, so this will likely fail the new ARM64 CI job. Consider skipping test execution when $platform -eq 'ARM64' (build-only) or moving the ARM64 job to an ARM64 Windows runner.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 23 out of 24 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @echo off | ||
|
|
||
| SET TOOLCHAIN=v140 | ||
| SET TOOLCHAIN=v145 |
There was a problem hiding this comment.
TOOLCHAIN is set but never used anywhere in this script. Since the PR now changes the toolset value, this line is misleading and the build will still use the solution/project defaults. Either remove TOOLCHAIN or pass it through to msbuild (e.g., via /p:PlatformToolset=%TOOLCHAIN%).
| - name: 'Windows x64: Windows SDK 10.0 / MSVC v145 / VS 2026' | ||
| dependencies: [] |
There was a problem hiding this comment.
This block is named "Windows x64" but the jobs within it now build/package x64, x86 (Win32), and ARM64. Renaming the block to something architecture-neutral (or explicitly listing all archs) would avoid confusion when scanning the Semaphore pipeline and when declaring dependencies.
Add ARM64 support for Windows (MSVC)
This PR adds ARM64 platform support to the Visual Studio solution under win32/.
Changes
Added ARM64 configuration to all relevant projects
Ensured consistent settings across Win32, x64, and ARM64
Result
Successful builds for Win32, x64, and ARM64
Improved consistency of Windows build configuration
Notes
Changes are limited to Windows/MSVC build files
No impact on other platforms