yams/packaging/windows/yams.wxs
Trevon dc7a4fb499
fix: unblock the 0.20.5 release (aarch64 budget, MSVC linkage, mobile configure, Windows MSI) (#263)
* fix(ci): size the onnx resource budget for aarch64 page alignment

libyams_onnx_resource.so is 67,624 bytes on aarch64 against a 64,000-byte budget, which failed the v0.20.4 linux-arm64 release job. It holds 23 KB of sections; aarch64 links with 64 KiB segment alignment (LOAD align 0x10000), which pads the file. The budget was measured on x86_64. 81,000 is the aarch64 size plus 20% headroom. Every other aarch64 payload is within 86% of its budget.

Signed-off-by: trvon <me@trevon.dev>

* fix(plugins): declare the S3 legacy factory with the plugin export macro

93f24394 marked the S3 plugin's yams_plugin_create/destroy_object_storage definitions YAMS_PLUGIN_API so they stay exported under hidden visibility, but include/yams/plugins/object_storage.h still declared them without it. MSVC rejects a definition whose linkage differs from the first declaration (C2375), so the v0.20.4 Windows release job failed to compile s3_plugin.cpp. GCC and Clang accept the mismatch, which is why the Linux and macOS lanes passed.

The header now includes yams/plugins/abi.h and declares both functions YAMS_PLUGIN_API, matching how abi.h declares the rest of the plugin C ABI. Checked with MSVC 14.51 (x64 target): a translation unit with the s3_plugin.cpp definitions fails with C2375 against the old header and compiles against the new one.

Signed-off-by: trvon <me@trevon.dev>

* fix(build): drop install_tag from the mobile install_headers call

324be33a passed install_tag: 'devel' to install_headers(), which accepts no such keyword. Meson 1.12 fails the configure with "install_headers got unknown keyword arguments install_tag" whenever -Denable-mobile-bindings=true, which broke the Tests linux-x86_64-mobile lane on experimental. Meson tags installed headers 'devel' by itself, so the header still ships only with the devel set (checked with meson introspect --install-plan and meson install --tags devel|runtime --dry-run on grim).

Signed-off-by: trvon <me@trevon.dev>

* fix(packaging): install the Windows onnx resource DLL next to the executables

yams-cli.exe, yams-daemon.exe and yams-mcp-server.exe import
yams_onnx_resource-0.dll at load time, but Meson installed it to lib\ and
yams.wxs never packaged it. The shipped v0.20.3 MSI therefore installs a
yams.exe that cannot start: extracting it (msiexec /a) and running
`yams.exe --version` exits 0xC00004BC with no output, and dumpbin
/dependents lists yams_onnx_resource-0.dll. The release job never runs the
staged CLI on Windows, so CI stayed green.

Drop the explicit Windows install_dir so Meson installs the DLL to bindir
(the import library stays in libdir) and add it to the MSI. With the change
`meson install` stages bin\yams_onnx_resource-0.dll and the staged
`yams.exe --version` prints the version.

Signed-off-by: trvon <me@trevon.dev>

* ci(release): smoke-test the staged Windows CLI before building the MSI

The v0.20.3 MSI shipped a yams.exe that exits 0xC00004BC because a load-time DLL was not packaged, and nothing in the release job ran the staged binary. Run the staged yams.exe --version with a 60 s timeout after meson install and fail the job on a non-zero exit. Checked on a Windows host against the old stage layout (exits 0xC00004BC, step fails) and the fixed one (prints 0.20.5, step passes).

Signed-off-by: trvon <me@trevon.dev>

---------

Signed-off-by: trvon <me@trevon.dev>
2026-10-02 18:47:16 -06:00

109 lines
5.2 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!--
WiX v4 source file for YAMS MSI installer
Build with: wix build yams.wxs -o yams.msi -d Version=X.Y.Z -d StageDir=path/to/stage
Variables:
Version - Product version (e.g., 0.1.0)
StageDir - Path to meson install destdir output (containing bin/, etc.)
-->
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
<Package
Name="YAMS"
Manufacturer="YAMS Project"
Version="$(var.Version)"
UpgradeCode="69FC51D5-B9FC-4DA9-9CA3-C889EDF8AFB8"
Scope="perMachine"
Compressed="yes">
<SummaryInformation
Description="Yet Another Media Server - Content-addressable storage and indexing"
Manufacturer="YAMS Project" />
<MajorUpgrade
DowngradeErrorMessage="A newer version of [ProductName] is already installed."
Schedule="afterInstallInitialize" />
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
<!-- Installation directory under Program Files -->
<StandardDirectory Id="ProgramFiles64Folder">
<Directory Id="INSTALLFOLDER" Name="YAMS">
<Directory Id="BinDir" Name="bin">
<Component Id="YamsExe" Guid="6BCEBA1E-C995-46DA-8FF5-0BC6A53D74EA">
<File Id="yams_exe" Source="$(var.StageDir)\bin\yams.exe" KeyPath="yes" />
</Component>
<!-- Daemon and MCP server: the CLI starts yams-daemon.exe on demand, and `yams serve`
needs yams-mcp-server.exe. Both are staged by meson install next to yams.exe. -->
<Component Id="YamsDaemonExe" Guid="052B7981-7E7E-4A4B-BA1E-508D19E762B3">
<File Id="yams_daemon_exe" Source="$(var.StageDir)\bin\yams-daemon.exe" KeyPath="yes" />
</Component>
<Component Id="YamsMcpServerExe" Guid="64FF7995-EEE6-4E3D-A1F9-CD79FD86F2AF">
<File Id="yams_mcp_server_exe" Source="$(var.StageDir)\bin\yams-mcp-server.exe" KeyPath="yes" />
</Component>
<!-- yams.exe, yams-daemon.exe and yams-mcp-server.exe import this DLL at load time;
without it next to them none of them starts. -->
<Component Id="YamsOnnxResourceDll" Guid="3E0B6F7A-2C4D-4B8E-9F1A-5D6C7B8A9E0F">
<File Id="yams_onnx_resource_dll" Source="$(var.StageDir)\bin\yams_onnx_resource-0.dll" KeyPath="yes" />
</Component>
<!-- ONNX Runtime DLLs - required for embeddings -->
<Component Id="OnnxRuntimeDll" Guid="A7E3B2C1-5D4F-4E6A-8B9C-1D2E3F4A5B6C">
<File Id="onnxruntime_dll" Source="$(var.StageDir)\bin\onnxruntime.dll" KeyPath="yes" />
</Component>
<Component Id="OnnxRuntimeProvidersSharedDll" Guid="B8F4C3D2-6E5A-4F7B-9C0D-2E3F4A5B6C7D">
<File Id="onnxruntime_providers_shared_dll" Source="$(var.StageDir)\bin\onnxruntime_providers_shared.dll" KeyPath="yes" />
</Component>
<?if $(var.IncludeTbb) = "true" ?>
<!-- TBB Runtime DLLs - present only when the Windows build links oneTBB -->
<Component Id="TbbDll" Guid="C9A5D4E3-7F6B-4A8C-0D1E-3F4A5B6C7D8E">
<File Id="tbb12_dll" Source="$(var.StageDir)\bin\tbb12.dll" KeyPath="yes" />
</Component>
<?endif?>
<Component Id="PathEnvComponent" Guid="D817B79F-C5A1-4A6E-9AE0-8430AC0DEF48">
<Environment Id="PathEnv" Name="PATH" Value="[BinDir]" Permanent="no" Part="last" Action="set" System="yes" />
<RegistryValue Root="HKLM" Key="Software\YAMS" Name="PathSet" Type="integer" Value="1" KeyPath="yes" />
</Component>
</Directory>
<!-- Plugin directory under lib/yams/plugins -->
<Directory Id="LibDir" Name="lib">
<Directory Id="YamsLibDir" Name="yams">
<Directory Id="PluginsDir" Name="plugins">
<Component Id="OnnxPlugin" Guid="E1F2A3B4-8C9D-4E5F-A6B7-C8D9E0F1A2B3">
<File Id="onnx_plugin_dll" Source="$(var.StageDir)\lib\yams\plugins\yams_onnx_plugin.dll" KeyPath="yes" />
</Component>
<Component Id="S3Plugin" Guid="F2A3B4C5-9D0E-4F6A-B7C8-D9E0F1A2B3C4">
<File Id="s3_plugin_dll" Source="$(var.StageDir)\lib\yams\plugins\yams_object_storage_s3.dll" KeyPath="yes" />
</Component>
</Directory>
</Directory>
</Directory>
</Directory>
</StandardDirectory>
<!-- Main feature: YAMS binary and runtime dependencies -->
<Feature Id="MainFeature" Title="YAMS" Level="1" ConfigurableDirectory="INSTALLFOLDER">
<ComponentRef Id="YamsExe" />
<ComponentRef Id="YamsDaemonExe" />
<ComponentRef Id="YamsMcpServerExe" />
<ComponentRef Id="YamsOnnxResourceDll" />
<ComponentRef Id="OnnxRuntimeDll" />
<ComponentRef Id="OnnxRuntimeProvidersSharedDll" />
<?if $(var.IncludeTbb) = "true" ?>
<ComponentRef Id="TbbDll" />
<?endif?>
<ComponentRef Id="PathEnvComponent" />
<!-- Plugins -->
<ComponentRef Id="OnnxPlugin" />
<ComponentRef Id="S3Plugin" />
</Feature>
<!-- UI with license agreement -->
<ui:WixUI Id="WixUI_InstallDir" />
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
<WixVariable Id="WixUILicenseRtf" Value="$(var.StageDir)\LICENSE.rtf" />
</Package>
</Wix>