From 687afd23bcd3655da0fbdf8dc66161d99adb6658 Mon Sep 17 00:00:00 2001
From: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Date: Wed, 25 Dec 2024 02:06:21 +0100
Subject: [PATCH] Add pip wheel build constraints to fix numpy builds (#133962)

---
 .github/workflows/wheels.yml | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml
index 9ea9a557105..cae34b41b56 100644
--- a/.github/workflows/wheels.yml
+++ b/.github/workflows/wheels.yml
@@ -76,8 +76,20 @@ jobs:
 
             # Use C-Extension for SQLAlchemy
             echo "REQUIRE_SQLALCHEMY_CEXT=1"
+
+            # Add additional pip wheel build constraints
+            echo "PIP_CONSTRAINT=build_constraints.txt"
           ) > .env_file
 
+      - name: Write pip wheel build constraints
+        run: |
+          (
+            # ninja 1.11.1.2 + 1.11.1.3 seem to be broken on at least armhf
+            # this caused the numpy builds to fail
+            # https://github.com/scikit-build/ninja-python-distributions/issues/274
+            echo "ninja==1.11.1.1"
+          ) > build_constraints.txt
+
       - name: Upload env_file
         uses: actions/upload-artifact@v4.5.0
         with:
@@ -86,6 +98,13 @@ jobs:
           include-hidden-files: true
           overwrite: true
 
+      - name: Upload build_constraints
+        uses: actions/upload-artifact@v4.5.0
+        with:
+          name: build_constraints
+          path: ./build_constraints.txt
+          overwrite: true
+
       - name: Upload requirements_diff
         uses: actions/upload-artifact@v4.5.0
         with:
@@ -123,6 +142,11 @@ jobs:
         with:
           name: env_file
 
+      - name: Download build_constraints
+        uses: actions/download-artifact@v4.1.8
+        with:
+          name: build_constraints
+
       - name: Download requirements_diff
         uses: actions/download-artifact@v4.1.8
         with:
@@ -167,6 +191,11 @@ jobs:
         with:
           name: env_file
 
+      - name: Download build_constraints
+        uses: actions/download-artifact@v4.1.8
+        with:
+          name: build_constraints
+
       - name: Download requirements_diff
         uses: actions/download-artifact@v4.1.8
         with:
-- 
GitLab