diff --git a/src/build/GhosttyLib.zig b/src/build/GhosttyLib.zig index 498f24645..4e15fbbf4 100644 --- a/src/build/GhosttyLib.zig +++ b/src/build/GhosttyLib.zig @@ -109,7 +109,7 @@ pub fn initShared( // ucrt.lib is in the Windows SDK 'ucrt' dir. Detect the SDK // installation and add the UCRT library path. const arch = deps.config.target.result.cpu.arch; - const sdk = std.zig.WindowsSdk.find(b.graph.arena, arch) catch null; + const sdk = std.zig.WindowsSdk.find(b.allocator, arch) catch null; if (sdk) |s| { if (s.windows10sdk) |w10| { const arch_str: []const u8 = switch (arch) { @@ -119,7 +119,7 @@ pub fn initShared( else => "x64", }; const ucrt_lib_path = std.fmt.allocPrint( - b.graph.arena, + b.allocator, "{s}\\Lib\\{s}\\ucrt\\{s}", .{ w10.path, w10.version, arch_str }, ) catch null; diff --git a/test/windows/README.md b/test/windows/README.md new file mode 100644 index 000000000..ed0500fb0 --- /dev/null +++ b/test/windows/README.md @@ -0,0 +1,28 @@ +# Windows Tests + +Manual test programs for Windows-specific functionality. + +## test_dll_init.c + +Regression test for the DLL CRT initialization fix. Loads ghostty.dll +at runtime and calls ghostty_info + ghostty_init to verify the MSVC C +runtime is properly initialized. + +### Build + +``` +zig cc test_dll_init.c -o test_dll_init.exe -target native-native-msvc +``` + +### Run + +``` +copy ..\..\zig-out\lib\ghostty.dll . && test_dll_init.exe +``` + +Expected output (after the CRT fix): + +``` +ghostty_info: +ghostty_init: 0 +``` diff --git a/windows/Ghostty.Tests/test_dll_init.c b/test/windows/test_dll_init.c similarity index 100% rename from windows/Ghostty.Tests/test_dll_init.c rename to test/windows/test_dll_init.c