You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "marcin-krystianc (via GitHub)" <gi...@apache.org> on 2026/03/11 21:48:58 UTC

[I] Snappy and Brotli debug libraries linked in Release builds when using vcpkg with multi-config generators [arrow]

marcin-krystianc opened a new issue, #49499:
URL: https://github.com/apache/arrow/issues/49499

   ### Describe the bug, including details regarding any error messages, version, and platform.
   
   
   When consuming Arrow via vcpkg with a multi-config CMake generator (Visual Studio) and a static triplet (`x64-windows-static`), Release builds link against debug versions of Snappy and Brotli. This causes LNK2038 (`_ITERATOR_DEBUG_LEVEL` / `RuntimeLibrary` mismatch) errors.
   
   ### Steps to reproduce
   
   - Download [arrow-vcpkg-issue.zip](https://github.com/user-attachments/files/25919827/arrow-vcpkg-issue.zip)
   - Run the `repro.ps1`.
   - See the error:
   ```
   Project "D:\workspace\arrow-vcpkg-issue\build\arrow_vcpkg_repro.sln" on node 1 (repro:Rebuild target(s)).
   ValidateSolutionConfiguration:
     Building solution configuration "Release|x64".
   ValidateProjects:
     The project "ALL_BUILD" is not selected for building in solution configuration "Release|x64".
   Project "D:\workspace\arrow-vcpkg-issue\build\arrow_vcpkg_repro.sln" (1) is building "D:\workspace\arrow-vcpkg-issue\build\
   repro.vcxproj.metaproj" (2) on node 1 (Rebuild target(s)).
   Project "D:\workspace\arrow-vcpkg-issue\build\repro.vcxproj.metaproj" (2) is building "D:\workspace\arrow-vcpkg-issue\build
   \ZERO_CHECK.vcxproj" (3) on node 1 (Rebuild target(s)).
   CoreClean:
     Creating directory "x64\Release\ZERO_CHECK\".
   PrepareForBuild:
     Structured output is enabled. The formatting of compiler diagnostics will reflect the error hierarchy. See https://aka.ms
     /cpp/structured-output for more details.
     Creating directory "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\".
   InitializeBuildStatus:
     Creating "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
     Touching "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild".
   CustomBuild:
     1>Checking Build System
   FinalizeBuildStatus:
     Deleting file "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild".
     Touching "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\ZERO_CHECK.lastbuildstate".
   Done Building Project "D:\workspace\arrow-vcpkg-issue\build\ZERO_CHECK.vcxproj" (Rebuild target(s)).
   
   Project "D:\workspace\arrow-vcpkg-issue\build\repro.vcxproj.metaproj" (2) is building "D:\workspace\arrow-vcpkg-issue\build
   \repro.vcxproj" (4) on node 1 (Rebuild target(s)).
   CoreClean:
     Creating directory "repro.dir\Release\".
   PrepareForBuild:
     Structured output is enabled. The formatting of compiler diagnostics will reflect the error hierarchy. See https://aka.ms
     /cpp/structured-output for more details.
     Creating directory "D:\workspace\arrow-vcpkg-issue\build\Release\".
     Creating directory "repro.dir\Release\repro.tlog\".
   InitializeBuildStatus:
     Creating "repro.dir\Release\repro.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
     Touching "repro.dir\Release\repro.tlog\unsuccessfulbuild".
   CustomBuild:
     Building Custom Rule D:/workspace/arrow-vcpkg-issue/CMakeLists.txt
   ClCompile:
     C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\bin\HostX64\x64\CL.exe /c /nologo /W1 /
     WX- /diagnostics:column /O2 /Ob2 /D _WINDLL /D _MBCS /D WIN32 /D _WINDOWS /D NDEBUG /D ARROW_STATIC /D PARQUET_STATIC /D
     ARROW_FLIGHT_STATIC /D ARROW_FLIGHT_SQL_STATIC /D "CMAKE_INTDIR=\"Release\"" /D repro_EXPORTS /Gm- /EHsc /MT /GS /fp:prec
     ise /Zc:wchar_t /Zc:forScope /Zc:inline /std:c++20 /Fo"repro.dir\Release\\" /Fd"repro.dir\Release\vc143.pdb" /external:W0
      /Gd /TP /errorReport:queue  /external:I "D:/workspace/arrow-vcpkg-issue/build/vcpkg_installed/x64-windows-static/include
     " "D:\workspace\arrow-vcpkg-issue\repro.cpp"
     repro.cpp
   Link:
     C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\bin\HostX64\x64\link.exe /ERRORREPORT:Q
     UEUE /OUT:"D:\workspace\arrow-vcpkg-issue\build\Release\repro.dll" /INCREMENTAL:NO /NOLOGO "vcpkg_installed\x64-windows-s
     tatic\lib\parquet.lib" "vcpkg_installed\x64-windows-static\lib\arrow.lib" "vcpkg_installed\x64-windows-static\debug\lib\b
     rotlienc.lib" "vcpkg_installed\x64-windows-static\debug\lib\brotlidec.lib" "vcpkg_installed\x64-windows-static\debug\lib\
     brotlicommon.lib" "vcpkg_installed\x64-windows-static\lib\bz2.lib" "vcpkg_installed\x64-windows-static\lib\lz4.lib" "vcpk
     g_installed\x64-windows-static\debug\lib\snappy.lib" "vcpkg_installed\x64-windows-static\lib\zlib.lib" "vcpkg_installed\x
     64-windows-static\lib\zstd.lib" "vcpkg_installed\x64-windows-static\lib\thriftmd.lib" "vcpkg_installed\x64-windows-static
     \lib\libssl.lib" "vcpkg_installed\x64-windows-static\lib\libcrypto.lib" crypt32.lib ws2_32.lib kernel32.lib user32.lib gd
     i32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTUAC:"level=
     'asInvoker' uiAccess='false'" /manifest:embed /PDB:"D:/workspace/arrow-vcpkg-issue/build/Release/repro.pdb" /SUBSYSTEM:CO
     NSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"D:/workspace/arrow-vcpkg-issue/build/Release/repro.lib" /MACHINE:X64  /mac
     hine:x64 /DLL repro.dir\Release\repro.obj
   snappy.lib(snappy.cc.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0'
    in repro.obj [D:\workspace\arrow-vcpkg-issue\build\repro.vcxproj]
   snappy.lib(snappy.cc.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match va
   lue 'MT_StaticRelease' in repro.obj [D:\workspace\arrow-vcpkg-issue\build\repro.vcxproj]
        Creating library D:/workspace/arrow-vcpkg-issue/build/Release/repro.lib and object D:/workspace/arrow-vcpkg-issue/buil
     d/Release/repro.exp
   LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library [D:\workspace\arro
   w-vcpkg-issue\build\repro.vcxproj]
   snappy.lib(snappy.cc.obj) : error LNK2019: unresolved external symbol _CrtDbgReport referenced in function "void * __cdecl
   std::_Allocate_manually_vector_aligned<struct std::_Default_allocate_traits>(unsigned __int64)" (??$_Allocate_manually_vect
   or_aligned@U_Default_allocate_traits@std@@@std@@YAPEAX_K@Z) [D:\workspace\arrow-vcpkg-issue\build\repro.vcxproj]
   D:\workspace\arrow-vcpkg-issue\build\Release\repro.dll : fatal error LNK1120: 1 unresolved externals [D:\workspace\arrow-vc
   pkg-issue\build\repro.vcxproj]
   Done Building Project "D:\workspace\arrow-vcpkg-issue\build\repro.vcxproj" (Rebuild target(s)) -- FAILED.
   
   Done Building Project "D:\workspace\arrow-vcpkg-issue\build\repro.vcxproj.metaproj" (Rebuild target(s)) -- FAILED.
   
   Done Building Project "D:\workspace\arrow-vcpkg-issue\build\arrow_vcpkg_repro.sln" (repro:Rebuild target(s)) -- FAILED.
   
   
   Build FAILED.
   
   "D:\workspace\arrow-vcpkg-issue\build\arrow_vcpkg_repro.sln" (repro:Rebuild target) (1) ->
   "D:\workspace\arrow-vcpkg-issue\build\repro.vcxproj.metaproj" (Rebuild target) (2) ->
   "D:\workspace\arrow-vcpkg-issue\build\repro.vcxproj" (Rebuild target) (4) ->
   (Link target) ->
     LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library [D:\workspace\ar
   row-vcpkg-issue\build\repro.vcxproj]
   
   
   "D:\workspace\arrow-vcpkg-issue\build\arrow_vcpkg_repro.sln" (repro:Rebuild target) (1) ->
   "D:\workspace\arrow-vcpkg-issue\build\repro.vcxproj.metaproj" (Rebuild target) (2) ->
   "D:\workspace\arrow-vcpkg-issue\build\repro.vcxproj" (Rebuild target) (4) ->
   (Link target) ->
     snappy.lib(snappy.cc.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '
   0' in repro.obj [D:\workspace\arrow-vcpkg-issue\build\repro.vcxproj]
     snappy.lib(snappy.cc.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match
   value 'MT_StaticRelease' in repro.obj [D:\workspace\arrow-vcpkg-issue\build\repro.vcxproj]
     snappy.lib(snappy.cc.obj) : error LNK2019: unresolved external symbol _CrtDbgReport referenced in function "void * __cdec
   l std::_Allocate_manually_vector_aligned<struct std::_Default_allocate_traits>(unsigned __int64)" (??$_Allocate_manually_ve
   ctor_aligned@U_Default_allocate_traits@std@@@std@@YAPEAX_K@Z) [D:\workspace\arrow-vcpkg-issue\build\repro.vcxproj]
     D:\workspace\arrow-vcpkg-issue\build\Release\repro.dll : fatal error LNK1120: 1 unresolved externals [D:\workspace\arrow-
   vcpkg-issue\build\repro.vcxproj]
   ```
   
   ### Expected behavior
   
   Release builds should link against release libraries. The vcpkg-installed Snappy and Brotli packages provide proper per-configuration CMake targets (`IMPORTED_LOCATION_DEBUG` / `IMPORTED_LOCATION_RELEASE`). Arrow's find modules should use them.
   
   ### Environment
   
   - Arrow 23.0.1
   - vcpkg with `x64-windows-static` triplet=
   - Windows x64
   
   ### Remarks
   The problem is related (at least partially) to the changes from https://github.com/apache/arrow/pull/46467. It seems that `ARROW_VCPKG` is empty instead of the expected "ON" value.
   
   ### Component(s)
   
   Packaging


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Snappy and Brotli debug libraries linked in Release builds when using vcpkg with multi-config generators [arrow]

Posted by "marcin-krystianc (via GitHub)" <gi...@apache.org>.
marcin-krystianc commented on issue #49499:
URL: https://github.com/apache/arrow/issues/49499#issuecomment-4050123746

   FYI @kou 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Snappy and Brotli debug libraries linked in Release builds when using vcpkg with multi-config generators [arrow]

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on issue #49499:
URL: https://github.com/apache/arrow/issues/49499#issuecomment-4070787897

   Thanks. I couldn't download `full_log.txt` (InvalidRange error) but could download `ArrowConfig.cmake`.
   
   Ah, vcpkg doesn't use `-DARROW_DEPENDENCY_SOURCE=VCPKG` https://github.com/microsoft/vcpkg/blob/4b77da7fed37817f124936239197833469f1b9a8/ports/arrow/portfile.cmake#L59 ...
   
   How about this? You can try this by rebuilding the `arrow` vcpkg port with this patch.
   
   ```diff
   diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
   index 44186494ec..ea15bb7066 100644
   --- a/cpp/CMakeLists.txt
   +++ b/cpp/CMakeLists.txt
   @@ -115,6 +115,8 @@ list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules")
    # vcpkg (ab)uses CMAKE_TOOLCHAIN_FILE to inject its logic into CMake
    if(ARROW_DEPENDENCY_SOURCE STREQUAL "VCPKG")
      include(Usevcpkg)
   +elseif(ARROW_PACKAGE_KIND STREQUAL "vcpkg")
   +  set(ARROW_VCPKG ON)
    endif()
    
    project(arrow VERSION "${ARROW_BASE_VERSION}")
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Snappy and Brotli debug libraries linked in Release builds when using vcpkg with multi-config generators [arrow]

Posted by "marcin-krystianc (via GitHub)" <gi...@apache.org>.
marcin-krystianc commented on issue #49499:
URL: https://github.com/apache/arrow/issues/49499#issuecomment-4053777580

   > Could you provide `ArrowConfig.cmake` in your environment?
   > 
   > Could you provide the log of `cmake -B build/ -S . -D VCPKG_TARGET_TRIPLET=$triplet -D CMAKE_TOOLCHAIN_FILE=$vcpkgDir/scripts/buildsystems/vcpkg.cmake -G "Visual Studio 17 2022" -A x64 --trace-source=FindSnappyAlt.cmake --trace-source=FindBrotliAlt.cmake --trace-source=ArrowConfig.cmake --trace-source=ArrowTargets.cmake --trace-expand`?
   
   - [full_log.txt.txt](https://github.com/user-attachments/files/25965379/full_log.txt.txt)
   - [ArrowConfig.cmake](https://github.com/user-attachments/files/25965464/ArrowConfig.cmake.txt)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Snappy and Brotli debug libraries linked in Release builds when using vcpkg with multi-config generators [arrow]

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on issue #49499:
URL: https://github.com/apache/arrow/issues/49499#issuecomment-4051828471

   Could you provide `ArrowConfig.cmake` in your environment?
   
   Could you provide the log of `cmake -B build/ -S . -D VCPKG_TARGET_TRIPLET=$triplet -D CMAKE_TOOLCHAIN_FILE=$vcpkgDir/scripts/buildsystems/vcpkg.cmake -G "Visual Studio 17 2022" -A x64 --trace-source=FindSnappyAlt.cmake --trace-source=FindBrotliAlt.cmake --trace-source=ArrowConfig.cmake --trace-source=ArrowTargets.cmake --trace-expand`?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org