Skip to content

Commit b5ed5a8

Browse files
Keith MahoneyCopilot
andcommitted
fix(release): source ARM64 VC runtime from VS install, ship ARM64 portable ZIP
The VCRuntime.CefSharp.140 NuGet that supplies our x64 app-local VC++ Runtime DLLs ships no ARM64 binaries, and Microsoft does not publish a NuGet alternative. Previously we worked around this by pausing the ARM64 portable ZIP entirely; only the ARM64 installer (with bundled vc_redist.arm64.exe) shipped. That left Updatum-style portable updates broken for ARM64 users. The windows-11-arm CI runner already has Visual Studio with the C++ Redistributable component installed, which lays down loose Microsoft.VC*.CRT\arm64\*.dll files (Microsoft-signed). Resolve those at publish time via vswhere and copy them app-local next to libsodium, mirroring what the NuGet does for x64. src/Directory.Build.targets changes: - Add ResolveOpenClawVCRuntimeArm64FromVSInstall target. vswhere -> VS install -> glob VC\Redist\MSVC\*\arm64\Microsoft.VC*.CRT\vcruntime140*.dll;msvcp140*.dll. Clear errors if vswhere is missing, VS doesn't have the redist component, or no DLLs match. - Gate CopyOpenClawVCRuntimeToOutput on x64-only so local 'dotnet build -r win-arm64' does not require a VS install. The VS-install dependency only kicks in at publish time. - Plumb DependsOnTargets so the publish-time copy actually invokes the ARM64 resolver before copying. .github/workflows/ci.yml changes: - Build job's ARM64 leg now runs Test-ReleaseNativeDependencies.ps1 with -RequireAppLocalVCRuntime (same as x64). - Release job's ARM64 native-deps verify now uses -RequireAppLocalVCRuntime. -SkipNativeLoadProbe stays because the release runner is x64 and cannot LoadLibrary an ARM64 DLL. - Release job creates and uploads OpenClawTray-<ver>-win-arm64.zip alongside the x64 ZIP. - Release body lists both portable ZIPs. docs/RELEASING.md changes: - Drop the "ARM64 portable ZIPs are paused" sentence. - Document where ARM64 VC runtime DLLs come from (VS install via vswhere). - Add the ARM64 portable ZIP to the alpha-flow ship list. tests/OpenClaw.Tray.Tests/ReleaseSigningWorkflowTests.cs changes: - Assert the new ARM64 verifier call, the win-arm64.zip publish, and the ResolveOpenClawVCRuntimeArm64FromVSInstall target name. - Replace the DoesNotContain("win-arm64.zip") assertion with the inverse. Local verification on a dev box with VS 18 + ARM64 components: - 'dotnet publish -r win-arm64 --self-contained' for OpenClaw.Tray.WinUI landed all 9 expected DLLs (vcruntime140*.dll, msvcp140*.dll) in the publish dir, every one with a valid Microsoft Corporation Authenticode signature. Validation: - .\build.ps1 (Release) passed. - OpenClaw.Shared.Tests: 2045 passed, 29 skipped, 0 failed. - OpenClaw.Tray.Tests: 934 passed, 0 skipped, 0 failed. Co-authored-by: Copilot <[email protected]>
1 parent bfeb3b5 commit b5ed5a8

4 files changed

Lines changed: 111 additions & 18 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,15 @@ jobs:
399399
shell: pwsh
400400
run: .\scripts\Test-ReleaseNativeDependencies.ps1 -PayloadPath publish -RequireAppLocalVCRuntime
401401

402+
- name: Verify ARM64 Native Runtime Payload
403+
if: matrix.rid == 'win-arm64'
404+
shell: pwsh
405+
# -SkipNativeLoadProbe: an ARM64 runner CAN LoadLibrary ARM64 DLLs, but
406+
# libsodium pulls in a long native dependency chain that may not all be
407+
# in the payload here (WindowsAppSDK pieces, etc.). The probe is for x64
408+
# parity; signature + presence is what we actually care about.
409+
run: .\scripts\Test-ReleaseNativeDependencies.ps1 -PayloadPath publish -RequireAppLocalVCRuntime -SkipNativeLoadProbe
410+
402411
- name: Verify GitVersion assembly metadata
403412
shell: pwsh
404413
run: |
@@ -608,6 +617,13 @@ jobs:
608617
shell: pwsh
609618
run: .\scripts\Test-ReleaseNativeDependencies.ps1 -PayloadPath artifacts/tray-win-x64 -RequireAppLocalVCRuntime
610619

