From f3aae704e9167bb28ad036a29fe126703402b3b9 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Tue, 22 Sep 2026 21:43:09 +0200 Subject: [PATCH] Put msquic.dll where the QUIC native test build's loader needs it (Windows) Running QUIC Cut 3's Windows leg exposed the same class of defect Linux had at 5533c34: CULTMESH_QUIC_BUILD_TESTS has never had its own packaging step on Windows, and build-quic-native.ps1's copy of msquic.dll only lands in the final packaged output directory, never beside the test binary in the CMake build tree. Unlike the Linux failure, this one did not fail loudly. gamecult_mesh_quic_native.dll imports msquic.dll by name, and Windows DLL search falls through to PATH when the importing binary's own directory doesn't have it. This workstation has an unrelated msquic.dll on PATH from the Windows Performance Toolkit (529,480 bytes, unversioned) that is not the pinned Microsoft.Native.Quic.MsQuic.OpenSSL 2.5.9 build (4,181,856 bytes). Every asserts-build scenario ran clean against that wrong binary before this fix, with no error to say so. Mirrors the Linux POST_BUILD fix: CMake already receives MSQUIC_ROOT, so the test target now copies msquic.dll from MSQUIC_ROOT/bin/x64 beside itself instead of leaving the loader to guess. Co-Authored-By: Claude Sonnet 5 --- native/GameCult.Mesh.Quic.Native/CMakeLists.txt | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/native/GameCult.Mesh.Quic.Native/CMakeLists.txt b/native/GameCult.Mesh.Quic.Native/CMakeLists.txt index 970e2ca8..c3dfc304 100644 --- a/native/GameCult.Mesh.Quic.Native/CMakeLists.txt +++ b/native/GameCult.Mesh.Quic.Native/CMakeLists.txt @@ -81,7 +81,21 @@ if(CULTMESH_QUIC_BUILD_TESTS) endif() set_target_properties(cultmesh_quic_native_tests PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") - if(NOT WIN32) + if(WIN32) + # gamecult_mesh_quic_native.dll imports msquic.dll, and the scenario + # runner loads it from its own directory (or PATH) at process start, not + # from MSQUIC_ROOT. build-quic-native.ps1's packaged output gets a copy + # from its own recipe; a test build has no packaging step, so without this + # the loader falls through to whatever msquic.dll happens to already be on + # PATH — silently running the scenarios against an unpinned, wrong-version + # MsQuic instead of failing to start. CMake already knows MSQUIC_ROOT, so + # it places the pinned DLL itself instead of leaving the reader to guess + # why a scenario passed against the wrong binary. + add_custom_command(TARGET cultmesh_quic_native_tests POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + "${MSQUIC_ROOT}/bin/x64/msquic.dll" + "$/msquic.dll") + else() target_link_libraries(cultmesh_quic_native_tests PRIVATE pthread) # The linker resolves the bridge's own NEEDED libmsquic.so.2 while linking # this executable, and the runtime copy only lands beside the binaries after