From ec62904617e4b48f3f85e6a8adbbf76297edd466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaim=20=28Jo=C3=ABl=20Lamotte=29?= <142265+Klaim@users.noreply.github.com> Date: Mon, 28 Jul 2025 11:20:34 +0200 Subject: [PATCH] fix CI issues related to moving dependencies (#4023) --- dev/CMakePresetsMamba.json | 3 ++- dev/environment-dev.yml | 2 +- libmamba/CMakeLists.txt | 10 ++++++++++ libmamba/src/util/encoding.cpp | 1 + vcpkg.json | 5 +++++ 5 files changed, 19 insertions(+), 2 deletions(-) diff --git a/dev/CMakePresetsMamba.json b/dev/CMakePresetsMamba.json index 510b0fcc9..8f70cb6fb 100644 --- a/dev/CMakePresetsMamba.json +++ b/dev/CMakePresetsMamba.json @@ -23,7 +23,8 @@ { "cacheVariables": { "BUILD_MICROMAMBA": "ON", - "BUILD_STATIC": "ON" + "BUILD_STATIC": "ON", + "ENABLE_WIN32_XMLLITE": "ON" }, "hidden": true, "name": "mamba-static" diff --git a/dev/environment-dev.yml b/dev/environment-dev.yml index c9e2afb46..f4b576b82 100644 --- a/dev/environment-dev.yml +++ b/dev/environment-dev.yml @@ -47,7 +47,7 @@ dependencies: - scikit-build # libmambapy dependencies - python - - pybind11 + - pybind11<3.0.0 # libmambapy-stubs build dependencies - mypy # For stubgen - setuptools diff --git a/libmamba/CMakeLists.txt b/libmamba/CMakeLists.txt index 5892d8757..582d82bd6 100644 --- a/libmamba/CMakeLists.txt +++ b/libmamba/CMakeLists.txt @@ -563,6 +563,15 @@ macro(libmamba_create_target target_name linkage output_name) set(CMAKE_PREFIX_PATH "$ENV{VCPKG_ROOT}/installed/x64-windows-static-md/") + # TODO AND CONTEXT: We found a link error in libarchive which lacked a link to XmlLite + # which is provided by Windows. libarchive has cmake scripts doing the necessary work to + # link that library but for some reason we couldnt identify it is not linking in this + # specific case (it was before but the version changed apparently). As a workaround we + # manually link with that required library but a better solution would be to find why + # libarchive doesnt do it itself. + set(SYSTEM_PROVIDED_LIBRARIES XmlLite.lib) # required by libarchive + set(ENABLE_WIN32_XMLLITE ON) + # For Windows we have a vcpkg based build system right now. find_package(LibArchive MODULE REQUIRED) find_package(CURL CONFIG REQUIRED) @@ -582,6 +591,7 @@ macro(libmamba_create_target target_name linkage output_name) ${target_name} PUBLIC ${CRYPTO_LIBRARIES} + ${SYSTEM_PROVIDED_LIBRARIES} ${LibArchive_LIBRARY} ${LIBXML2_LIBRARY} ${ICONV_LIBRARY} diff --git a/libmamba/src/util/encoding.cpp b/libmamba/src/util/encoding.cpp index 08033f3d9..b32a7aa40 100644 --- a/libmamba/src/util/encoding.cpp +++ b/libmamba/src/util/encoding.cpp @@ -5,6 +5,7 @@ // The full license is in the file LICENSE, distributed with this software. #include +#include #include #include #include diff --git a/vcpkg.json b/vcpkg.json index 2f579985d..49d838f51 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -3,6 +3,11 @@ "dependencies": [ "zstd", "curl", + "libiconv", + { + "features": ["iconv", "lzma", "zlib"], + "name": "libxml2" + }, { "name": "winreg", "platform": "windows"