620+
- name: Verify ARM64 Release Native Dependencies
621+
shell: pwsh
622+
# -SkipNativeLoadProbe: this release job runs on the x64 windows-latest
623+
# runner and cannot LoadLibrary an ARM64 DLL. The signature and presence
624+
# checks still run.
625+
run: .\scripts\Test-ReleaseNativeDependencies.ps1 -PayloadPath artifacts/tray-win-arm64 -RequireAppLocalVCRuntime -SkipNativeLoadProbe
626+
611627
- name: Download Visual C++ Runtime Redistributables
612628
shell: pwsh
613629
run: |
@@ -628,11 +644,19 @@ jobs:
628644
}
629645
}
630646
631-
# Create ZIP file for Updatum auto-update (needs "win-x64" in filename)
647+
# Create ZIP files for Updatum auto-update (asset name must contain the RID).
648+
# We ship both x64 and arm64 portables now that the build job produces a
649+
# libsodium-compatible app-local VC runtime for both architectures (the
650+
# arm64 leg sources its loose Microsoft.VC*.CRT DLLs from the VS install
651+
# on the windows-11-arm runner; see src/Directory.Build.targets).
632652
- name: Create x64 Release ZIP
633653
run: |
634654
Compress-Archive -Path artifacts/tray-win-x64/* -DestinationPath OpenClawTray-${{ needs.test.outputs.semVer }}-win-x64.zip
635655
656+
- name: Create arm64 Release ZIP
657+
run: |
658+
Compress-Archive -Path artifacts/tray-win-arm64/* -DestinationPath OpenClawTray-${{ needs.test.outputs.semVer }}-win-arm64.zip
659+
636660
# Inno Setup installer for x64
637661
- name: Install Inno Setup
638662
run: choco install innosetup -y
@@ -651,7 +675,10 @@ jobs:
651675
# Prepare arm64 files
652676
mkdir publish-arm64
653677
copy artifacts/tray-win-arm64/* publish-arm64/ -Recurse
654-
.\scripts\Test-ReleaseNativeDependencies.ps1 -PayloadPath publish-arm64 -RequireInstallerVCRedist -InstallerVCRedistPath vc_redist.arm64.exe -SkipNativeLoadProbe
678+
# -RequireAppLocalVCRuntime: arm64 payload now ships VC runtime DLLs from the build job.
679+
# -SkipNativeLoadProbe: this verifier runs on the x64 release runner and cannot
680+
# LoadLibrary an arm64 DLL.
681+
.\scripts\Test-ReleaseNativeDependencies.ps1 -PayloadPath publish-arm64 -RequireAppLocalVCRuntime -RequireInstallerVCRedist -InstallerVCRedistPath vc_redist.arm64.exe -SkipNativeLoadProbe
655682
# Build installer
656683
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /DMyAppVersion=${{ needs.test.outputs.majorMinorPatch }} /DMyAppArch=arm64 /Dpublish=publish-arm64 /DvcRedist=vc_redist.arm64.exe installer.iss
657684
@@ -675,6 +702,7 @@ jobs:
675702
Output/OpenClawCompanion-Setup-x64.exe
676703
Output/OpenClawCompanion-Setup-arm64.exe
677704
OpenClawTray-${{ needs.test.outputs.semVer }}-win-x64.zip
705+
OpenClawTray-${{ needs.test.outputs.semVer }}-win-arm64.zip
678706
prerelease: ${{ contains(github.ref_name, '-') }}
679707
make_latest: ${{ contains(github.ref_name, '-') && 'false' || 'true' }}
680708
body: |
@@ -684,6 +712,7 @@ jobs:
684712
- **Installer (x64)**: `OpenClawCompanion-Setup-x64.exe` - Intel/AMD 64-bit
685713
- **Installer (ARM64)**: `OpenClawCompanion-Setup-arm64.exe` - Windows on ARM (Surface, etc.)
686714
- **Portable x64**: `OpenClawTray-${{ needs.test.outputs.semVer }}-win-x64.zip`
715+
- **Portable ARM64**: `OpenClawTray-${{ needs.test.outputs.semVer }}-win-arm64.zip`
687716
688717
### Features
689718
- 🦞 System tray integration with gateway status

‎docs/RELEASING.md‎

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@ For the current alpha flow, ship only:
6969
- Inno setup installers:
7070
- `OpenClawCompanion-Setup-x64.exe`
7171
- `OpenClawCompanion-Setup-arm64.exe`
72-
- Portable ZIP payload for Updatum:
72+
- Portable ZIP payloads for Updatum:
7373
- `OpenClawTray-<version>-win-x64.zip`
74+
- `OpenClawTray-<version>-win-arm64.zip`
7475

7576
MSIX artifacts are intentionally paused for alpha while we focus on the Inno
7677
installer path and signed portable update payloads. Re-enable MSIX only when we
@@ -99,15 +100,18 @@ CI enforces this with `scripts\Test-ReleaseExecutableSignatures.ps1`. The
99100
verifier fails closed on unknown `.exe` files so future payload changes are
100101
reviewed deliberately.
101102

102-
CI also checks native runtime dependencies before release packaging. The x64
103-
portable payload must ship `vcruntime140.dll` next to every `libsodium.dll`
104-
copy. The release job must Authenticode-verify Microsoft's x64 and ARM64 Visual
105-
C++ Runtime redistributables before passing the architecture-matching
106-
redistributable to Inno. The installer runs the redistributable before launching
107-
the tray so clean or stale Windows hosts can repair the runtime before Ed25519
108-
device keys are generated or loaded, and it skips the post-install tray launch
109-
if the runtime installer fails. ARM64 portable ZIPs are paused until the release
110-
pipeline has a trusted app-local ARM64 VC runtime source.
103+
CI also checks native runtime dependencies before release packaging. Both the
104+
x64 and ARM64 portable payloads must ship `vcruntime140.dll` next to every
105+
`libsodium.dll` copy. The x64 build leg sources its loose VC runtime DLLs from
106+
the `VCRuntime.CefSharp.140` NuGet package; the ARM64 build leg sources its
107+
DLLs from the Visual Studio install on the `windows-11-arm` runner (resolved
108+
via `vswhere` in `src\Directory.Build.targets`). The release job must
109+
Authenticode-verify Microsoft's x64 and ARM64 Visual C++ Runtime
110+
redistributables before passing the architecture-matching redistributable to
111+
Inno. The installer runs the redistributable before launching the tray so
112+
clean or stale Windows hosts can repair the runtime before Ed25519 device keys
113+
are generated or loaded, and it skips the post-install tray launch if the
114+
runtime installer fails.
111115

112116
The current Azure Artifact Signing resource is:
113117

‎src/Directory.Build.targets‎

Lines changed: 62 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,81 @@
44
<OpenClawVCRuntimePackageVersion>1.0.5</OpenClawVCRuntimePackageVersion>
55
<OpenClawVCRuntimePackageRoot>$(NuGetPackageRoot)vcruntime.cefsharp.140\$(OpenClawVCRuntimePackageVersion)\vc_redist\</OpenClawVCRuntimePackageRoot>
66
<OpenClawVCRuntimeArch Condition="'$(RuntimeIdentifier)' == 'win-x64'">x64</OpenClawVCRuntimeArch>
7+
<OpenClawVCRuntimeArch Condition="'$(RuntimeIdentifier)' == 'win-arm64'">arm64</OpenClawVCRuntimeArch>
78
</PropertyGroup>
89

9-
<ItemGroup Condition="'$(OpenClawVCRuntimeArch)' != ''">
10-
<OpenClawVCRuntimeFiles Include="$(OpenClawVCRuntimePackageRoot)$(OpenClawVCRuntimeArch)\*.dll" />
10+
<!--
11+
x64 ships loose VC runtime DLLs sourced from the VCRuntime.CefSharp.140
12+
NuGet package, so devs don't need a Visual Studio install to build/publish.
13+
14+
ARM64 is resolved at publish time from the local Visual Studio install via
15+
ResolveOpenClawVCRuntimeArm64FromVSInstall — the existing NuGet ships no
16+
ARM64 binaries and Microsoft does not publish a comparable NuGet for the
17+
loose ARM64 redist DLLs.
18+
19+
Local 'dotnet build -r win-arm64' intentionally does NOT require a VS
20+
install (so cross-compile sanity checks keep working on x64 dev boxes).
21+
The VS-install requirement only kicks in at publish time, which is what
22+
the release pipeline actually runs on the windows-11-arm runner.
23+
-->
24+
<ItemGroup Condition="'$(OpenClawVCRuntimeArch)' == 'x64'">
25+
<OpenClawVCRuntimeFiles Include="$(OpenClawVCRuntimePackageRoot)x64\*.dll" />
1126
</ItemGroup>
1227

28+
<Target Name="ResolveOpenClawVCRuntimeArm64FromVSInstall"
29+
Condition="'$(OpenClawVCRuntimeArch)' == 'arm64'">
30+
31+
<PropertyGroup>
32+
<_OpenClawVsWherePath>$(MSBuildProgramFiles32)\Microsoft Visual Studio\Installer\vswhere.exe</_OpenClawVsWherePath>
33+
</PropertyGroup>
34+
35+
<Error Condition="!Exists('$(_OpenClawVsWherePath)')"
36+
Text="vswhere.exe not found at '$(_OpenClawVsWherePath)'. Publishing for win-arm64 requires a Visual Studio install with the C++ Redistributable (Microsoft.VisualStudio.Component.VC.Redist.14.Latest) component. Install Visual Studio 2022 or later with that component, or publish for win-x64 instead." />
37+
38+
<Exec Command="&quot;$(_OpenClawVsWherePath)&quot; -latest -products * -requires Microsoft.VisualStudio.Component.VC.Redist.14.Latest -property installationPath"
39+
ConsoleToMSBuild="true"
40+
IgnoreExitCode="true">
41+
<Output TaskParameter="ConsoleOutput" PropertyName="_OpenClawVsInstallRoot" />
42+
</Exec>
43+
44+
<Error Condition="'$(_OpenClawVsInstallRoot)' == '' or !Exists('$(_OpenClawVsInstallRoot)')"
45+
Text="vswhere did not find a Visual Studio install with the C++ Redistributable (Microsoft.VisualStudio.Component.VC.Redist.14.Latest) component (got '$(_OpenClawVsInstallRoot)'). Install that component via the Visual Studio Installer (Individual Components tab), or publish for win-x64 instead." />
46+
47+
<!--
48+
Glob the loose CRT DLLs. The Microsoft.VC*.CRT folder name carries the VS
49+
major version (Microsoft.VC143.CRT for VS 2022, Microsoft.VC145.CRT for
50+
VS 18). There is at most one Microsoft.VC*.CRT subdir per arch per redist
51+
version, so the * collapses to a single match. We limit to
52+
vcruntime140*.dll + msvcp140*.dll to match the file set the x64 NuGet
53+
ships (concrt140/vccorlib140/vcruntime140_threads aren't needed by
54+
libsodium and aren't in the x64 payload either).
55+
-->
56+
<ItemGroup>
57+
<OpenClawVCRuntimeFiles Include="$(_OpenClawVsInstallRoot)\VC\Redist\MSVC\*\arm64\Microsoft.VC*.CRT\vcruntime140*.dll" />
58+
<OpenClawVCRuntimeFiles Include="$(_OpenClawVsInstallRoot)\VC\Redist\MSVC\*\arm64\Microsoft.VC*.CRT\msvcp140*.dll" />
59+
</ItemGroup>
60+
61+
<Error Condition="'@(OpenClawVCRuntimeFiles)' == ''"
62+
Text="No ARM64 VC++ Runtime DLLs were found under '$(_OpenClawVsInstallRoot)\VC\Redist\MSVC\*\arm64\Microsoft.VC*.CRT\'. Install the 'C++ ARM64/ARM64EC build tools' and 'C++ Redistributable Update' Visual Studio components." />
63+
</Target>
64+
1365
<Target Name="CopyOpenClawVCRuntimeToOutput"
1466
AfterTargets="Build"
15-
Condition="'$(OpenClawVCRuntimeArch)' != '' and '@(OpenClawVCRuntimeFiles)' != ''">
67+
Condition="'$(OpenClawVCRuntimeArch)' == 'x64' and '@(OpenClawVCRuntimeFiles)' != ''">
68+
<!--
69+
x64-only on purpose. ARM64 publishes its runtime through the publish-only
70+
target below so that local 'dotnet build -r win-arm64' does not require
71+
a Visual Studio install.
72+
-->
1673
<Copy SourceFiles="@(OpenClawVCRuntimeFiles)"
1774
DestinationFolder="$(TargetDir)"
1875
SkipUnchangedFiles="true" />
1976
</Target>
2077

2178
<Target Name="CopyOpenClawVCRuntimeToPublish"
2279
AfterTargets="Publish"
23-
Condition="'$(PublishDir)' != '' and '$(OpenClawVCRuntimeArch)' != '' and '@(OpenClawVCRuntimeFiles)' != ''">
80+
DependsOnTargets="ResolveOpenClawVCRuntimeArm64FromVSInstall"
81+
Condition="'$(PublishDir)' != '' and '$(OpenClawVCRuntimeArch)' != ''">
2482
<Copy SourceFiles="@(OpenClawVCRuntimeFiles)"
2583
DestinationFolder="$(PublishDir)"
2684
SkipUnchangedFiles="true" />

‎tests/OpenClaw.Tray.Tests/ReleaseSigningWorkflowTests.cs‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,18 @@ public void ReleaseWorkflow_BundlesAndVerifiesNativeRuntimeDependencies()
5959

6060
Assert.Contains("Test-ReleaseNativeDependencies.ps1 -PayloadPath publish -RequireAppLocalVCRuntime", workflow);
6161
Assert.Contains("Test-ReleaseNativeDependencies.ps1 -PayloadPath artifacts/tray-win-x64 -RequireAppLocalVCRuntime", workflow);
62+
Assert.Contains("Test-ReleaseNativeDependencies.ps1 -PayloadPath artifacts/tray-win-arm64 -RequireAppLocalVCRuntime -SkipNativeLoadProbe", workflow);
6263
Assert.Contains("https://aka.ms/vc14/vc_redist.x64.exe", workflow);
6364
Assert.Contains("https://aka.ms/vc14/vc_redist.arm64.exe", workflow);
6465
Assert.Contains("Get-AuthenticodeSignature -LiteralPath $redist.Path", workflow);
6566
Assert.Contains("O=Microsoft Corporation", workflow);
6667
Assert.Contains("-InstallerVCRedistPath vc_redist.x64.exe", workflow);
67-
Assert.Contains("publish-arm64 -RequireInstallerVCRedist -InstallerVCRedistPath vc_redist.arm64.exe -SkipNativeLoadProbe", workflow);
68+
Assert.Contains("publish-arm64 -RequireAppLocalVCRuntime -RequireInstallerVCRedist -InstallerVCRedistPath vc_redist.arm64.exe -SkipNativeLoadProbe", workflow);
6869
Assert.Contains("/DvcRedist=vc_redist.x64.exe", workflow);
6970
Assert.Contains("/DvcRedist=vc_redist.arm64.exe", workflow);
7071
Assert.DoesNotContain("copy vc_redist.x64.exe publish-x64", workflow);
7172
Assert.DoesNotContain("copy vc_redist.x64.exe publish-arm64", workflow);
72-
Assert.DoesNotContain("win-arm64.zip", workflow);
73+
Assert.Contains("OpenClawTray-${{ needs.test.outputs.semVer }}-win-arm64.zip", workflow);
7374
Assert.Contains("AfterInstall: InstallVCRuntime", installer);
7475
Assert.Contains("Exec(", installer);
7576
Assert.Contains("ResultCode = 3010", installer);
@@ -83,6 +84,7 @@ public void ReleaseWorkflow_BundlesAndVerifiesNativeRuntimeDependencies()
8384
Assert.Contains("OpenClawNativeDependencyProbe", verifier);
8485
Assert.Contains("SkipNativeLoadProbe", verifier);
8586
Assert.Contains("CopyOpenClawVCRuntimeToPublish", targets);
87+
Assert.Contains("ResolveOpenClawVCRuntimeArm64FromVSInstall", targets);
8688
}
8789

8890
[Fact]

0 commit comments

Comments
 (0)