From 5662135cf06b34242dda3c99c368a6347e32d76f Mon Sep 17 00:00:00 2001 From: swap357 Date: Thu, 6 Mar 2025 20:14:40 -0800 Subject: [PATCH 01/14] disable CPU-specific test flag in build script --- conda-recipes/llvmdev/build.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/conda-recipes/llvmdev/build.sh b/conda-recipes/llvmdev/build.sh index e1adebd59..6cd5d8ad1 100644 --- a/conda-recipes/llvmdev/build.sh +++ b/conda-recipes/llvmdev/build.sh @@ -78,11 +78,11 @@ ninja -j${CPU_COUNT} ninja install -if [[ "${target_platform}" == "linux-64" || "${target_platform}" == "osx-64" ]]; then - export TEST_CPU_FLAG="-mcpu=haswell" -else - export TEST_CPU_FLAG="" -fi +# if [[ "${target_platform}" == "linux-64" || "${target_platform}" == "osx-64" ]]; then +# export TEST_CPU_FLAG="-mcpu=haswell" +# else +# export TEST_CPU_FLAG="" +# fi if [[ "$CONDA_BUILD_CROSS_COMPILATION" != "1" ]]; then From 83bc4ca2b7148fb955d31a0defa6a4347d0048be Mon Sep 17 00:00:00 2001 From: swap357 Date: Thu, 6 Mar 2025 20:52:19 -0800 Subject: [PATCH 02/14] comment out CPU-specific test flag config from wheel recipe --- conda-recipes/llvmdev_for_wheel/build.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/conda-recipes/llvmdev_for_wheel/build.sh b/conda-recipes/llvmdev_for_wheel/build.sh index f39a8991b..486995a58 100644 --- a/conda-recipes/llvmdev_for_wheel/build.sh +++ b/conda-recipes/llvmdev_for_wheel/build.sh @@ -83,11 +83,11 @@ ninja -j${CPU_COUNT} ninja install -if [[ "${target_platform}" == "linux-64" || "${target_platform}" == "osx-64" ]]; then - export TEST_CPU_FLAG="-mcpu=haswell" -else - export TEST_CPU_FLAG="" -fi +# if [[ "${target_platform}" == "linux-64" || "${target_platform}" == "osx-64" ]]; then +# export TEST_CPU_FLAG="-mcpu=haswell" +# else +# export TEST_CPU_FLAG="" +# fi if [[ "$CONDA_BUILD_CROSS_COMPILATION" != "1" ]]; then From 378764e8b1c013521aafcdf2f77e9e1f71b4d9bc Mon Sep 17 00:00:00 2001 From: swap357 Date: Thu, 6 Mar 2025 23:59:04 -0800 Subject: [PATCH 03/14] add macos sdk download and config for conda build --- conda-recipes/llvmdev/build.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/conda-recipes/llvmdev/build.sh b/conda-recipes/llvmdev/build.sh index 6cd5d8ad1..9131f9e99 100644 --- a/conda-recipes/llvmdev/build.sh +++ b/conda-recipes/llvmdev/build.sh @@ -84,6 +84,16 @@ ninja install # export TEST_CPU_FLAG="" # fi +if [[ $(uname) == "Darwin" ]]; then + # The following is suggested in https://docs.conda.io/projects/conda-build/en/latest/resources/compiler-tools.html?highlight=SDK#macos-sdk + wget -q https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.10.sdk.tar.xz + shasum -c ./buildscripts/incremental/MacOSX10.10.sdk.checksum + tar -xf ./MacOSX10.10.sdk.tar.xz + export SDKROOT=`pwd`/MacOSX10.10.sdk + export CONDA_BUILD_SYSROOT=`pwd`/MacOSX10.10.sdk + export macos_min_version=10.10 +fi + if [[ "$CONDA_BUILD_CROSS_COMPILATION" != "1" ]]; then echo "Testing on ${target_platform}" From e5543e59758eb0be5747998dbbb5d6ff32f5f71c Mon Sep 17 00:00:00 2001 From: swap357 Date: Fri, 7 Mar 2025 08:57:19 -0800 Subject: [PATCH 04/14] update and test default build config for llvmdev --- buildscripts/github/llvmdev_evaluate.py | 29 +++++++++++++++---------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/buildscripts/github/llvmdev_evaluate.py b/buildscripts/github/llvmdev_evaluate.py index 2c3c36def..cc8f515f4 100755 --- a/buildscripts/github/llvmdev_evaluate.py +++ b/buildscripts/github/llvmdev_evaluate.py @@ -18,21 +18,26 @@ } default_include = [ + # { + # "runner": runner_mapping["linux-64"], + # "platform": "linux-64", + # "recipe": "llvmdev", + # }, + # { + # "runner": runner_mapping["win-64"], + # "platform": "win-64", + # "recipe": "llvmdev", + # }, + # { + # "runner": runner_mapping["win-64"], + # "platform": "win-64", + # "recipe": "llvmdev_for_wheel", + # }, { - "runner": runner_mapping["linux-64"], - "platform": "linux-64", + "runner": runner_mapping["osx-64"], + "platform": "osx-64", "recipe": "llvmdev", }, - { - "runner": runner_mapping["win-64"], - "platform": "win-64", - "recipe": "llvmdev", - }, - { - "runner": runner_mapping["win-64"], - "platform": "win-64", - "recipe": "llvmdev_for_wheel", - }, ] print( From ea24fb46a91c7796e357fdeddd92ed051bb936f3 Mon Sep 17 00:00:00 2001 From: swap357 Date: Fri, 7 Mar 2025 09:07:13 -0800 Subject: [PATCH 05/14] refactor macos setup in llvmdev build script --- conda-recipes/llvmdev/build.sh | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/conda-recipes/llvmdev/build.sh b/conda-recipes/llvmdev/build.sh index 9131f9e99..14bface14 100644 --- a/conda-recipes/llvmdev/build.sh +++ b/conda-recipes/llvmdev/build.sh @@ -4,6 +4,18 @@ set -x +# Setup macOS SDK if needed +if [[ $(uname) == "Darwin" ]]; then + # The following is suggested in https://docs.conda.io/projects/conda-build/en/latest/resources/compiler-tools.html?highlight=SDK#macos-sdk + wget -q https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.10.sdk.tar.xz + shasum -c ./buildscripts/incremental/MacOSX10.10.sdk.checksum + tar -xf ./MacOSX10.10.sdk.tar.xz + SDK_PATH=`pwd`/MacOSX10.10.sdk + export SDKROOT=$SDK_PATH + export CONDA_BUILD_SYSROOT=$SDK_PATH + export macos_min_version=10.10 +fi + # Make osx work like linux. sed -i.bak "s/NOT APPLE AND ARG_SONAME/ARG_SONAME/g" llvm/cmake/modules/AddLLVM.cmake sed -i.bak "s/NOT APPLE AND NOT ARG_SONAME/NOT ARG_SONAME/g" llvm/cmake/modules/AddLLVM.cmake @@ -84,16 +96,6 @@ ninja install # export TEST_CPU_FLAG="" # fi -if [[ $(uname) == "Darwin" ]]; then - # The following is suggested in https://docs.conda.io/projects/conda-build/en/latest/resources/compiler-tools.html?highlight=SDK#macos-sdk - wget -q https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.10.sdk.tar.xz - shasum -c ./buildscripts/incremental/MacOSX10.10.sdk.checksum - tar -xf ./MacOSX10.10.sdk.tar.xz - export SDKROOT=`pwd`/MacOSX10.10.sdk - export CONDA_BUILD_SYSROOT=`pwd`/MacOSX10.10.sdk - export macos_min_version=10.10 -fi - if [[ "$CONDA_BUILD_CROSS_COMPILATION" != "1" ]]; then echo "Testing on ${target_platform}" From 34eaea0d53377990fb25d7028a1bc01bd0462a8e Mon Sep 17 00:00:00 2001 From: swap357 Date: Fri, 7 Mar 2025 09:19:19 -0800 Subject: [PATCH 06/14] move sdk checksum file to correct location --- conda-recipes/llvmdev/MacOSX10.10.sdk.checksum | 1 + conda-recipes/llvmdev/build.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 conda-recipes/llvmdev/MacOSX10.10.sdk.checksum diff --git a/conda-recipes/llvmdev/MacOSX10.10.sdk.checksum b/conda-recipes/llvmdev/MacOSX10.10.sdk.checksum new file mode 100644 index 000000000..0a82e4317 --- /dev/null +++ b/conda-recipes/llvmdev/MacOSX10.10.sdk.checksum @@ -0,0 +1 @@ +ea40a3b9dc48cd3593628490f2738b89282f00ab ./MacOSX10.10.sdk.tar.xz diff --git a/conda-recipes/llvmdev/build.sh b/conda-recipes/llvmdev/build.sh index 14bface14..6a18ce070 100644 --- a/conda-recipes/llvmdev/build.sh +++ b/conda-recipes/llvmdev/build.sh @@ -8,7 +8,7 @@ set -x if [[ $(uname) == "Darwin" ]]; then # The following is suggested in https://docs.conda.io/projects/conda-build/en/latest/resources/compiler-tools.html?highlight=SDK#macos-sdk wget -q https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.10.sdk.tar.xz - shasum -c ./buildscripts/incremental/MacOSX10.10.sdk.checksum + shasum -c ./conda-recipes/llvmdev/MacOSX10.10.sdk.checksum tar -xf ./MacOSX10.10.sdk.tar.xz SDK_PATH=`pwd`/MacOSX10.10.sdk export SDKROOT=$SDK_PATH From d8faa82e0ee9868f1900ef2f5bc89177acd5d66d Mon Sep 17 00:00:00 2001 From: swap357 Date: Fri, 7 Mar 2025 10:05:31 -0800 Subject: [PATCH 07/14] move and update sdk checksum path --- .../llvmdev => buildscripts/github}/MacOSX10.10.sdk.checksum | 0 conda-recipes/llvmdev/build.sh | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename {conda-recipes/llvmdev => buildscripts/github}/MacOSX10.10.sdk.checksum (100%) diff --git a/conda-recipes/llvmdev/MacOSX10.10.sdk.checksum b/buildscripts/github/MacOSX10.10.sdk.checksum similarity index 100% rename from conda-recipes/llvmdev/MacOSX10.10.sdk.checksum rename to buildscripts/github/MacOSX10.10.sdk.checksum diff --git a/conda-recipes/llvmdev/build.sh b/conda-recipes/llvmdev/build.sh index 6a18ce070..d6501cf64 100644 --- a/conda-recipes/llvmdev/build.sh +++ b/conda-recipes/llvmdev/build.sh @@ -8,7 +8,7 @@ set -x if [[ $(uname) == "Darwin" ]]; then # The following is suggested in https://docs.conda.io/projects/conda-build/en/latest/resources/compiler-tools.html?highlight=SDK#macos-sdk wget -q https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.10.sdk.tar.xz - shasum -c ./conda-recipes/llvmdev/MacOSX10.10.sdk.checksum + shasum -c ./buildscripts/github/MacOSX10.10.sdk.checksum tar -xf ./MacOSX10.10.sdk.tar.xz SDK_PATH=`pwd`/MacOSX10.10.sdk export SDKROOT=$SDK_PATH From 07ca295b48dc84b30ac83d13145e7370956d0213 Mon Sep 17 00:00:00 2001 From: swap357 Date: Fri, 7 Mar 2025 10:32:16 -0800 Subject: [PATCH 08/14] update MacOSX10.10.sdk checksum to SHA-256 --- buildscripts/github/MacOSX10.10.sdk.checksum | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildscripts/github/MacOSX10.10.sdk.checksum b/buildscripts/github/MacOSX10.10.sdk.checksum index 0a82e4317..a4fdcba00 100644 --- a/buildscripts/github/MacOSX10.10.sdk.checksum +++ b/buildscripts/github/MacOSX10.10.sdk.checksum @@ -1 +1 @@ -ea40a3b9dc48cd3593628490f2738b89282f00ab ./MacOSX10.10.sdk.tar.xz +3839b875df1f2bc98893b8502da456cc0b022c4666bc6b7eb5764a5f915a9b00 MacOSX10.10.sdk.tar.xz From 73bae68845b78475f856b7116125a7e419f0b475 Mon Sep 17 00:00:00 2001 From: swap357 Date: Fri, 7 Mar 2025 10:47:31 -0800 Subject: [PATCH 09/14] add macos sdk setup function to llvmdev_evaluate script --- buildscripts/github/llvmdev_evaluate.py | 39 ++++++++++++++++++++++++- conda-recipes/llvmdev/build.sh | 22 ++++---------- 2 files changed, 43 insertions(+), 18 deletions(-) diff --git a/buildscripts/github/llvmdev_evaluate.py b/buildscripts/github/llvmdev_evaluate.py index cc8f515f4..4cb5faad3 100755 --- a/buildscripts/github/llvmdev_evaluate.py +++ b/buildscripts/github/llvmdev_evaluate.py @@ -3,7 +3,7 @@ import json import os from pathlib import Path - +import subprocess event = os.environ.get("GITHUB_EVENT_NAME") label = os.environ.get("GITHUB_LABEL_NAME") @@ -17,6 +17,39 @@ "win-64": "windows-2019", } +def setup_macos_sdk(): + """Setup macOS SDK for osx-64 builds""" + print("Setting up macOS SDK for osx-64 build") + sdk_dir = Path("buildscripts/github") + sdk_dir.mkdir(parents=True, exist_ok=True) + + # Download SDK + print("Downloading MacOSX10.10.sdk.tar.xz") + subprocess.run(["wget", "-q", "https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.10.sdk.tar.xz"], + check=True) + + # Verify checksum + print("Verifying SDK checksum") + subprocess.run(["shasum", "-c", "buildscripts/github/MacOSX10.10.sdk.checksum"], + check=True) + + # Extract SDK + print("Extracting SDK") + subprocess.run(["tar", "-xf", "MacOSX10.10.sdk.tar.xz"], + check=True) + + # Set environment variables + sdk_path = str(Path.cwd() / "MacOSX10.10.sdk") + os.environ["SDKROOT"] = sdk_path + os.environ["CONDA_BUILD_SYSROOT"] = sdk_path + os.environ["macos_min_version"] = "10.10" + os.environ["CFLAGS"] = f"-isysroot {sdk_path} {os.environ.get('CFLAGS', '')}" + os.environ["CXXFLAGS"] = f"-isysroot {sdk_path} {os.environ.get('CXXFLAGS', '')}" + os.environ["LDFLAGS"] = f"-Wl,-syslibroot,{sdk_path} {os.environ.get('LDFLAGS', '')}" + os.environ["CMAKE_OSX_SYSROOT"] = sdk_path + os.environ["CMAKE_OSX_DEPLOYMENT_TARGET"] = "10.10" + print("macOS SDK setup complete") + default_include = [ # { # "runner": runner_mapping["linux-64"], @@ -63,6 +96,10 @@ else: include = {} +# Setup platform-specific requirements +if any(job["platform"] == "osx-64" for job in include): + setup_macos_sdk() + matrix = {"include": include} print(f"Emitting matrix:\n {json.dumps(matrix, indent=4)}") diff --git a/conda-recipes/llvmdev/build.sh b/conda-recipes/llvmdev/build.sh index d6501cf64..e1adebd59 100644 --- a/conda-recipes/llvmdev/build.sh +++ b/conda-recipes/llvmdev/build.sh @@ -4,18 +4,6 @@ set -x -# Setup macOS SDK if needed -if [[ $(uname) == "Darwin" ]]; then - # The following is suggested in https://docs.conda.io/projects/conda-build/en/latest/resources/compiler-tools.html?highlight=SDK#macos-sdk - wget -q https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.10.sdk.tar.xz - shasum -c ./buildscripts/github/MacOSX10.10.sdk.checksum - tar -xf ./MacOSX10.10.sdk.tar.xz - SDK_PATH=`pwd`/MacOSX10.10.sdk - export SDKROOT=$SDK_PATH - export CONDA_BUILD_SYSROOT=$SDK_PATH - export macos_min_version=10.10 -fi - # Make osx work like linux. sed -i.bak "s/NOT APPLE AND ARG_SONAME/ARG_SONAME/g" llvm/cmake/modules/AddLLVM.cmake sed -i.bak "s/NOT APPLE AND NOT ARG_SONAME/NOT ARG_SONAME/g" llvm/cmake/modules/AddLLVM.cmake @@ -90,11 +78,11 @@ ninja -j${CPU_COUNT} ninja install -# if [[ "${target_platform}" == "linux-64" || "${target_platform}" == "osx-64" ]]; then -# export TEST_CPU_FLAG="-mcpu=haswell" -# else -# export TEST_CPU_FLAG="" -# fi +if [[ "${target_platform}" == "linux-64" || "${target_platform}" == "osx-64" ]]; then + export TEST_CPU_FLAG="-mcpu=haswell" +else + export TEST_CPU_FLAG="" +fi if [[ "$CONDA_BUILD_CROSS_COMPILATION" != "1" ]]; then From dc116d2f391d185bfa4c4ed9bf7144e0db138f9f Mon Sep 17 00:00:00 2001 From: swap357 Date: Fri, 7 Mar 2025 11:01:28 -0800 Subject: [PATCH 10/14] add platform specific setup script --- .github/workflows/llvmdev_build.yml | 5 +++ buildscripts/github/llvmdev_evaluate.py | 54 +--------------------- buildscripts/github/setup_platform.sh | 60 +++++++++++++++++++++++++ 3 files changed, 66 insertions(+), 53 deletions(-) create mode 100644 buildscripts/github/setup_platform.sh diff --git a/.github/workflows/llvmdev_build.yml b/.github/workflows/llvmdev_build.yml index 8c55e0765..360f45e35 100644 --- a/.github/workflows/llvmdev_build.yml +++ b/.github/workflows/llvmdev_build.yml @@ -78,6 +78,11 @@ jobs: - name: Clone repository uses: actions/checkout@v4 + - name: Setup platform-specific requirements + run: | + chmod +x ./buildscripts/github/setup_platform.sh + source ./buildscripts/github/setup_platform.sh "${{ matrix.platform }}" + - name: Setup Miniconda uses: conda-incubator/setup-miniconda@v3 with: diff --git a/buildscripts/github/llvmdev_evaluate.py b/buildscripts/github/llvmdev_evaluate.py index 4cb5faad3..fc22259c3 100755 --- a/buildscripts/github/llvmdev_evaluate.py +++ b/buildscripts/github/llvmdev_evaluate.py @@ -3,7 +3,6 @@ import json import os from pathlib import Path -import subprocess event = os.environ.get("GITHUB_EVENT_NAME") label = os.environ.get("GITHUB_LABEL_NAME") @@ -17,55 +16,7 @@ "win-64": "windows-2019", } -def setup_macos_sdk(): - """Setup macOS SDK for osx-64 builds""" - print("Setting up macOS SDK for osx-64 build") - sdk_dir = Path("buildscripts/github") - sdk_dir.mkdir(parents=True, exist_ok=True) - - # Download SDK - print("Downloading MacOSX10.10.sdk.tar.xz") - subprocess.run(["wget", "-q", "https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.10.sdk.tar.xz"], - check=True) - - # Verify checksum - print("Verifying SDK checksum") - subprocess.run(["shasum", "-c", "buildscripts/github/MacOSX10.10.sdk.checksum"], - check=True) - - # Extract SDK - print("Extracting SDK") - subprocess.run(["tar", "-xf", "MacOSX10.10.sdk.tar.xz"], - check=True) - - # Set environment variables - sdk_path = str(Path.cwd() / "MacOSX10.10.sdk") - os.environ["SDKROOT"] = sdk_path - os.environ["CONDA_BUILD_SYSROOT"] = sdk_path - os.environ["macos_min_version"] = "10.10" - os.environ["CFLAGS"] = f"-isysroot {sdk_path} {os.environ.get('CFLAGS', '')}" - os.environ["CXXFLAGS"] = f"-isysroot {sdk_path} {os.environ.get('CXXFLAGS', '')}" - os.environ["LDFLAGS"] = f"-Wl,-syslibroot,{sdk_path} {os.environ.get('LDFLAGS', '')}" - os.environ["CMAKE_OSX_SYSROOT"] = sdk_path - os.environ["CMAKE_OSX_DEPLOYMENT_TARGET"] = "10.10" - print("macOS SDK setup complete") - default_include = [ - # { - # "runner": runner_mapping["linux-64"], - # "platform": "linux-64", - # "recipe": "llvmdev", - # }, - # { - # "runner": runner_mapping["win-64"], - # "platform": "win-64", - # "recipe": "llvmdev", - # }, - # { - # "runner": runner_mapping["win-64"], - # "platform": "win-64", - # "recipe": "llvmdev_for_wheel", - # }, { "runner": runner_mapping["osx-64"], "platform": "osx-64", @@ -96,10 +47,7 @@ def setup_macos_sdk(): else: include = {} -# Setup platform-specific requirements -if any(job["platform"] == "osx-64" for job in include): - setup_macos_sdk() - +# Generate matrix output matrix = {"include": include} print(f"Emitting matrix:\n {json.dumps(matrix, indent=4)}") diff --git a/buildscripts/github/setup_platform.sh b/buildscripts/github/setup_platform.sh new file mode 100644 index 000000000..8ab58fa31 --- /dev/null +++ b/buildscripts/github/setup_platform.sh @@ -0,0 +1,60 @@ +#!/bin/bash + +set -x + +PLATFORM=$1 + +echo "Setting up platform-specific requirements for ${PLATFORM}" + +case "${PLATFORM}" in + "osx-64") + echo "Setting up macOS SDK for osx-64 build" + sdk_dir="buildscripts/github" + mkdir -p "${sdk_dir}" + + # Download SDK + echo "Downloading MacOSX10.10.sdk.tar.xz" + wget -q https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.10.sdk.tar.xz + + # Verify checksum + echo "Verifying SDK checksum" + shasum -c "${sdk_dir}/MacOSX10.10.sdk.checksum" + + # Extract SDK + echo "Extracting SDK" + tar -xf MacOSX10.10.sdk.tar.xz + + # Set environment variables + sdk_path="$(pwd)/MacOSX10.10.sdk" + export SDKROOT="${sdk_path}" + export CONDA_BUILD_SYSROOT="${sdk_path}" + export macos_min_version="10.10" + export CFLAGS="-isysroot ${sdk_path} ${CFLAGS:-}" + export CXXFLAGS="-isysroot ${sdk_path} ${CXXFLAGS:-}" + export LDFLAGS="-Wl,-syslibroot,${sdk_path} ${LDFLAGS:-}" + export CMAKE_OSX_SYSROOT="${sdk_path}" + export CMAKE_OSX_DEPLOYMENT_TARGET="10.10" + echo "macOS SDK setup complete" + ;; + "linux-64") + echo "Setting up Linux-specific requirements" + # Add Linux-specific setup here if needed + ;; + "linux-aarch64") + echo "Setting up Linux ARM64-specific requirements" + # Add Linux ARM64-specific setup here if needed + ;; + "osx-arm64") + echo "Setting up macOS ARM64-specific requirements" + # Add macOS ARM64-specific setup here if needed + ;; + "win-64") + echo "Setting up Windows-specific requirements" + # Add Windows-specific setup here if needed + ;; + *) + echo "No specific setup required for platform: ${PLATFORM}" + ;; +esac + +echo "Platform setup complete for ${PLATFORM}" \ No newline at end of file From dbdb13a9289e59df420f15f316309a5927429728 Mon Sep 17 00:00:00 2001 From: swap357 Date: Fri, 7 Mar 2025 11:34:09 -0800 Subject: [PATCH 11/14] update sdk setup to extract to /opt and configure build environment --- buildscripts/github/setup_platform.sh | 18 ++++-------------- conda-recipes/llvmdev/conda_build_config.yaml | 13 +++++++++++-- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/buildscripts/github/setup_platform.sh b/buildscripts/github/setup_platform.sh index 8ab58fa31..592d1708d 100644 --- a/buildscripts/github/setup_platform.sh +++ b/buildscripts/github/setup_platform.sh @@ -20,20 +20,10 @@ case "${PLATFORM}" in echo "Verifying SDK checksum" shasum -c "${sdk_dir}/MacOSX10.10.sdk.checksum" - # Extract SDK - echo "Extracting SDK" - tar -xf MacOSX10.10.sdk.tar.xz - - # Set environment variables - sdk_path="$(pwd)/MacOSX10.10.sdk" - export SDKROOT="${sdk_path}" - export CONDA_BUILD_SYSROOT="${sdk_path}" - export macos_min_version="10.10" - export CFLAGS="-isysroot ${sdk_path} ${CFLAGS:-}" - export CXXFLAGS="-isysroot ${sdk_path} ${CXXFLAGS:-}" - export LDFLAGS="-Wl,-syslibroot,${sdk_path} ${LDFLAGS:-}" - export CMAKE_OSX_SYSROOT="${sdk_path}" - export CMAKE_OSX_DEPLOYMENT_TARGET="10.10" + # Extract SDK to /opt + echo "Extracting SDK to /opt" + sudo mkdir -p /opt + sudo tar -xf MacOSX10.10.sdk.tar.xz -C /opt echo "macOS SDK setup complete" ;; "linux-64") diff --git a/conda-recipes/llvmdev/conda_build_config.yaml b/conda-recipes/llvmdev/conda_build_config.yaml index 21de5b35f..dd9956a6b 100644 --- a/conda-recipes/llvmdev/conda_build_config.yaml +++ b/conda-recipes/llvmdev/conda_build_config.yaml @@ -16,5 +16,14 @@ c_compiler: # [win] cxx_compiler: # [win] - vs2019 # [win] -MACOSX_SDK_VERSION: # [osx and x86_64] - - 10.12 # [osx and x86_64] +MACOSX_DEPLOYMENT_TARGET: + - 10.10 # [osx and x86_64] + +macos_machine: + - x86_64-apple-darwin13.4.0 # [osx and x86_64] + +macos_min_version: + - 10.10 # [osx and x86_64] + +CONDA_BUILD_SYSROOT: + - /opt/MacOSX10.10.sdk # [osx and x86_64] \ No newline at end of file From 8e0b1a7ec0dea4869e8d578e590870d4ec27d51d Mon Sep 17 00:00:00 2001 From: swap357 Date: Fri, 7 Mar 2025 13:51:03 -0800 Subject: [PATCH 12/14] cleanup build configs for llvmdev conda and wheel builder --- buildscripts/github/llvmdev_evaluate.py | 17 ++++++++++++++++- conda-recipes/llvmdev_for_wheel/build.sh | 10 +++++----- .../llvmdev_for_wheel/conda_build_config.yaml | 13 +++++++++++-- 3 files changed, 32 insertions(+), 8 deletions(-) diff --git a/buildscripts/github/llvmdev_evaluate.py b/buildscripts/github/llvmdev_evaluate.py index fc22259c3..caf834bcc 100755 --- a/buildscripts/github/llvmdev_evaluate.py +++ b/buildscripts/github/llvmdev_evaluate.py @@ -4,6 +4,7 @@ import os from pathlib import Path + event = os.environ.get("GITHUB_EVENT_NAME") label = os.environ.get("GITHUB_LABEL_NAME") inputs = os.environ.get("GITHUB_WORKFLOW_INPUT", "{}") @@ -17,6 +18,21 @@ } default_include = [ + { + "runner": runner_mapping["linux-64"], + "platform": "linux-64", + "recipe": "llvmdev", + }, + { + "runner": runner_mapping["win-64"], + "platform": "win-64", + "recipe": "llvmdev", + }, + { + "runner": runner_mapping["win-64"], + "platform": "win-64", + "recipe": "llvmdev_for_wheel", + }, { "runner": runner_mapping["osx-64"], "platform": "osx-64", @@ -47,7 +63,6 @@ else: include = {} -# Generate matrix output matrix = {"include": include} print(f"Emitting matrix:\n {json.dumps(matrix, indent=4)}") diff --git a/conda-recipes/llvmdev_for_wheel/build.sh b/conda-recipes/llvmdev_for_wheel/build.sh index 486995a58..f39a8991b 100644 --- a/conda-recipes/llvmdev_for_wheel/build.sh +++ b/conda-recipes/llvmdev_for_wheel/build.sh @@ -83,11 +83,11 @@ ninja -j${CPU_COUNT} ninja install -# if [[ "${target_platform}" == "linux-64" || "${target_platform}" == "osx-64" ]]; then -# export TEST_CPU_FLAG="-mcpu=haswell" -# else -# export TEST_CPU_FLAG="" -# fi +if [[ "${target_platform}" == "linux-64" || "${target_platform}" == "osx-64" ]]; then + export TEST_CPU_FLAG="-mcpu=haswell" +else + export TEST_CPU_FLAG="" +fi if [[ "$CONDA_BUILD_CROSS_COMPILATION" != "1" ]]; then diff --git a/conda-recipes/llvmdev_for_wheel/conda_build_config.yaml b/conda-recipes/llvmdev_for_wheel/conda_build_config.yaml index 078468e31..d1ca3a9f6 100644 --- a/conda-recipes/llvmdev_for_wheel/conda_build_config.yaml +++ b/conda-recipes/llvmdev_for_wheel/conda_build_config.yaml @@ -16,5 +16,14 @@ c_compiler: # [win] cxx_compiler: # [win] - vs2019 # [win] -MACOSX_SDK_VERSION: # [osx and x86_64] - - 10.12 # [osx and x86_64] +MACOSX_DEPLOYMENT_TARGET: + - 10.10 # [osx and x86_64] + +macos_machine: + - x86_64-apple-darwin13.4.0 # [osx and x86_64] + +macos_min_version: + - 10.10 # [osx and x86_64] + +CONDA_BUILD_SYSROOT: + - /opt/MacOSX10.10.sdk # [osx and x86_64] From b156d79be29af9c77e4461064ea3e1bb6992dafa Mon Sep 17 00:00:00 2001 From: swap357 Date: Fri, 7 Mar 2025 13:53:14 -0800 Subject: [PATCH 13/14] add osx-64 wheel builder to defaults to be run on PR --- buildscripts/github/llvmdev_evaluate.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/buildscripts/github/llvmdev_evaluate.py b/buildscripts/github/llvmdev_evaluate.py index caf834bcc..d7179b35c 100755 --- a/buildscripts/github/llvmdev_evaluate.py +++ b/buildscripts/github/llvmdev_evaluate.py @@ -38,6 +38,11 @@ "platform": "osx-64", "recipe": "llvmdev", }, + { + "runner": runner_mapping["osx-64"], + "platform": "osx-64", + "recipe": "llvmdev_for_wheel", + }, ] print( From 43cdfdf6d1f950e5ae8918185d72e76328f54852 Mon Sep 17 00:00:00 2001 From: swap357 Date: Fri, 7 Mar 2025 16:29:24 -0800 Subject: [PATCH 14/14] remove platform-specific setup placeholders from setup script --- buildscripts/github/setup_platform.sh | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/buildscripts/github/setup_platform.sh b/buildscripts/github/setup_platform.sh index 592d1708d..e6f72631a 100644 --- a/buildscripts/github/setup_platform.sh +++ b/buildscripts/github/setup_platform.sh @@ -26,22 +26,6 @@ case "${PLATFORM}" in sudo tar -xf MacOSX10.10.sdk.tar.xz -C /opt echo "macOS SDK setup complete" ;; - "linux-64") - echo "Setting up Linux-specific requirements" - # Add Linux-specific setup here if needed - ;; - "linux-aarch64") - echo "Setting up Linux ARM64-specific requirements" - # Add Linux ARM64-specific setup here if needed - ;; - "osx-arm64") - echo "Setting up macOS ARM64-specific requirements" - # Add macOS ARM64-specific setup here if needed - ;; - "win-64") - echo "Setting up Windows-specific requirements" - # Add Windows-specific setup here if needed - ;; *) echo "No specific setup required for platform: ${PLATFORM}" ;;