Conda recipe: restore full tool paths in CMAKE_ARGS (#441)
Run tests using data on local RHEL8 / build (push) Successful in 3m52s
Build on RHEL8 / build (push) Successful in 4m21s
Build on RHEL9 / build (push) Successful in 4m49s
Build on local RHEL8 / build (push) Successful in 3m38s

## 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}-<tool>` to `=${BUILD_PREFIX}/bin/${HOST}-<tool>` 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.
This commit is contained in:
Erik Fröjdh authored and GitHub committed 2026-11-17 17:39:39 +01:00
1 parent 138945f5b8
commit 22d19d4f45
1 file changed
+4
+4
View File
@@ -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: