File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -132,6 +132,13 @@ $env:VXCORE_LOG_LEVEL="trace"; $env:VXCORE_LOG_FILE="C:\Temp\vxcore.log"; .\myap
132132
133133## Build Commands
134134
135+ Keep vxcore's ` find_package(Iconv REQUIRED) ` ** after** ` add_subdirectory(third_party) `
136+ and before ` src ` /` tests ` . Earlier discovery leaks ` ICONV_FOUND ` into libgit2 and
137+ enables its Unicode precomposition code on Linux, where directory iterator cleanup
138+ can call ` iconv_close ` on an uninitialized handle. Discovery must remain in the root
139+ scope because both vxcore and the standalone ` test_simple_search_backend ` use
140+ ` Iconv::Iconv ` . Clone and search tests cover both sides of this dependency.
141+
135142``` bash
136143# Configure
137144cmake -B build -DVXCORE_BUILD_TESTS=ON
Original file line number Diff line number Diff line change @@ -30,10 +30,6 @@ find_package(Threads REQUIRED)
3030if (UNIX AND NOT APPLE )
3131 find_package (OpenSSL REQUIRED )
3232endif ()
33- if (NOT WIN32 )
34- find_package (Iconv REQUIRED )
35- endif ()
36-
3733
3834# MSVC: enable C++ exception unwinding (/EHsc). Without this, try/catch blocks
3935# emit C4530 warnings AND don't actually unwind at runtime — uncaught exceptions
@@ -53,6 +49,14 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
5349list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR } /cmake/modules" )
5450
5551add_subdirectory (third_party )
52+
53+ # Discover Iconv after libgit2: leaking ICONV_FOUND into its configuration
54+ # enables Unicode precomposition on Linux and can close an uninitialized handle.
55+ # Keep the imported target in this scope for both src and standalone tests.
56+ if (NOT WIN32 )
57+ find_package (Iconv REQUIRED )
58+ endif ()
59+
5660add_subdirectory (src )
5761
5862if (VXCORE_BUILD_CLI)
You can’t perform that action at this time.
0 commit comments