Repository: conda-forge/cms-combine-feedstock
Pull request #9: MNT: Update to v1 recipe format and rattler-build
Author: login: matthewfeickert
Created: 2025-03-06T08:00:08Z | Merged: 2025-03-07T16:34:58Z

* Update to v1 recipe format.
   - c.f. https://conda-forge.org/blog/2025/02/27/conda-forge-v1-recipe-support/
* Add rattler-build as tooling.
   - **Drops feedstock build time from ~28 minutes to ~12.5 minutes**.
* Remove `ignore_run_exports` for `python` and `gsl` as they are run requirements.
* Make `recipe/cmake_installpython.patch` a proper Git patch rather than the diff to avoid
  build errors.
   - Backport from the https://github.com/cms-analysis/HiggsAnalysis-CombinedLimit/pull/1053 by cherry-picking commit and fixing as needed.
* Add @kcormi as a maintainer.
* Bump build number.

<!--
Thank you for your pull request.
Below are a few things we ask you kindly to self-check before getting a review. Remove checks that are not relevant.
-->
Checklist
* [x] Used a [personal fork of the feedstock to propose changes](https://conda-forge.org/docs/maintainer/updating_pkgs.html#forking-and-pull-requests)
* [x] Bumped the build number (if the version is unchanged)
* [N/A] Reset the build number to `0` (if the version changed)
* [x] [Re-rendered]( https://conda-forge.org/docs/maintainer/updating_pkgs.html#rerendering-feedstocks ) with the latest `conda-smithy` (Use the phrase <code>@<space/>conda-forge-admin, please rerender</code> in a comment in this PR for automated rerendering)
* [x] Ensured the license file is being packaged.

<!--
Please note any issues this fixes using [closing keywords]( https://help.github.com/articles/closing-issues-using-keywords/ ):
-->

<!--
Please add any other relevant info below:
-->



Diff:
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index ad0ebba..206b510 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -1 +1 @@
-* @anigamova @nsmith-
\ No newline at end of file
+* @anigamova @kcormi @nsmith-
\ No newline at end of file
diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh
index 827a29f..e33a630 100755
--- a/.scripts/build_steps.sh
+++ b/.scripts/build_steps.sh
@@ -31,11 +31,21 @@ pkgs_dirs:
 solver: libmamba
 
 CONDARC
-mv /opt/conda/conda-meta/history /opt/conda/conda-meta/history.$(date +%Y-%m-%d-%H-%M-%S)
-echo > /opt/conda/conda-meta/history
-micromamba install --root-prefix ~/.conda --prefix /opt/conda \
-    --yes --override-channels --channel conda-forge --strict-channel-priority \
-    pip  python=3.12 conda-build conda-forge-ci-setup=4 "conda-build>=24.1"
+curl -fsSL https://pixi.sh/install.sh | bash
+export PATH="~/.pixi/bin:$PATH"
+pushd "${FEEDSTOCK_ROOT}"
+arch=$(uname -m)
+if [[ "$arch" == "x86_64" ]]; then
+  arch="64"
+fi
+sed -i.bak "s/platforms = .*/platforms = [\"linux-${arch}\"]/" pixi.toml
+echo "Creating environment"
+PIXI_CACHE_DIR=/opt/conda pixi install
+pixi list
+echo "Activating environment"
+eval "$(pixi shell-hook)"
+mv pixi.toml.bak pixi.toml
+popd
 export CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1
 
 # set up the condarc
@@ -49,7 +59,7 @@ source run_conda_forge_build_setup
 make_build_number "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}"
 
 if [[ "${HOST_PLATFORM}" != "${BUILD_PLATFORM}" ]] && [[ "${HOST_PLATFORM}" != linux-* ]] && [[ "${BUILD_WITH_CONDA_DEBUG:-0}" != 1 ]]; then
-    EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --no-test"
+    EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --test skip"
 fi
 
 
@@ -60,20 +70,16 @@ if [[ -f "${FEEDSTOCK_ROOT}/LICENSE.txt" ]]; then
 fi
 
 if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then
-    if [[ "x${BUILD_OUTPUT_ID:-}" != "x" ]]; then
-        EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --output-id ${BUILD_OUTPUT_ID}"
-    fi
-    conda debug "${RECIPE_ROOT}" -m "${CI_SUPPORT}/${CONFIG}.yaml" \
-        ${EXTRA_CB_OPTIONS:-} \
-        --clobber-file "${CI_SUPPORT}/clobber_${CONFIG}.yaml"
-
-    # Drop into an interactive shell
-    /bin/bash
+    echo "rattler-build currently doesn't support debug mode"
 else
-    conda-build "${RECIPE_ROOT}" -m "${CI_SUPPORT}/${CONFIG}.yaml" \
-        --suppress-variables ${EXTRA_CB_OPTIONS:-} \
-        --clobber-file "${CI_SUPPORT}/clobber_${CONFIG}.yaml" \
-        --extra-meta flow_run_id="${flow_run_id:-}" remote_url="${remote_url:-}" sha="${sha:-}"
+
+    rattler-build build --recipe "${RECIPE_ROOT}" \
+     -m "${CI_SUPPORT}/${CONFIG}.yaml" \
+     ${EXTRA_CB_OPTIONS:-} \
+     --target-platform "${HOST_PLATFORM}" \
+     --extra-meta flow_run_id="${flow_run_id:-}" \
+     --extra-meta remote_url="${remote_url:-}" \
+     --extra-meta sha="${sha:-}"
     ( startgroup "Inspecting artifacts" ) 2> /dev/null
 
     # inspect_artifacts was only added in conda-forge-ci-setup 4.9.4
diff --git a/.scripts/run_osx_build.sh b/.scripts/run_osx_build.sh
index 0e3c394..1d78eef 100755
--- a/.scripts/run_osx_build.sh
+++ b/.scripts/run_osx_build.sh
@@ -9,34 +9,24 @@ set -xe
 MINIFORGE_HOME="${MINIFORGE_HOME:-${HOME}/miniforge3}"
 MINIFORGE_HOME="${MINIFORGE_HOME%/}" # remove trailing slash
 export CONDA_BLD_PATH="${CONDA_BLD_PATH:-${MINIFORGE_HOME}/conda-bld}"
-
-( startgroup "Provisioning base env with micromamba" ) 2> /dev/null
-MICROMAMBA_VERSION="1.5.10-0"
-if [[ "$(uname -m)" == "arm64" ]]; then
-  osx_arch="osx-arm64"
-else
-  osx_arch="osx-64"
+( startgroup "Provisioning base env with pixi" ) 2> /dev/null
+mkdir -p "${MINIFORGE_HOME}"
+curl -fsSL https://pixi.sh/install.sh | bash
+export PATH="~/.pixi/bin:$PATH"
+arch=$(uname -m)
+if [[ "$arch" == "x86_64" ]]; then
+  arch="64"
 fi
-MICROMAMBA_URL="https://github.com/mamba-org/micromamba-releases/releases/download/${MICROMAMBA_VERSION}/micromamba-${osx_arch}"
-MAMBA_ROOT_PREFIX="${MINIFORGE_HOME}-micromamba-$(date +%s)"
-echo "Downloading micromamba ${MICROMAMBA_VERSION}"
-micromamba_exe="$(mktemp -d)/micromamba"
-curl -L -o "${micromamba_exe}" "${MICROMAMBA_URL}"
-chmod +x "${micromamba_exe}"
+sed -i.bak "s/platforms = .*/platforms = [\"osx-${arch}\"]/" pixi.toml
 echo "Creating environment"
-"${micromamba_exe}" create --yes --root-prefix "${MAMBA_ROOT_PREFIX}" --prefix "${MINIFORGE_HOME}" \
-  --channel conda-forge \
-  pip python=3.12 conda-build conda-forge-ci-setup=4 "conda-build>=24.1"
-echo "Moving pkgs cache from ${MAMBA_ROOT_PREFIX} to ${MINIFORGE_HOME}"
-mv "${MAMBA_ROOT_PREFIX}/pkgs" "${MINIFORGE_HOME}"
-echo "Cleaning up micromamba"
-rm -rf "${MAMBA_ROOT_PREFIX}" "${micromamba_exe}" || true
-( endgroup "Provisioning base env with micromamba" ) 2> /dev/null
+pixi install
+pixi list
+echo "Activating environment"
+eval "$(pixi shell-hook)"
+mv pixi.toml.bak pixi.toml
+( endgroup "Provisioning base env with pixi" ) 2> /dev/null
 
 ( startgroup "Configuring conda" ) 2> /dev/null
-echo "Activating environment"
-source "${MINIFORGE_HOME}/etc/profile.d/conda.sh"
-conda activate base
 export CONDA_SOLVER="libmamba"
 export CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1
 
@@ -70,33 +60,25 @@ source run_conda_forge_build_setup
 
 ( endgroup "Configuring conda" ) 2> /dev/null
 
-echo -e "\n\nMaking the build clobber file"
-make_build_number ./ ./recipe ./.ci_support/${CONFIG}.yaml
-
 if [[ -f LICENSE.txt ]]; then
   cp LICENSE.txt "recipe/recipe-scripts-license.txt"
 fi
 
 if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then
-    if [[ "x${BUILD_OUTPUT_ID:-}" != "x" ]]; then
-        EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --output-id ${BUILD_OUTPUT_ID}"
-    fi
-    conda debug ./recipe -m ./.ci_support/${CONFIG}.yaml \
-        ${EXTRA_CB_OPTIONS:-} \
-        --clobber-file ./.ci_support/clobber_${CONFIG}.yaml
-
-    # Drop into an interactive shell
-    /bin/bash
+    echo "rattler-build does not currently support debug mode"
 else
 
     if [[ "${HOST_PLATFORM}" != "${BUILD_PLATFORM}" ]]; then
-        EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --no-test"
+        EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --test skip"
     fi
 
-    conda-build ./recipe -m ./.ci_support/${CONFIG}.yaml \
-        --suppress-variables ${EXTRA_CB_OPTIONS:-} \
-        --clobber-file ./.ci_support/clobber_${CONFIG}.yaml \
-        --extra-meta flow_run_id="$flow_run_id" remote_url="$remote_url" sha="$sha"
+    rattler-build build --recipe ./recipe \
+        -m ./.ci_support/${CONFIG}.yaml \
+        ${EXTRA_CB_OPTIONS:-} \
+        --target-platform "${HOST_PLATFORM}" \
+        --extra-meta flow_run_id="$flow_run_id" \
+        --extra-meta remote_url="$remote_url" \
+        --extra-meta sha="$sha"
 
     ( startgroup "Inspecting artifacts" ) 2> /dev/null
 
diff --git a/README.md b/README.md
index a4bb6af..eb8a9fa 100644
--- a/README.md
+++ b/README.md
@@ -18,7 +18,6 @@ CMS experiment. Note that while this tool was originally developed in the Higgs
 is now widespread within CMS. Combine provides a command-line interface to many different statistical
 techniques, available inside RooFit/RooStats, that are used widely inside CMS.
 
-
 Current build status
 ====================
 
@@ -334,5 +333,6 @@ Feedstock Maintainers
 =====================
 
 * [@anigamova](https://github.com/anigamova/)
+* [@kcormi](https://github.com/kcormi/)
 * [@nsmith-](https://github.com/nsmith-/)
 
diff --git a/conda-forge.yml b/conda-forge.yml
index 683ad2c..f1e4ab6 100644
--- a/conda-forge.yml
+++ b/conda-forge.yml
@@ -2,7 +2,9 @@ build_platform:
   osx_arm64: osx_64
 conda_build:
   error_overlinking: true
+conda_build_tool: rattler-build
 conda_forge_output_validation: true
+conda_install_tool: pixi
 github:
   branch_name: main
   tooling_branch_name: main
diff --git a/pixi.toml b/pixi.toml
new file mode 100644
index 0000000..d01c4d5
--- /dev/null
+++ b/pixi.toml
@@ -0,0 +1,80 @@
+# This file was generated automatically from conda-smithy. To update this configuration,
+# update the conda-forge.yml and/or the recipe/meta.yaml.
+# -*- mode: toml -*-
+
+[project]
+name = "cms-combine-feedstock"
+version = "3.46.1"
+description = "Pixi configuration for conda-forge/cms-combine-feedstock"
+authors = ["@conda-forge/cms-combine"]
+channels = ["conda-forge"]
+platforms = ["linux-64", "osx-64", "win-64"]
+
+[dependencies]
+conda-build = ">=24.1"
+conda-forge-ci-setup = "4.*"
+rattler-build = "*"
+
+[tasks]
+inspect-all = "inspect_artifacts --all-packages"
+build = "rattler-build build --recipe recipe"
+"build-linux_64_python3.10.____cpythonroot_base6.32.10" = "rattler-build build --recipe recipe -m .ci_support/linux_64_python3.10.____cpythonroot_base6.32.10.yaml"
+"inspect-linux_64_python3.10.____cpythonroot_base6.32.10" = "inspect_artifacts --recipe-dir recipe -m .ci_support/linux_64_python3.10.____cpythonroot_base6.32.10.yaml"
+"build-linux_64_python3.10.____cpythonroot_base6.34.4" = "rattler-build build --recipe recipe -m .ci_support/linux_64_python3.10.____cpythonroot_base6.34.4.yaml"
+"inspect-linux_64_python3.10.____cpythonroot_base6.34.4" = "inspect_artifacts --recipe-dir recipe -m .ci_support/linux_64_python3.10.____cpythonroot_base6.34.4.yaml"
+"build-linux_64_python3.11.____cpythonroot_base6.32.10" = "rattler-build build --recipe recipe -m .ci_support/linux_64_python3.11.____cpythonroot_base6.32.10.yaml"
+"inspect-linux_64_python3.11.____cpythonroot_base6.32.10" = "inspect_artifacts --recipe-dir recipe -m .ci_support/linux_64_python3.11.____cpythonroot_base6.32.10.yaml"
+"build-linux_64_python3.11.____cpythonroot_base6.34.4" = "rattler-build build --recipe recipe -m .ci_support/linux_64_python3.11.____cpythonroot_base6.34.4.yaml"
+"inspect-linux_64_python3.11.____cpythonroot_base6.34.4" = "inspect_artifacts --recipe-dir recipe -m .ci_support/linux_64_python3.11.____cpythonroot_base6.34.4.yaml"
+"build-linux_64_python3.12.____cpythonroot_base6.32.10" = "rattler-build build --recipe recipe -m .ci_support/linux_64_python3.12.____cpythonroot_base6.32.10.yaml"
+"inspect-linux_64_python3.12.____cpythonroot_base6.32.10" = "inspect_artifacts --recipe-dir recipe -m .ci_support/linux_64_python3.12.____cpythonroot_base6.32.10.yaml"
+"build-linux_64_python3.12.____cpythonroot_base6.34.4" = "rattler-build build --recipe recipe -m .ci_support/linux_64_python3.12.____cpythonroot_base6.34.4.yaml"
+"inspect-linux_64_python3.12.____cpythonroot_base6.34.4" = "inspect_artifacts --recipe-dir recipe -m .ci_support/linux_64_python3.12.____cpythonroot_base6.34.4.yaml"
+"build-linux_64_python3.9.____cpythonroot_base6.32.10" = "rattler-build build --recipe recipe -m .ci_support/linux_64_python3.9.____cpythonroot_base6.32.10.yaml"
+"inspect-linux_64_python3.9.____cpythonroot_base6.32.10" = "inspect_artifacts --recipe-dir recipe -m .ci_support/linux_64_python3.9.____cpythonroot_base6.32.10.yaml"
+"build-linux_64_python3.9.____cpythonroot_base6.34.4" = "rattler-build build --recipe recipe -m .ci_support/linux_64_python3.9.____cpythonroot_base6.34.4.yaml"
+"inspect-linux_64_python3.9.____cpythonroot_base6.34.4" = "inspect_artifacts --recipe-dir recipe -m .ci_support/linux_64_python3.9.____cpythonroot_base6.34.4.yaml"
+"build-osx_64_python3.10.____cpythonroot_base6.32.10" = "rattler-build build --recipe recipe -m .ci_support/osx_64_python3.10.____cpythonroot_base6.32.10.yaml"
+"inspect-osx_64_python3.10.____cpythonroot_base6.32.10" = "inspect_artifacts --recipe-dir recipe -m .ci_support/osx_64_python3.10.____cpythonroot_base6.32.10.yaml"
+"build-osx_64_python3.10.____cpythonroot_base6.34.4" = "rattler-build build --recipe recipe -m .ci_support/osx_64_python3.10.____cpythonroot_base6.34.4.yaml"
+"inspect-osx_64_python3.10.____cpythonroot_base6.34.4" = "inspect_artifacts --recipe-dir recipe -m .ci_support/osx_64_python3.10.____cpythonroot_base6.34.4.yaml"
+"build-osx_64_python3.11.____cpythonroot_base6.32.10" = "rattler-build build --recipe recipe -m .ci_support/osx_64_python3.11.____cpythonroot_base6.32.10.yaml"
+"inspect-osx_64_python3.11.____cpythonroot_base6.32.10" = "inspect_artifacts --recipe-dir recipe -m .ci_support/osx_64_python3.11.____cpythonroot_base6.32.10.yaml"
+"build-osx_64_python3.11.____cpythonroot_base6.34.4" = "rattler-build build --recipe recipe -m .ci_support/osx_64_python3.11.____cpythonroot_base6.34.4.yaml"
+"inspect-osx_64_python3.11.____cpythonroot_base6.34.4" = "inspect_artifacts --recipe-dir recipe -m .ci_support/osx_64_python3.11.____cpythonroot_base6.34.4.yaml"
+"build-osx_64_python3.12.____cpythonroot_base6.32.10" = "rattler-build build --recipe recipe -m .ci_support/osx_64_python3.12.____cpythonroot_base6.32.10.yaml"
+"inspect-osx_64_python3.12.____cpythonroot_base6.32.10" = "inspect_artifacts --recipe-dir recipe -m .ci_support/osx_64_python3.12.____cpythonroot_base6.32.10.yaml"
+"build-osx_64_python3.12.____cpythonroot_base6.34.4" = "rattler-build build --recipe recipe -m .ci_support/osx_64_python3.12.____cpythonroot_base6.34.4.yaml"
+"inspect-osx_64_python3.12.____cpythonroot_base6.34.4" = "inspect_artifacts --recipe-dir recipe -m .ci_support/osx_64_python3.12.____cpythonroot_base6.34.4.yaml"
+"build-osx_64_python3.9.____cpythonroot_base6.32.10" = "rattler-build build --recipe recipe -m .ci_support/osx_64_python3.9.____cpythonroot_base6.32.10.yaml"
+"inspect-osx_64_python3.9.____cpythonroot_base6.32.10" = "inspect_artifacts --recipe-dir recipe -m .ci_support/osx_64_python3.9.____cpythonroot_base6.32.10.yaml"
+"build-osx_64_python3.9.____cpythonroot_base6.34.4" = "rattler-build build --recipe recipe -m .ci_support/osx_64_python3.9.____cpythonroot_base6.34.4.yaml"
+"inspect-osx_64_python3.9.____cpythonroot_base6.34.4" = "inspect_artifacts --recipe-dir recipe -m .ci_support/osx_64_python3.9.____cpythonroot_base6.34.4.yaml"
+"build-osx_arm64_python3.10.____cpythonroot_base6.32.10" = "rattler-build build --recipe recipe -m .ci_support/osx_arm64_python3.10.____cpythonroot_base6.32.10.yaml"
+"inspect-osx_arm64_python3.10.____cpythonroot_base6.32.10" = "inspect_artifacts --recipe-dir recipe -m .ci_support/osx_arm64_python3.10.____cpythonroot_base6.32.10.yaml"
+"build-osx_arm64_python3.10.____cpythonroot_base6.34.4" = "rattler-build build --recipe recipe -m .ci_support/osx_arm64_python3.10.____cpythonroot_base6.34.4.yaml"
+"inspect-osx_arm64_python3.10.____cpythonroot_base6.34.4" = "inspect_artifacts --recipe-dir recipe -m .ci_support/osx_arm64_python3.10.____cpythonroot_base6.34.4.yaml"
+"build-osx_arm64_python3.11.____cpythonroot_base6.32.10" = "rattler-build build --recipe recipe -m .ci_support/osx_arm64_python3.11.____cpythonroot_base6.32.10.yaml"
+"inspect-osx_arm64_python3.11.____cpythonroot_base6.32.10" = "inspect_artifacts --recipe-dir recipe -m .ci_support/osx_arm64_python3.11.____cpythonroot_base6.32.10.yaml"
+"build-osx_arm64_python3.11.____cpythonroot_base6.34.4" = "rattler-build build --recipe recipe -m .ci_support/osx_arm64_python3.11.____cpythonroot_base6.34.4.yaml"
+"inspect-osx_arm64_python3.11.____cpythonroot_base6.34.4" = "inspect_artifacts --recipe-dir recipe -m .ci_support/osx_arm64_python3.11.____cpythonroot_base6.34.4.yaml"
+"build-osx_arm64_python3.12.____cpythonroot_base6.32.10" = "rattler-build build --recipe recipe -m .ci_support/osx_arm64_python3.12.____cpythonroot_base6.32.10.yaml"
+"inspect-osx_arm64_python3.12.____cpythonroot_base6.32.10" = "inspect_artifacts --recipe-dir recipe -m .ci_support/osx_arm64_python3.12.____cpythonroot_base6.32.10.yaml"
+"build-osx_arm64_python3.12.____cpythonroot_base6.34.4" = "rattler-build build --recipe recipe -m .ci_support/osx_arm64_python3.12.____cpythonroot_base6.34.4.yaml"
+"inspect-osx_arm64_python3.12.____cpythonroot_base6.34.4" = "inspect_artifacts --recipe-dir recipe -m .ci_support/osx_arm64_python3.12.____cpythonroot_base6.34.4.yaml"
+"build-osx_arm64_python3.9.____cpythonroot_base6.32.10" = "rattler-build build --recipe recipe -m .ci_support/osx_arm64_python3.9.____cpythonroot_base6.32.10.yaml"
+"inspect-osx_arm64_python3.9.____cpythonroot_base6.32.10" = "inspect_artifacts --recipe-dir recipe -m .ci_support/osx_arm64_python3.9.____cpythonroot_base6.32.10.yaml"
+"build-osx_arm64_python3.9.____cpythonroot_base6.34.4" = "rattler-build build --recipe recipe -m .ci_support/osx_arm64_python3.9.____cpythonroot_base6.34.4.yaml"
+"inspect-osx_arm64_python3.9.____cpythonroot_base6.34.4" = "inspect_artifacts --recipe-dir recipe -m .ci_support/osx_arm64_python3.9.____cpythonroot_base6.34.4.yaml"
+
+[feature.smithy.dependencies]
+conda-smithy = "*"
+
+[feature.smithy.tasks]
+build-locally = "python ./build-locally.py"
+smithy = "conda-smithy"
+rerender = "conda-smithy rerender"
+lint = "conda-smithy lint recipe"
+
+[environments]
+smithy = ["smithy"]
diff --git a/recipe/cmake_installpython.patch b/recipe/cmake_installpython.patch
index 4516946..bc67036 100644
--- a/recipe/cmake_installpython.patch
+++ b/recipe/cmake_installpython.patch
@@ -1,3 +1,22 @@
+From 422f34c7ae42264ad64c12c88ba1838be4530290 Mon Sep 17 00:00:00 2001
+From: Nick Smith <nick.smith@cern.ch>
+Date: Sun, 2 Mar 2025 10:09:28 -0600
+Subject: [PATCH] Improve CMakeList for use with conda packaging
+
+Basically allow to manually specify Python_SITELIB
+and don't mess with the path discovery for ROOT
+
+* Cherry-picked with fixes from
+  https://github.com/cms-analysis/HiggsAnalysis-CombinedLimit/pull/1053
+  to be backported to patch the v10.1.0.
+---
+ CMakeLists.txt              | 45 +++++++++++++------------------------
+ scripts/plotBSMxsBRLimit.py |  0
+ scripts/pruneUncerts.py     |  0
+ 3 files changed, 16 insertions(+), 29 deletions(-)
+ mode change 100644 => 100755 scripts/plotBSMxsBRLimit.py
+ mode change 100644 => 100755 scripts/pruneUncerts.py
+
 diff --git a/CMakeLists.txt b/CMakeLists.txt
 index 62560456..91cc921f 100644
 --- a/CMakeLists.txt
@@ -82,3 +101,6 @@ new mode 100755
 diff --git a/scripts/pruneUncerts.py b/scripts/pruneUncerts.py
 old mode 100644
 new mode 100755
+-- 
+2.48.1
+
diff --git a/recipe/meta.yaml b/recipe/meta.yaml
deleted file mode 100644
index db979cb..0000000
--- a/recipe/meta.yaml
+++ /dev/null
@@ -1,72 +0,0 @@
-{% set name = "cms-combine" %}
-{% set version = "10.1.0" %}
-
-package:
-  name: {{ name|lower }}
-  version: {{ version }}
-
-source:
-  url: https://github.com/cms-analysis/HiggsAnalysis-CombinedLimit/archive/refs/tags/v{{ version }}.tar.gz
-  sha256: f198eaf93fbfef472ebf648ccba1bbc199ae9b415c16e7a4c7f6f5c8b9683550
-  folder: HiggsAnalysis/CombinedLimit
-  patches:
-    - clang_warnings.patch
-    - cmake_installpython.patch
-
-build:
-  number: 0
-  skip: true  # [win]
-  ignore_run_exports:
-    - python
-    - gsl
-
-requirements:
-  build:
-    - python                                 # [build_platform != target_platform]
-    - cross-python_{{ target_platform }}     # [build_platform != target_platform]
-    - root_base                              # [build_platform != target_platform]
-    - {{ stdlib('c') }}
-    - {{ compiler('cxx') }}
-    - cmake
-    - make
-  host:
-    - python
-    - root_base
-    - libboost-devel
-    - eigen
-    - vdt
-
-  run:
-    - python
-    - pandas
-    - six
-    - gsl
-
-test:
-  source_files:
-    - HiggsAnalysis/CombinedLimit/data/tutorials/multiDim/
-    - HiggsAnalysis/CombinedLimit/data/tutorials/CAT23001/
-  imports:
-    - HiggsAnalysis.CombinedLimit.PhysicsModel
-  commands:
-    - combine -h
-    - text2workspace.py -h
-
-about:
-  home: https://cms-analysis.github.io/HiggsAnalysis-CombinedLimit/
-  summary: 'A software tool used for statistical analysis within the CMS experiment'
-  description: |
-    Combine is a RooStats / RooFit - based software tool used for statistical analysis within the
-    CMS experiment. Note that while this tool was originally developed in the Higgs PAG, its usage
-    is now widespread within CMS. Combine provides a command-line interface to many different statistical
-    techniques, available inside RooFit/RooStats, that are used widely inside CMS.
-  license: Apache-2.0
-  license_family: Apache
-  license_file: HiggsAnalysis/CombinedLimit/LICENSE
-  doc_url: https://cms-analysis.github.io/HiggsAnalysis-CombinedLimit/
-  dev_url: https://github.com/cms-analysis/HiggsAnalysis-CombinedLimit
-
-extra:
-  recipe-maintainers:
-    - nsmith-
-    - anigamova
diff --git a/recipe/recipe.yaml b/recipe/recipe.yaml
new file mode 100644
index 0000000..a42c82e
--- /dev/null
+++ b/recipe/recipe.yaml
@@ -0,0 +1,79 @@
+schema_version: 1
+
+context:
+  name: cms-combine
+  version: 10.1.0
+
+package:
+  name: ${{ name|lower }}
+  version: ${{ version }}
+
+source:
+  url: https://github.com/cms-analysis/HiggsAnalysis-CombinedLimit/archive/refs/tags/v${{ version }}.tar.gz
+  sha256: f198eaf93fbfef472ebf648ccba1bbc199ae9b415c16e7a4c7f6f5c8b9683550
+  target_directory: HiggsAnalysis/CombinedLimit
+  patches:
+    - clang_warnings.patch
+    # Backport PR https://github.com/cms-analysis/HiggsAnalysis-CombinedLimit/pull/1053
+    # with fixes.
+    # Can be removed after tag v10.1.0
+    - cmake_installpython.patch
+
+build:
+  number: 1
+  skip: win
+
+requirements:
+  build:
+    - if: build_platform != target_platform
+      then: python
+    - if: build_platform != target_platform
+      then: cross-python_${{ target_platform }}
+    - if: build_platform != target_platform
+      then: root_base
+    - ${{ stdlib('c') }}
+    - ${{ compiler('cxx') }}
+    - cmake
+    - make
+  host:
+    - python
+    - root_base
+    - libboost-devel
+    - eigen
+    - vdt
+  run:
+    - python
+    - pandas
+    - six
+    - gsl
+
+tests:
+  - python:
+      imports:
+        - HiggsAnalysis.CombinedLimit.PhysicsModel
+  - files:
+      source:
+        - HiggsAnalysis/CombinedLimit/data/tutorials/multiDim/
+        - HiggsAnalysis/CombinedLimit/data/tutorials/CAT23001/
+    script:
+      - combine -h
+      - text2workspace.py -h
+
+about:
+  summary: A software tool used for statistical analysis within the CMS experiment
+  description: |
+    Combine is a RooStats / RooFit - based software tool used for statistical analysis within the
+    CMS experiment. Note that while this tool was originally developed in the Higgs PAG, its usage
+    is now widespread within CMS. Combine provides a command-line interface to many different statistical
+    techniques, available inside RooFit/RooStats, that are used widely inside CMS.
+  license: Apache-2.0
+  license_file: HiggsAnalysis/CombinedLimit/LICENSE
+  homepage: https://cms-analysis.github.io/HiggsAnalysis-CombinedLimit/
+  repository: https://github.com/cms-analysis/HiggsAnalysis-CombinedLimit
+  documentation: https://cms-analysis.github.io/HiggsAnalysis-CombinedLimit/
+
+extra:
+  recipe-maintainers:
+    - nsmith-
+    - anigamova
+    - kcormi


Reviews:
user: login: matthewfeickert
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-06T15:08:56Z
user: login: matthewfeickert
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-06T15:11:10Z
user: login: nsmith-
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-06T15:24:13Z
user: login: matthewfeickert
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-06T15:28:14Z
user: login: matthewfeickert
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-06T16:04:00Z
user: login: matthewfeickert
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-06T16:39:25Z
user: login: matthewfeickert
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-07T16:24:20Z
user: login: nsmith-
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-03-07T16:34:53Z

Review comments:
diff_hunk: @@ -76,9 +76,3 @@ index 62560456..91cc921f 100644
    file(TOUCH ${empty_init_py})
    INSTALL(FILES ${empty_init_py} DESTINATION ${Python_SITELIB_IN_PREFIX}/HiggsAnalysis)
    INSTALL(FILES ${empty_init_py} DESTINATION ${Python_SITELIB_IN_PREFIX}/HiggsAnalysis/CombinedLimit)
-diff --git a/scripts/plotBSMxsBRLimit.py b/scripts/plotBSMxsBRLimit.py
-old mode 100644
-new mode 100755
-diff --git a/scripts/pruneUncerts.py b/scripts/pruneUncerts.py
-old mode 100644
-new mode 100755
path: recipe/cmake_installpython.patch
user: login: matthewfeickert
body: > > Remove permission changes in cmake_installpython.patch as they are not required.
> 
> Why do you say that? These are executable scripts

@nsmith- Ah, I see now. These are changed in the upstream HEAD as of https://github.com/cms-analysis/HiggsAnalysis-CombinedLimit/pull/1053

```
$ ls -lhtra scripts/plotBSMxsBRLimit.py 
-rwxrwxr-x 1 feickert feickert 6.2K Mar  6 07:59 scripts/plotBSMxsBRLimit.py
```

but not at at the current `v10.1.0` tag https://github.com/cms-analysis/HiggsAnalysis-CombinedLimit/tree/1cd275fe12f54ffbf0ed2d44e3dae66595572212/scripts

```
$ ls -lhtra scripts/plotBSMxsBRLimit.py 
-rw-rw-r-- 1 feickert feickert 6.2K Mar  6 08:05 scripts/plotBSMxsBRLimit.py
```

I'll need to put this into draft and debug things then, and possibly report issues with `rattler-build` as building with these patches as is results in

```
╭─ Running build for recipe: cms-combine-10.1.0-py312h61635c1_1
 │
 │ ╭─ Fetching source code
 │ │ Fetching source from url: https://github.com/cms-analysis/HiggsAnalysis-CombinedLimit/archive/refs/tags/v10.1.0.tar.gz
 │ │ Validated SHA256 values of the downloaded file!
 │ │ Found valid source cache file.
 │ │ Using extracted directory from cache: /home/conda/feedstock_root/build_artifacts/src_cache/v10_1_0_f198eaf9
 │ │ Copying source from url: /home/conda/feedstock_root/build_artifacts/src_cache/v10_1_0_f198eaf9 to /home/conda/feedstock_root/build_artifacts/bld/rattler-build_cms-combine_1741272935/work/HiggsAnalysi
 │ │ s/CombinedLimit
thread 'main' panicked at /home/conda/feedstock_root/build_artifacts/bld/rattler-build_rattler-build_1741203078/build_env/.cargo/registry/src/index.crates.io-6f17d22bba15001f/patch-0.7.0/src/parser.rs:84:5:
bug: failed to parse entire input. Remaining: 'diff --git a/scripts/plotBSMxsBRLimit.py b/scripts/plotBSMxsBRLimit.py
old mode 100644
new mode 100755
diff --git a/scripts/pruneUncerts.py b/scripts/pruneUncerts.py
old mode 100644
new mode 100755
'
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 │ │
 │ ╰─────────────────── (took 0 seconds)
 │
 ╰─────────────────── (took 0 seconds)
```
created_at: 2025-03-06T15:08:56Z
author_association: MEMBER
diff_hunk: @@ -76,9 +76,3 @@ index 62560456..91cc921f 100644
    file(TOUCH ${empty_init_py})
    INSTALL(FILES ${empty_init_py} DESTINATION ${Python_SITELIB_IN_PREFIX}/HiggsAnalysis)
    INSTALL(FILES ${empty_init_py} DESTINATION ${Python_SITELIB_IN_PREFIX}/HiggsAnalysis/CombinedLimit)
-diff --git a/scripts/plotBSMxsBRLimit.py b/scripts/plotBSMxsBRLimit.py
-old mode 100644
-new mode 100755
-diff --git a/scripts/pruneUncerts.py b/scripts/pruneUncerts.py
-old mode 100644
-new mode 100755
path: recipe/cmake_installpython.patch
user: login: matthewfeickert
body: > These are executable scripts

Why are these not under `bin` then?
created_at: 2025-03-06T15:11:09Z
author_association: MEMBER
diff_hunk: @@ -76,9 +76,3 @@ index 62560456..91cc921f 100644
    file(TOUCH ${empty_init_py})
    INSTALL(FILES ${empty_init_py} DESTINATION ${Python_SITELIB_IN_PREFIX}/HiggsAnalysis)
    INSTALL(FILES ${empty_init_py} DESTINATION ${Python_SITELIB_IN_PREFIX}/HiggsAnalysis/CombinedLimit)
-diff --git a/scripts/plotBSMxsBRLimit.py b/scripts/plotBSMxsBRLimit.py
-old mode 100644
-new mode 100755
-diff --git a/scripts/pruneUncerts.py b/scripts/pruneUncerts.py
-old mode 100644
-new mode 100755
path: recipe/cmake_installpython.patch
user: login: nsmith-
body: Ah ok, I'm curious why rattler doesn't support all patch features.
created_at: 2025-03-06T15:24:12Z
author_association: CONTRIBUTOR
diff_hunk: @@ -76,9 +76,3 @@ index 62560456..91cc921f 100644
    file(TOUCH ${empty_init_py})
    INSTALL(FILES ${empty_init_py} DESTINATION ${Python_SITELIB_IN_PREFIX}/HiggsAnalysis)
    INSTALL(FILES ${empty_init_py} DESTINATION ${Python_SITELIB_IN_PREFIX}/HiggsAnalysis/CombinedLimit)
-diff --git a/scripts/plotBSMxsBRLimit.py b/scripts/plotBSMxsBRLimit.py
-old mode 100644
-new mode 100755
-diff --git a/scripts/pruneUncerts.py b/scripts/pruneUncerts.py
-old mode 100644
-new mode 100755
path: recipe/cmake_installpython.patch
user: login: matthewfeickert
body: Ah. I see the problem now (I think). You didn't create a proper Git patch, you just included the diff.
created_at: 2025-03-06T15:28:14Z
author_association: MEMBER
diff_hunk: @@ -76,9 +76,3 @@ index 62560456..91cc921f 100644
    file(TOUCH ${empty_init_py})
    INSTALL(FILES ${empty_init_py} DESTINATION ${Python_SITELIB_IN_PREFIX}/HiggsAnalysis)
    INSTALL(FILES ${empty_init_py} DESTINATION ${Python_SITELIB_IN_PREFIX}/HiggsAnalysis/CombinedLimit)
-diff --git a/scripts/plotBSMxsBRLimit.py b/scripts/plotBSMxsBRLimit.py
-old mode 100644
-new mode 100755
-diff --git a/scripts/pruneUncerts.py b/scripts/pruneUncerts.py
-old mode 100644
-new mode 100755
path: recipe/cmake_installpython.patch
user: login: matthewfeickert
body: It does. It just expects actual patches, not diffs, and tries to work around it if it only gets a diff.

I'll still report this though.
created_at: 2025-03-06T16:04:00Z
author_association: MEMBER
diff_hunk: @@ -76,9 +76,3 @@ index 62560456..91cc921f 100644
    file(TOUCH ${empty_init_py})
    INSTALL(FILES ${empty_init_py} DESTINATION ${Python_SITELIB_IN_PREFIX}/HiggsAnalysis)
    INSTALL(FILES ${empty_init_py} DESTINATION ${Python_SITELIB_IN_PREFIX}/HiggsAnalysis/CombinedLimit)
-diff --git a/scripts/plotBSMxsBRLimit.py b/scripts/plotBSMxsBRLimit.py
-old mode 100644
-new mode 100755
-diff --git a/scripts/pruneUncerts.py b/scripts/pruneUncerts.py
-old mode 100644
-new mode 100755
path: recipe/cmake_installpython.patch
user: login: matthewfeickert
body: Follow up discussion is at https://github.com/prefix-dev/rattler-build/discussions/1473.
created_at: 2025-03-06T16:39:25Z
author_association: MEMBER
diff_hunk: @@ -76,9 +76,3 @@ index 62560456..91cc921f 100644
    file(TOUCH ${empty_init_py})
    INSTALL(FILES ${empty_init_py} DESTINATION ${Python_SITELIB_IN_PREFIX}/HiggsAnalysis)
    INSTALL(FILES ${empty_init_py} DESTINATION ${Python_SITELIB_IN_PREFIX}/HiggsAnalysis/CombinedLimit)
-diff --git a/scripts/plotBSMxsBRLimit.py b/scripts/plotBSMxsBRLimit.py
-old mode 100644
-new mode 100755
-diff --git a/scripts/pruneUncerts.py b/scripts/pruneUncerts.py
-old mode 100644
-new mode 100755
path: recipe/cmake_installpython.patch
user: login: matthewfeickert
body: Summary: `rattler-build` is intentionally much more strict about patches.
created_at: 2025-03-07T16:24:20Z
author_association: MEMBER

PR comments:
user: login: matthewfeickert
created_at: 2025-03-06T08:00:23Z
body: @conda-forge-admin, please rerender
author_association: MEMBER
user: login: conda-forge-admin
created_at: 2025-03-06T08:01:37Z
body: Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (```recipe/recipe.yaml```) and found it was in an excellent condition.

author_association: CONTRIBUTOR
user: login: conda-forge-admin
created_at: 2025-03-06T08:04:59Z
body: Hi! This is the friendly automated conda-forge-webservice.

I tried to rerender for you, but it looks like there was nothing to do.


<sub>This message was generated by GitHub Actions workflow run [https://github.com/conda-forge/conda-forge-webservices/actions/runs/13693920870](https://github.com/conda-forge/conda-forge-webservices/actions/runs/13693920870). Examine the logs at this URL for more detail.</sub>

author_association: CONTRIBUTOR
user: login: matthewfeickert
created_at: 2025-03-06T08:51:24Z
body: @conda-forge/cms-combine This is ready for review. Let me know if you have any questions.
author_association: MEMBER
user: login: nsmith-
created_at: 2025-03-06T14:29:51Z
body: > Remove permission changes in cmake_installpython.patch as they are not required.

Why do you say that? These are executable scripts
author_association: CONTRIBUTOR
user: login: matthewfeickert
created_at: 2025-03-06T16:03:02Z
body: @conda-forge-admin, please rerender
author_association: MEMBER
user: login: matthewfeickert
created_at: 2025-03-06T16:05:06Z
body: @conda-forge/cms-combine This should be ready for review again.
author_association: MEMBER
user: login: conda-forge-admin
created_at: 2025-03-06T16:06:11Z
body: Hi! This is the friendly automated conda-forge-webservice.

I tried to rerender for you, but it looks like there was nothing to do.


<sub>This message was generated by GitHub Actions workflow run [https://github.com/conda-forge/conda-forge-webservices/actions/runs/13702937500](https://github.com/conda-forge/conda-forge-webservices/actions/runs/13702937500). Examine the logs at this URL for more detail.</sub>

author_association: CONTRIBUTOR