From ce086fd711ea2ec5bf4452ceb047c2cca85ba89e Mon Sep 17 00:00:00 2001 From: Mike Henry <11765982+mikemhenry@users.noreply.github.com> Date: Wed, 22 Jul 2026 07:44:23 -0700 Subject: [PATCH 1/6] fix: link libpsl for static libcurl builds --- libmamba/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libmamba/CMakeLists.txt b/libmamba/CMakeLists.txt index f8fe3eb4ca..f662d1e19d 100644 --- a/libmamba/CMakeLists.txt +++ b/libmamba/CMakeLists.txt @@ -511,6 +511,7 @@ macro(libmamba_create_target target_name linkage output_name) set( REQUIRED_STATIC_DEPS libcurl.a + libpsl.a libssh2.a libgssapi_krb5.a libkrb5.a @@ -624,6 +625,7 @@ macro(libmamba_create_target target_name linkage output_name) libssl_static.lib libcrypto_static.lib libcurl_a.lib + libpsl.a ) set(STATIC_DEPS "") From ac4f00a0c89ad9ee7b4f40242410f8587cda317e Mon Sep 17 00:00:00 2001 From: Julien Jerphanion Date: Thu, 30 Jul 2026 13:51:36 +0200 Subject: [PATCH 2/6] build: depend on libpsl-static for micromamba static builds Require libpsl-static in the static env and CI (all platforms except win-arm64, where it is not published), and skip linking libpsl.a there. --- .github/workflows/static_build.yml | 27 +++++++++++++++++++++++++++ dev/environment-micromamba-static.yml | 2 ++ libmamba/CMakeLists.txt | 9 ++++++++- 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/.github/workflows/static_build.yml b/.github/workflows/static_build.yml index 851cf0d38f..2351ea2f79 100644 --- a/.github/workflows/static_build.yml +++ b/.github/workflows/static_build.yml @@ -70,6 +70,32 @@ jobs: run: | cd micromamba-feedstock/ sed -i '' '/conda_forge_output_validation/d' conda-forge.yml + - name: Require libpsl-static in feedstock recipe + # Until conda-forge/micromamba-feedstock#304 is merged into `dev`. + # This mamba branch already links libpsl.a, so drop any temporary CMake patch. + run: | + python3 <<'PY' + from pathlib import Path + + path = Path("micromamba-feedstock/recipe/meta.yaml") + text = path.read_text() + if "libpsl-static" not in text: + needle = " - libcurl-static >=8.4.0 # [unix]\n" + if needle not in text: + raise SystemExit(f"could not inject libpsl-static into {path}") + text = text.replace( + needle, + needle + " - libpsl-static # [unix]\n", + 1, + ) + lines = [ + line + for line in text.splitlines(True) + if not (line.lstrip().startswith("patches:") and "psl" in line) + ] + path.write_text("".join(lines)) + print(path.read_text()) + PY - name: Checkout mamba branch uses: actions/checkout@v7 with: @@ -178,6 +204,7 @@ jobs: reproc-cpp-static>=14.2.4.post0 libmsgpack-c-static libcurl-static>=8.4.0 + libpsl-static libarchive-minimal-static zstd-static zlib diff --git a/dev/environment-micromamba-static.yml b/dev/environment-micromamba-static.yml index 213a50a0d4..fb2c35e26b 100644 --- a/dev/environment-micromamba-static.yml +++ b/dev/environment-micromamba-static.yml @@ -24,6 +24,8 @@ dependencies: - reproc-cpp-static >=14.2.4.post0 - libcurl >=8.4.0 - libcurl-static >=8.4.0 + # Not published for win-arm64 on conda-forge (this env is not used there). + - libpsl-static - libmsgpack-c-static - xz-static - libssh2-static diff --git a/libmamba/CMakeLists.txt b/libmamba/CMakeLists.txt index f662d1e19d..6af45b4a6c 100644 --- a/libmamba/CMakeLists.txt +++ b/libmamba/CMakeLists.txt @@ -625,8 +625,11 @@ macro(libmamba_create_target target_name linkage output_name) libssl_static.lib libcrypto_static.lib libcurl_a.lib - libpsl.a ) + # libpsl-static is not published for win-arm64 on conda-forge + if(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "ARM64|aarch64") + list(APPEND REQUIRED_STATIC_DEPS libpsl.a) + endif() set(STATIC_DEPS "") foreach(LIB ${REQUIRED_STATIC_DEPS}) @@ -647,6 +650,10 @@ macro(libmamba_create_target target_name linkage output_name) target_link_libraries(${target_name} PUBLIC ${SYSTEM_PROVIDED_LIBRARIES} ${STATIC_DEPS}) add_compile_definitions(LIBARCHIVE_STATIC CURL_STATICLIB) + if(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "ARM64|aarch64") + # Match libcurl-static built against libpsl-static (see curl-feedstock). + add_compile_definitions(PSL_STATIC) + endif() include_directories("${_mamba_deps_prefix}/include/") endif() else() From 7dcb66c86dd51528cc5aa44be030f3ddf6039828 Mon Sep 17 00:00:00 2001 From: Julien Jerphanion Date: Thu, 30 Jul 2026 15:04:22 +0200 Subject: [PATCH 3/6] Adapt comments and CMake logic for `win-arm64` Signed-off-by: Julien Jerphanion --- dev/environment-micromamba-static.yml | 1 - libmamba/CMakeLists.txt | 18 +++++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/dev/environment-micromamba-static.yml b/dev/environment-micromamba-static.yml index fb2c35e26b..703333834d 100644 --- a/dev/environment-micromamba-static.yml +++ b/dev/environment-micromamba-static.yml @@ -24,7 +24,6 @@ dependencies: - reproc-cpp-static >=14.2.4.post0 - libcurl >=8.4.0 - libcurl-static >=8.4.0 - # Not published for win-arm64 on conda-forge (this env is not used there). - libpsl-static - libmsgpack-c-static - xz-static diff --git a/libmamba/CMakeLists.txt b/libmamba/CMakeLists.txt index 6af45b4a6c..0e29f49e29 100644 --- a/libmamba/CMakeLists.txt +++ b/libmamba/CMakeLists.txt @@ -649,11 +649,19 @@ macro(libmamba_create_target target_name linkage output_name) target_link_libraries(${target_name} PUBLIC ${SYSTEM_PROVIDED_LIBRARIES} ${STATIC_DEPS}) - add_compile_definitions(LIBARCHIVE_STATIC CURL_STATICLIB) - if(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "ARM64|aarch64") - # Match libcurl-static built against libpsl-static (see curl-feedstock). - add_compile_definitions(PSL_STATIC) - endif() + # Necessary for properly linking static libraries. + add_compile_definitions( + # See: + # https://github.com/libarchive/libarchive/blob/19ff56da4f4790064346579a1a7f18a0230b0ac6/libarchive/archive_entry.h#L134-L158 + LIBARCHIVE_STATIC + # See: + # https://github.com/curl/curl/blob/1d7b8e6c29e22c88750fb53a01e30be03104a3fd/docs/FAQ.md?plain=1#L1074-L1077 + CURL_STATICLIB + # See: + # https://github.com/rockdaboot/libpsl/blob/8c06e95b8878f6b80613d7628486056728429d09/include/libpsl.h.in#L45-L55 + PSL_STATIC + ) + include_directories("${_mamba_deps_prefix}/include/") endif() else() From 085b896d8ce24b767f436125983f042a7870a61d Mon Sep 17 00:00:00 2001 From: Julien Jerphanion Date: Thu, 30 Jul 2026 17:44:45 +0200 Subject: [PATCH 4/6] Also link `libpsl-static` on `win-arm64` Signed-off-by: Julien Jerphanion --- libmamba/CMakeLists.txt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libmamba/CMakeLists.txt b/libmamba/CMakeLists.txt index 0e29f49e29..2f10878112 100644 --- a/libmamba/CMakeLists.txt +++ b/libmamba/CMakeLists.txt @@ -625,11 +625,8 @@ macro(libmamba_create_target target_name linkage output_name) libssl_static.lib libcrypto_static.lib libcurl_a.lib + libpsl.a ) - # libpsl-static is not published for win-arm64 on conda-forge - if(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "ARM64|aarch64") - list(APPEND REQUIRED_STATIC_DEPS libpsl.a) - endif() set(STATIC_DEPS "") foreach(LIB ${REQUIRED_STATIC_DEPS}) From 1841b155b1c7603f9f64e58c89682001ec8bc01e Mon Sep 17 00:00:00 2001 From: Julien Jerphanion Date: Fri, 31 Jul 2026 09:55:26 +0200 Subject: [PATCH 5/6] Remove recipe adaptation Signed-off-by: Julien Jerphanion --- .github/workflows/static_build.yml | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/.github/workflows/static_build.yml b/.github/workflows/static_build.yml index 2351ea2f79..6c38466f59 100644 --- a/.github/workflows/static_build.yml +++ b/.github/workflows/static_build.yml @@ -70,32 +70,6 @@ jobs: run: | cd micromamba-feedstock/ sed -i '' '/conda_forge_output_validation/d' conda-forge.yml - - name: Require libpsl-static in feedstock recipe - # Until conda-forge/micromamba-feedstock#304 is merged into `dev`. - # This mamba branch already links libpsl.a, so drop any temporary CMake patch. - run: | - python3 <<'PY' - from pathlib import Path - - path = Path("micromamba-feedstock/recipe/meta.yaml") - text = path.read_text() - if "libpsl-static" not in text: - needle = " - libcurl-static >=8.4.0 # [unix]\n" - if needle not in text: - raise SystemExit(f"could not inject libpsl-static into {path}") - text = text.replace( - needle, - needle + " - libpsl-static # [unix]\n", - 1, - ) - lines = [ - line - for line in text.splitlines(True) - if not (line.lstrip().startswith("patches:") and "psl" in line) - ] - path.write_text("".join(lines)) - print(path.read_text()) - PY - name: Checkout mamba branch uses: actions/checkout@v7 with: From 8f6c2e8fa58ec11d94f6b112f824e053a6da8fdf Mon Sep 17 00:00:00 2001 From: Julien Jerphanion Date: Fri, 31 Jul 2026 10:14:49 +0200 Subject: [PATCH 6/6] Remove psl dependencies patch Signed-off-by: Julien Jerphanion --- .github/workflows/static_build.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/static_build.yml b/.github/workflows/static_build.yml index 6c38466f59..9a872c71cf 100644 --- a/.github/workflows/static_build.yml +++ b/.github/workflows/static_build.yml @@ -70,6 +70,21 @@ jobs: run: | cd micromamba-feedstock/ sed -i '' '/conda_forge_output_validation/d' conda-forge.yml + # Already applied upstream in mamba; feedstock patch is for released tarballs only. + - name: Remove psl dependencies patch + run: | + python3 - <<'PY' + from pathlib import Path + + path = Path("micromamba-feedstock/recipe/meta.yaml") + path.write_text( + "".join( + line + for line in path.read_text().splitlines(keepends=True) + if "0001-psl-dependencies.patch" not in line + ) + ) + PY - name: Checkout mamba branch uses: actions/checkout@v7 with: