From 22d19d4f45f7b259fbb50ba5b3d9508474165bbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Fr=C3=B6jdh?= Date: Tue, 17 Nov 2026 17:39:39 +0100 Subject: [PATCH] Conda recipe: restore full tool paths in CMAKE_ARGS (#441) ## Problem `Build conda pkgs` fails on Linux for every branch since Nov 16: ``` /bin/sh: 1: .../conda-bld/aare_.../work/x86_64-conda-linux-gnu-ar: not found ``` `gcc_linux-64` / `gxx_linux-64` 16.2.0 build `_3` (conda-forge/ctng-compiler-activation-feedstock#209) now sets bare tool names in `CMAKE_ARGS` (`-DCMAKE_AR=x86_64-conda-linux-gnu-ar`) where build `_2` set `$BUILD_PREFIX/bin/...`. scikit-build-core forwards these as untyped `-D` entries, and CMake converts an untyped relative value to an absolute path relative to the directory it was invoked from (`$SRC_DIR`) once the variable is declared as `FILEPATH`. ## Fix Rewrite `=${HOST}-` to `=${BUILD_PREFIX}/bin/${HOST}-` in `CMAKE_ARGS` before the pip install. This covers `AR`, `RANLIB`, `LINKER`, `STRIP` and the `gcc-ar` / `gcc-ranlib` variants. Values that already start with a path (macOS, or Linux once upstream restores them) do not match, so the line can stay in. ## Testing The substitution was checked locally in bash 3.2 on both the bare and the absolute form. The Linux conda build itself is only exercised by CI on this PR. --- conda-recipe/meta.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index 2e2264af..69d7fb6a 100644 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -12,6 +12,10 @@ source: build: number: 0 script: + # gcc_linux-64 16.2.0 build 3 passes bare tool names in CMAKE_ARGS + # (-DCMAKE_AR=x86_64-conda-linux-gnu-ar), which CMake resolves relative to + # SRC_DIR. Restore the full paths; no-op when they are already absolute. + - 'export CMAKE_ARGS="${CMAKE_ARGS//=${HOST}-/=${BUILD_PREFIX}/bin/${HOST}-}"' - unset CMAKE_GENERATOR && {{ PYTHON }} -m pip install . -vv requirements: