Skip to content

Build the plugin for 32-bit and ARM64 Notepad++ - #6

Merged
Gvo87 merged 2 commits into
mainfrom
x86-arm64-builds
Oct 16, 2026
Merged

Gvo87 merged 2 commits into
mainfrom
x86-arm64-builds

Conversation

@Gvo87

@Gvo87 Gvo87 commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

Notepad++ only loads plugins built for its own architecture. Today the project, CI and release are x64 only, so 32-bit and ARM64 users can't install LLM Assistant from Plugins Admin. This PR builds and packages the plugin for all three architectures. It doesn't release anything yet.

Changes

  • LLMAssistant.vcxproj: adds Debug|Win32, Release|Win32, Debug|ARM64 and Release|ARM64. The property groups are now conditioned on the configuration only, so every platform gets the same settings and nothing has to be copied six times. Output goes to <Platform>\<Configuration>\ for every platform (Win32\Release\LLMAssistant.dll). MSBuild's Win32 default would be Release\. The x64 paths are unchanged.
  • build.bat: takes an optional platform, build.bat [x64|x86|arm64] [/nopause], in any order. Win32 also works. x64 stays the default. For ARM64 it looks for Visual Studio with Microsoft.VisualStudio.Component.VC.Tools.ARM64. If that's missing, it names the component to add in the Visual Studio Installer. The toolset check now looks under the chosen platform.
  • deploy.bat: calls build.bat x64 /nopause. It still deploys x64\Release\LLMAssistant.dll.
  • packaging/make-release-zip.ps1: new -Platform x64|x86|arm64. It picks the DLL from x64\, Win32\ or ARM64\Release, names the zip _x64, _x86 or _arm64, and prints the entry for pl.<platform>.json. Before packaging it reads the DLL's PE header and checks three things. The machine type must match the platform. The version resource must equal -Version, unless that's not a number, such as CI's dev. The DLL must export beNotified, getFuncsArray, getName, isUnicode, messageProc and setInfo.
  • CI (build-and-release.yml): builds x64 and Win32 with /p:PlatformToolset=v143 as before. ARM64 builds with the project's own v145 toolset. windows-latest is now the windows-2025-vs2026 image, and its v143 tools (MSVC 14.44) cover x64 and x86 only. A first run that passed v143 for ARM64 failed with MSB8020. It runs the Catch2 tests as x64 as before, and also as Win32. It packages three zips through make-release-zip.ps1, so every build runs those checks, ARM64 included. It uploads three artifacts. On a v* tag it attaches LLMAssistant_v<ver>_x64.zip, _x86.zip and _arm64.zip to the release. The release notes and the job summary list the entry and SHA-256 for each list. On a tag build, the version check also fails the run if the tag doesn't match src/Version.h.
  • Docs: the README build section and PLUGINS_ADMIN_SUBMISSION.md cover the three platforms. The comments in Version.h and PluginInterface.h no longer say x64 only.

No C++ changes were needed. The code already uses pointer-sized types (intptr_t, INT_PTR, LRESULT), and the exports are extern "C" __cdecl, so the 32-bit export names are undecorated.

Local verification (VS 2026, v145)

build.bat, build.bat x86 and build.bat Win32 each built with 0 errors and 0 compiler warnings. Then dumpbin /headers /exports and FileVersionInfo on each DLL gave:

DLL PE machine Optional header Version resource Exports
x64\Release\LLMAssistant.dll 8664 (x64) PE32+ FileVersion 1.1.0.0, ProductVersion 1.1.0.0 beNotified, getFuncsArray, getName, isUnicode, messageProc, setInfo
Win32\Release\LLMAssistant.dll 14C (x86) PE32 FileVersion 1.1.0.0, ProductVersion 1.1.0.0 beNotified, getFuncsArray, getName, isUnicode, messageProc, setInfo (undecorated)
ARM64\Release\LLMAssistant.dll AA64 (ARM64), checked in CI PE32+ (every ARM64 image is; not printed by CI) 1.1.0.0, checked in CI beNotified, getFuncsArray, getName, isUnicode, messageProc, setInfo, checked in CI

Other local checks:

  • Catch2: 11/11 tests pass as x64 and as Win32 (cmake -A Win32).
  • make-release-zip.ps1 packaged both DLLs, and each zip holds only LLMAssistant.dll at its root. It failed with a clear message, as intended, in four cases: an x64 DLL passed as -Platform x86, -Version 1.2 against a 1.1 DLL, a missing ARM64 DLL, and a non-plugin DLL (missing exports).
  • The CI packaging step, run locally as a v1.1 tag build for x64 and x86, wrote the expected release-notes.md and version=1.1 output.
  • build.bat arm64 on this machine stops with the "add MSVC Build Tools for ARM64/ARM64EC (Latest)" message and exits 1. An unknown argument prints usage and exits 1.

ARM64: the ARM64 build tools aren't installed on this machine, so the ARM64 DLL is built and checked only in CI. In run 38886031474, MSVC 14.51 (v145, HostX86\arm64\CL.exe) built it with 0 warnings. make-release-zip.ps1 -Platform arm64 then reported arm64 (0xAA64), version 1.1.0.0, exports beNotified, getFuncsArray, getName, isUnicode, messageProc, setInfo. The same run built x64 and Win32 with v143 (MSVC 14.44) with 0 warnings and passed the Catch2 tests 11/11 as x64 and as Win32. The dev zip SHA-256s from that run (not release values):

Zip SHA-256
LLMAssistant_vdev_x64.zip 4939A359ECDCFAE7E66B3B7C7559D09874A7EF77A16B4D370A74E7D0733CAF0D
LLMAssistant_vdev_x86.zip F4514609BCBE5329D9235D305984BD9E4BEAB1B84BDA60760FA8F5B74F88C664
LLMAssistant_vdev_arm64.zip 274C778697C573A8602060F5E7B46EA783A543CC62F406DDECBEB2104852810E

Not in this PR

  • Releasing: either adding the x86 and arm64 zips to v1.1 or cutting v1.2.
  • Adding entries to src/pl.x86.json and src/pl.arm64.json in notepad-plus-plus/nppPluginList.
  • The user-facing install and troubleshooting text in the README and INSTALLATION_GUIDE still says 64-bit only. It should change with the release that ships the new zips.
  • Runtime dependency: the DLL links the CRT dynamically (/MD), as v1.1 does. Each architecture therefore needs the VC++ Redistributable for that architecture, and the ARM64 DLL, built with v145, needs version 14.50 or later. Link the C runtime statically #7 links the CRT statically (/MT), as the Notepad++ plugin template does, which removes this dependency.

🤖 Generated with Claude Code

Gvo87 and others added 2 commits October 16, 2026 14:11
Notepad++ only loads plugins built for its own architecture, so 32-bit
and ARM64 users can't use the x64 DLL.

- LLMAssistant.vcxproj: add Win32 and ARM64 Debug/Release configurations.
  Settings now depend only on the configuration, and every platform builds
  to <Platform>\<Configuration>\ (Win32\Release\LLMAssistant.dll).
- build.bat: take an optional platform (x64 default, x86/Win32, arm64) and
  look for the ARM64 build tools component when building for ARM64.
  deploy.bat asks for x64 explicitly.
- make-release-zip.ps1: add -Platform. Before packaging, check the DLL's
  machine type, version resource and Notepad++ exports, then name the zip
  _x64, _x86 or _arm64 and print the entry for pl.<platform>.json.
- CI: build x64, Win32 and ARM64, also run the tests as 32-bit, package
  three zips with make-release-zip.ps1, and attach all three to the
  release on a v* tag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The windows-2025-vs2026 runner has v143 (MSVC 14.44) for x64 and x86
only, so msbuild failed with MSB8020 for ARM64. Build ARM64 with the
project's own v145 toolset and keep v143 for x64 and Win32.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Gvo87
Gvo87 merged commit 7707054 into main Oct 16, 2026
1 check passed
@Gvo87
Gvo87 deleted the x86-arm64-builds branch October 16, 2026 11:42
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.

1 participant