This is an automated email from the ASF dual-hosted git repository.

wgtmac pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg-cpp.git


The following commit(s) were added to refs/heads/main by this push:
     new df19627a fix(cmake): Serialize test linking on Windows to avoid 
applocal races (#1064)
df19627a is described below

commit df19627a27af737452835c60cfb3bd6faf26699d
Author: Saurabh <[email protected]>
AuthorDate: Thu Oct 29 10:08:40 2026 +0000

    fix(cmake): Serialize test linking on Windows to avoid applocal races 
(#1064)
    
    vcpkg's post-link z-applocal steps copy DLLs into the shared test directory
    and collide when Ninja links tests in parallel. Link tests one at a time on
    Windows (https://cmake.org/cmake/help/latest/variable/WIN32.html).
    
    Closes #944
---
 src/iceberg/test/CMakeLists.txt | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt
index 534cbfc1..a26263ac 100644
--- a/src/iceberg/test/CMakeLists.txt
+++ b/src/iceberg/test/CMakeLists.txt
@@ -21,6 +21,15 @@ set(ICEBERG_TEST_RESOURCES 
"${CMAKE_SOURCE_DIR}/src/iceberg/test/resources")
 
 configure_file("test_config.h.in" "test_config.h")
 
+# vcpkg's z-applocal POST_BUILD copies dependency DLLs into this shared test
+# directory. Ninja appends that command to the link recipe, so a link pool of
+# depth 1 also serializes the copies. Parallel copies fail with a file lock
+# (https://github.com/apache/iceberg-cpp/issues/944).
+if(WIN32 AND CMAKE_GENERATOR MATCHES "Ninja")
+  set_property(GLOBAL APPEND PROPERTY JOB_POOLS test_link_job_pool=1)
+  set(CMAKE_JOB_POOL_LINK test_link_job_pool)
+endif()
+
 function(add_iceberg_test test_name)
   set(options USE_BUNDLE USE_DATA)
   set(oneValueArgs)

Reply via email to