From a6acc01b01adadaac2d464c36935c32482c0db53 Mon Sep 17 00:00:00 2001 From: linmin Date: Mon, 4 Dec 2023 10:40:18 +0800 Subject: [PATCH 01/35] test setup python --- .github/workflows/test_setuppython.yml | 30 ++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/test_setuppython.yml diff --git a/.github/workflows/test_setuppython.yml b/.github/workflows/test_setuppython.yml new file mode 100644 index 0000000..afe68ce --- /dev/null +++ b/.github/workflows/test_setuppython.yml @@ -0,0 +1,30 @@ +# Action name +name: Release Wheel + +on: [push] + +jobs: + release: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.9', '3.10', '3.11', '3.12'] + steps: + - name: Cancel previous run + uses: styfle/cancel-workflow-action@0.9.1 + with: + access_token: ${{ github.token }} + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Build + run: | + pip install -r requirements.txt + bazel build --remote_cache=http://${{ secrets.BAZEL_CACHE }}:8080 @maple2jax//:jax_xc_wheel + - name: Upload artifact + uses: actions/upload-artifact@main + with: + name: wheel + path: bazel-bin/external/maple2jax/*.whl From 6909e20ba407c6259a58f6a4cf22781191c17665 Mon Sep 17 00:00:00 2001 From: mavenlin Date: Mon, 4 Dec 2023 10:21:08 +0800 Subject: [PATCH 02/35] introducing multi-platform --- .bazelrc | 4 ++-- .github/workflows/release.yml | 2 +- WORKSPACE | 13 +++++++++++++ maple2jax/wheel.BUILD | 32 +++++++++++++++++++++++++++++++- 4 files changed, 47 insertions(+), 4 deletions(-) diff --git a/.bazelrc b/.bazelrc index 8f6734f..832a03d 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,3 +1,3 @@ build --copt=-g0 --copt=-O3 --copt=-DNDEBUG -build --action_env=BAZEL_LINKLIBS=-l%:libstdc++.a:-lm -build --action_env=BAZEL_LINKOPTS=-static-libgcc +build:linux --action_env=BAZEL_LINKLIBS=-l%:libstdc++.a:-lm +build:linux --action_env=BAZEL_LINKOPTS=-static-libgcc diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 65c8ddb..6401e71 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,7 +24,7 @@ jobs: run: | eval "$(pyenv init -)" && pyenv global ${{ matrix.python-version }}-dev pip install -r requirements.txt - bazel build --remote_cache=http://${{ secrets.BAZEL_CACHE }}:8080 @maple2jax//:jax_xc_wheel + bazel build --config=linux --remote_cache=http://${{ secrets.BAZEL_CACHE }}:8080 @maple2jax//:jax_xc_wheel - name: Upload artifact uses: actions/upload-artifact@main with: diff --git a/WORKSPACE b/WORKSPACE index f3032cd..f2b3985 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -2,6 +2,19 @@ workspace(name = "jax_xc") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +http_archive( + name = "bazel_skylib", + sha256 = "cd55a062e763b9349921f0f5db8c3933288dc8ba4f76dd9416aac68acee3cb94", + urls = [ + "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz", + "https://github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz", + ], +) + +load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") + +bazel_skylib_workspace() + http_archive( name = "rules_python", sha256 = "8c8fe44ef0a9afc256d1e75ad5f448bb59b81aba149b8958f02f7b3a98f5d9b4", diff --git a/maple2jax/wheel.BUILD b/maple2jax/wheel.BUILD index 3e7ffdf..fac8f94 100644 --- a/maple2jax/wheel.BUILD +++ b/maple2jax/wheel.BUILD @@ -1,5 +1,30 @@ load("@python_abi//:abi.bzl", "abi_tag", "python_tag") load("@rules_python//python:packaging.bzl", "py_wheel") +load("@bazel_skylib//lib:selects.bzl", "selects") + +selects.config_setting_group( + name = "macos_arm64", + match_all = [ + "@platforms//os:macos", + "@platforms//cpu:arm64", + ], +) + +selects.config_setting_group( + name = "macos_x86_64", + match_all = [ + "@platforms//os:macos", + "@platforms//cpu:x86_64", + ], +) + +selects.config_setting_group( + name = "linux_x86_64", + match_all = [ + "@platforms//os:linux", + "@platforms//cpu:x86_64", + ], +) py_wheel( name = "jax_xc_wheel", @@ -12,7 +37,12 @@ py_wheel( ], description_file = "@jax_xc//:README.rst", distribution = "jax_xc", - platform = "manylinux_2_17_x86_64", + platform = select({ + ":macos_arm64": "macosx_11_0_arm64", + ":macos_x86_64": "macosx_11_0_x86_64", + ":linux_x86_64": "manylinux_2_17_x86_64", + "//conditions:default": "manylinux_2_17_x86_64", + }), python_requires = ">=3.9", python_tag = python_tag(), requires = [ From 4f2aa9bced892b046bc26bcde7d782e92b12d865 Mon Sep 17 00:00:00 2001 From: linmin Date: Mon, 4 Dec 2023 10:10:57 +0800 Subject: [PATCH 03/35] test build for macos --- .github/workflows/macos.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/macos.yml diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml new file mode 100644 index 0000000..30eaa0d --- /dev/null +++ b/.github/workflows/macos.yml @@ -0,0 +1,16 @@ +name: Release for Macos + +jobs: + release: + runs-on: macos-latest + steps: + - name: Cancel previous run + uses: styfle/cancel-workflow-action@0.9.1 + with: + access_token: ${{ github.token }} + - uses: actions/checkout@v2 + - name: Setup and Build + run: | + brew install bazel + pip install -r requirements.txt + bazel build @maple2jax//:jax_xc_wheel From a855700b3cc03d17b913877314bd361742c179b3 Mon Sep 17 00:00:00 2001 From: linmin Date: Mon, 4 Dec 2023 10:12:09 +0800 Subject: [PATCH 04/35] trigger build --- .github/workflows/macos.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 30eaa0d..9d029a5 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1,5 +1,7 @@ name: Release for Macos +on: [push] + jobs: release: runs-on: macos-latest From cad212b507a4fe264e8aad6766dbbe0c86ef65ca Mon Sep 17 00:00:00 2001 From: linmin Date: Mon, 4 Dec 2023 10:23:52 +0800 Subject: [PATCH 05/35] test build on macos --- .github/workflows/macos.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 9d029a5..0abdf40 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -13,6 +13,5 @@ jobs: - uses: actions/checkout@v2 - name: Setup and Build run: | - brew install bazel pip install -r requirements.txt - bazel build @maple2jax//:jax_xc_wheel + bazel build --cpu=x86_64 --os=macos @maple2jax//:jax_xc_wheel From eced1f8093ec88b12f69b2af03fcc2c4b6b93e18 Mon Sep 17 00:00:00 2001 From: linmin Date: Mon, 4 Dec 2023 10:32:56 +0800 Subject: [PATCH 06/35] fix --- .bazelrc | 5 +++++ .github/workflows/macos.yml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.bazelrc b/.bazelrc index 832a03d..dae7fcb 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,3 +1,8 @@ build --copt=-g0 --copt=-O3 --copt=-DNDEBUG + build:linux --action_env=BAZEL_LINKLIBS=-l%:libstdc++.a:-lm build:linux --action_env=BAZEL_LINKOPTS=-static-libgcc +build:linux --define os=linux --define cpu=x86_64 + +build:macos_x86_64 --define os=macos --define cpu=x86_64 +build:macos_arm64 --define os=macos --define cpu=arm64 diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 0abdf40..76beb0a 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -14,4 +14,4 @@ jobs: - name: Setup and Build run: | pip install -r requirements.txt - bazel build --cpu=x86_64 --os=macos @maple2jax//:jax_xc_wheel + bazel build --config=macos_x86_64 @maple2jax//:jax_xc_wheel From 2372769d0c6ae1a6b762606abc3a7c9b206dbfdf Mon Sep 17 00:00:00 2001 From: linmin Date: Mon, 4 Dec 2023 15:25:33 +0800 Subject: [PATCH 07/35] test macos-11 --- .github/workflows/macos.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 76beb0a..a07f008 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -4,7 +4,7 @@ on: [push] jobs: release: - runs-on: macos-latest + runs-on: macos-11 steps: - name: Cancel previous run uses: styfle/cancel-workflow-action@0.9.1 @@ -14,4 +14,4 @@ jobs: - name: Setup and Build run: | pip install -r requirements.txt - bazel build --config=macos_x86_64 @maple2jax//:jax_xc_wheel + bazel build --config=macos_x86_64 --remote_cache=http://${{ secrets.BAZEL_CACHE }}:8080 @maple2jax//:jax_xc_wheel From 348003fc9d8f357bba0ddf638ee3c0cae4035fdd Mon Sep 17 00:00:00 2001 From: linmin Date: Mon, 4 Dec 2023 15:26:22 +0800 Subject: [PATCH 08/35] remove workflow since it is verified --- .github/workflows/test_setuppython.yml | 30 -------------------------- 1 file changed, 30 deletions(-) delete mode 100644 .github/workflows/test_setuppython.yml diff --git a/.github/workflows/test_setuppython.yml b/.github/workflows/test_setuppython.yml deleted file mode 100644 index afe68ce..0000000 --- a/.github/workflows/test_setuppython.yml +++ /dev/null @@ -1,30 +0,0 @@ -# Action name -name: Release Wheel - -on: [push] - -jobs: - release: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ['3.9', '3.10', '3.11', '3.12'] - steps: - - name: Cancel previous run - uses: styfle/cancel-workflow-action@0.9.1 - with: - access_token: ${{ github.token }} - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Build - run: | - pip install -r requirements.txt - bazel build --remote_cache=http://${{ secrets.BAZEL_CACHE }}:8080 @maple2jax//:jax_xc_wheel - - name: Upload artifact - uses: actions/upload-artifact@main - with: - name: wheel - path: bazel-bin/external/maple2jax/*.whl From e9a272646474ae4a4ba499a08d9162c9f6474fac Mon Sep 17 00:00:00 2001 From: linmin Date: Mon, 4 Dec 2023 15:28:46 +0800 Subject: [PATCH 09/35] test setup python on mac --- .github/workflows/macos.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index a07f008..51a9992 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -5,13 +5,20 @@ on: [push] jobs: release: runs-on: macos-11 + strategy: + matrix: + python-version: ['3.9', '3.10', '3.11', '3.12'] steps: - name: Cancel previous run uses: styfle/cancel-workflow-action@0.9.1 with: access_token: ${{ github.token }} - uses: actions/checkout@v2 - - name: Setup and Build + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Build run: | pip install -r requirements.txt bazel build --config=macos_x86_64 --remote_cache=http://${{ secrets.BAZEL_CACHE }}:8080 @maple2jax//:jax_xc_wheel From 16306dd55fb9542d44e1f646db561052c174d920 Mon Sep 17 00:00:00 2001 From: linmin Date: Mon, 4 Dec 2023 16:57:06 +0800 Subject: [PATCH 10/35] build on mac and linux --- .github/workflows/macos.yml | 23 ++++++++++++++++++++++- .github/workflows/release.yml | 17 +++++++++-------- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 51a9992..73bfed4 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1,6 +1,9 @@ name: Release for Macos -on: [push] +on: + push: + tags: + - 'v[0-9]+\.[0-9]+\.[0-9]+' jobs: release: @@ -22,3 +25,21 @@ jobs: run: | pip install -r requirements.txt bazel build --config=macos_x86_64 --remote_cache=http://${{ secrets.BAZEL_CACHE }}:8080 @maple2jax//:jax_xc_wheel + - name: Upload artifact + uses: actions/upload-artifact@main + with: + name: macos_wheel + path: bazel-bin/external/maple2jax/*.whl + publish: + runs-on: ubuntu-latest + needs: release + steps: + - name: Download artifact + uses: actions/download-artifact@main + with: + name: macos_wheel + path: dist + - name: Publish package to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6401e71..bb6d325 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,5 +1,5 @@ # Action name -name: Release Wheel +name: Release for Linux on: push: @@ -11,24 +11,25 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.9', '3.10', '3.11'] - container: - image: ghcr.io/sail-sg/jax-xc-image:latest + python-version: ['3.9', '3.10', '3.11', '3.12'] steps: - name: Cancel previous run uses: styfle/cancel-workflow-action@0.9.1 with: access_token: ${{ github.token }} - uses: actions/checkout@v2 - - name: Setup Python-${{ matrix.python-version }} and Build + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Build run: | - eval "$(pyenv init -)" && pyenv global ${{ matrix.python-version }}-dev pip install -r requirements.txt bazel build --config=linux --remote_cache=http://${{ secrets.BAZEL_CACHE }}:8080 @maple2jax//:jax_xc_wheel - name: Upload artifact uses: actions/upload-artifact@main with: - name: wheel + name: linux_wheel path: bazel-bin/external/maple2jax/*.whl publish: runs-on: ubuntu-latest @@ -37,7 +38,7 @@ jobs: - name: Download artifact uses: actions/download-artifact@main with: - name: wheel + name: linux_wheel path: dist - name: Publish package to PyPI uses: pypa/gh-action-pypi-publish@release/v1 From bf5ec289abcf469b69d9e21508fce500d672c168 Mon Sep 17 00:00:00 2001 From: linmin Date: Mon, 4 Dec 2023 17:03:06 +0800 Subject: [PATCH 11/35] rename workflow --- .github/workflows/{release.yml => linux.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{release.yml => linux.yml} (100%) diff --git a/.github/workflows/release.yml b/.github/workflows/linux.yml similarity index 100% rename from .github/workflows/release.yml rename to .github/workflows/linux.yml From 07dc4eca0bc6ea5e2c4eaff08134e545988c53c7 Mon Sep 17 00:00:00 2001 From: linmin Date: Mon, 4 Dec 2023 17:05:46 +0800 Subject: [PATCH 12/35] test windows pipeline --- .bazelrc | 3 +++ .github/workflows/test.yml | 11 ++++++----- .github/workflows/windows.yml | 29 +++++++++++++++++++++++++++++ maple2jax/wheel.BUILD | 9 +++++++++ 4 files changed, 47 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/windows.yml diff --git a/.bazelrc b/.bazelrc index dae7fcb..b58a78c 100644 --- a/.bazelrc +++ b/.bazelrc @@ -6,3 +6,6 @@ build:linux --define os=linux --define cpu=x86_64 build:macos_x86_64 --define os=macos --define cpu=x86_64 build:macos_arm64 --define os=macos --define cpu=arm64 + +build:windows_x86_64 --define os=windows --define cpu=x86_64 +build:windows_arm64 --define os=windows --define cpu=arm64 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0da960f..f2fb84c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,16 +5,17 @@ on: [push, pull_request] jobs: test: runs-on: ubuntu-latest - container: - image: ghcr.io/sail-sg/jax-xc-image:latest steps: - name: Cancel previous run uses: styfle/cancel-workflow-action@0.9.1 with: access_token: ${{ github.token }} - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.12 - name: Test run: | - eval "$(pyenv init -)" && pyenv global 3.11-dev - pip install --upgrade -r requirements.txt - bazel test --test_output=all --remote_cache=http://${{ secrets.BAZEL_CACHE }}:8080 //tests/... + pip install -r requirements.txt + bazel test --config=linux --test_output=all --remote_cache=http://${{ secrets.BAZEL_CACHE }}:8080 //tests/... diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 0000000..2b25e65 --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,29 @@ +name: Release for Macos + +on: [push] + +jobs: + release: + runs-on: windows-2019 + strategy: + matrix: + python-version: ['3.9', '3.10', '3.11', '3.12'] + steps: + - name: Cancel previous run + uses: styfle/cancel-workflow-action@0.9.1 + with: + access_token: ${{ github.token }} + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Build + run: | + pip install -r requirements.txt + bazel build --config=windows_x86_64 --remote_cache=http://${{ secrets.BAZEL_CACHE }}:8080 @maple2jax//:jax_xc_wheel + - name: Upload artifact + uses: actions/upload-artifact@main + with: + name: macos_wheel + path: bazel-bin/external/maple2jax/*.whl diff --git a/maple2jax/wheel.BUILD b/maple2jax/wheel.BUILD index fac8f94..67ec457 100644 --- a/maple2jax/wheel.BUILD +++ b/maple2jax/wheel.BUILD @@ -26,6 +26,14 @@ selects.config_setting_group( ], ) +selects.config_setting_group( + name = "windows_x86_64", + match_all = [ + "@platforms//os:windows", + "@platforms//cpu:x86_64", + ], +) + py_wheel( name = "jax_xc_wheel", abi = abi_tag(), @@ -41,6 +49,7 @@ py_wheel( ":macos_arm64": "macosx_11_0_arm64", ":macos_x86_64": "macosx_11_0_x86_64", ":linux_x86_64": "manylinux_2_17_x86_64", + ":windows_x86_64": "win_amd64", "//conditions:default": "manylinux_2_17_x86_64", }), python_requires = ">=3.9", From 3363b9fcedd83966d569ea54b5d5a7219c562ff6 Mon Sep 17 00:00:00 2001 From: linmin Date: Mon, 4 Dec 2023 17:21:50 +0800 Subject: [PATCH 13/35] validate python version --- .github/workflows/windows.yml | 11 ++++++++++- requirements.txt | 1 - 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 2b25e65..fbb1504 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -1,4 +1,4 @@ -name: Release for Macos +name: Release for Windows on: [push] @@ -18,6 +18,15 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + - name: Validate version + run: | + $pythonVersion = (python --version) + if ("Python ${{ matrix.python-version }}" -ne "$pythonVersion"){ + Write-Host "The current version is $pythonVersion; expected version is ${{ matrix.python-version }}" + exit 1 + } + $pythonVersion + shell: pwsh - name: Build run: | pip install -r requirements.txt diff --git a/requirements.txt b/requirements.txt index 9b9165f..30c37c0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,6 @@ tensorflow-probability jinja2 absl-py numpy -pyscf regex jaxtyping autofd From 7e45b3586b5b3d29985757fb4f7bb924f98380cc Mon Sep 17 00:00:00 2001 From: linmin Date: Mon, 4 Dec 2023 17:24:47 +0800 Subject: [PATCH 14/35] try out this --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index fbb1504..90b65ec 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -26,11 +26,11 @@ jobs: exit 1 } $pythonVersion - shell: pwsh - name: Build run: | pip install -r requirements.txt bazel build --config=windows_x86_64 --remote_cache=http://${{ secrets.BAZEL_CACHE }}:8080 @maple2jax//:jax_xc_wheel + shell: pwsh - name: Upload artifact uses: actions/upload-artifact@main with: From 075ad92c22cdf5b62ece2eb6870e8a18c055da41 Mon Sep 17 00:00:00 2001 From: linmin Date: Mon, 4 Dec 2023 17:26:56 +0800 Subject: [PATCH 15/35] remove validation --- .github/workflows/windows.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 90b65ec..44c3f18 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -18,14 +18,6 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Validate version - run: | - $pythonVersion = (python --version) - if ("Python ${{ matrix.python-version }}" -ne "$pythonVersion"){ - Write-Host "The current version is $pythonVersion; expected version is ${{ matrix.python-version }}" - exit 1 - } - $pythonVersion - name: Build run: | pip install -r requirements.txt From b85d20246896fdba16e8879b67880e9f2fb1cbab Mon Sep 17 00:00:00 2001 From: linmin Date: Mon, 4 Dec 2023 18:31:47 +0800 Subject: [PATCH 16/35] debug --- maple2jax/python.bzl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/maple2jax/python.bzl b/maple2jax/python.bzl index f5fb109..cfbc9c8 100644 --- a/maple2jax/python.bzl +++ b/maple2jax/python.bzl @@ -40,6 +40,8 @@ def _get_python_tag(rctx, python_bin): "version = platform.python_version_tuple();" + "print(f'cp{version[0]}{version[1]}')", ]) + print(result.stdout) + print(result.stderr) return result.stdout.splitlines()[0] def _get_abi_tag(rctx, python_bin): @@ -52,6 +54,8 @@ def _get_abi_tag(rctx, python_bin): "version = platform.python_version_tuple();" + "print(f'cp{version[0]}{version[1]}{sys.abiflags}')", ]) + print(result.stdout) + print(result.stderr) return result.stdout.splitlines()[0] def _declare_python_abi_impl(rctx): From 13153237f249806263a04f6ddbf3b968a653bbde Mon Sep 17 00:00:00 2001 From: linmin Date: Mon, 4 Dec 2023 18:42:22 +0800 Subject: [PATCH 17/35] debug --- .github/workflows/windows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 44c3f18..77ccb87 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -20,6 +20,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Build run: | + python -c "import platform; import sys; print(platform.python_version_tuple()); print(sys.abiflags)" pip install -r requirements.txt bazel build --config=windows_x86_64 --remote_cache=http://${{ secrets.BAZEL_CACHE }}:8080 @maple2jax//:jax_xc_wheel shell: pwsh From c70648f365d61c09a79dd80a459a40693a94798a Mon Sep 17 00:00:00 2001 From: linmin Date: Mon, 4 Dec 2023 18:44:31 +0800 Subject: [PATCH 18/35] debug --- .github/workflows/windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 77ccb87..e9b6dca 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -21,8 +21,8 @@ jobs: - name: Build run: | python -c "import platform; import sys; print(platform.python_version_tuple()); print(sys.abiflags)" - pip install -r requirements.txt - bazel build --config=windows_x86_64 --remote_cache=http://${{ secrets.BAZEL_CACHE }}:8080 @maple2jax//:jax_xc_wheel + # pip install -r requirements.txt + # bazel build --config=windows_x86_64 --remote_cache=http://${{ secrets.BAZEL_CACHE }}:8080 @maple2jax//:jax_xc_wheel shell: pwsh - name: Upload artifact uses: actions/upload-artifact@main From 09c937103b56abfdfb7d54669fee54e52a58488f Mon Sep 17 00:00:00 2001 From: linmin Date: Mon, 4 Dec 2023 18:49:11 +0800 Subject: [PATCH 19/35] fix abi error for windows --- maple2jax/python.bzl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/maple2jax/python.bzl b/maple2jax/python.bzl index cfbc9c8..7412d95 100644 --- a/maple2jax/python.bzl +++ b/maple2jax/python.bzl @@ -40,8 +40,6 @@ def _get_python_tag(rctx, python_bin): "version = platform.python_version_tuple();" + "print(f'cp{version[0]}{version[1]}')", ]) - print(result.stdout) - print(result.stderr) return result.stdout.splitlines()[0] def _get_abi_tag(rctx, python_bin): @@ -54,9 +52,11 @@ def _get_abi_tag(rctx, python_bin): "version = platform.python_version_tuple();" + "print(f'cp{version[0]}{version[1]}{sys.abiflags}')", ]) - print(result.stdout) - print(result.stderr) - return result.stdout.splitlines()[0] + lines = result.stdout.splitlines() + if len(lines) == 0: + return "" + else: + return lines[0] def _declare_python_abi_impl(rctx): python_bin = _get_python_bin(rctx) From c94b46d173b7876d2a78e0886990d7109a7906f9 Mon Sep 17 00:00:00 2001 From: linmin Date: Mon, 4 Dec 2023 18:49:26 +0800 Subject: [PATCH 20/35] restore --- .github/workflows/windows.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index e9b6dca..44c3f18 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -20,9 +20,8 @@ jobs: python-version: ${{ matrix.python-version }} - name: Build run: | - python -c "import platform; import sys; print(platform.python_version_tuple()); print(sys.abiflags)" - # pip install -r requirements.txt - # bazel build --config=windows_x86_64 --remote_cache=http://${{ secrets.BAZEL_CACHE }}:8080 @maple2jax//:jax_xc_wheel + pip install -r requirements.txt + bazel build --config=windows_x86_64 --remote_cache=http://${{ secrets.BAZEL_CACHE }}:8080 @maple2jax//:jax_xc_wheel shell: pwsh - name: Upload artifact uses: actions/upload-artifact@main From d802912703dcf2015fe5cce8b446e8afe92e723c Mon Sep 17 00:00:00 2001 From: linmin Date: Mon, 4 Dec 2023 19:06:35 +0800 Subject: [PATCH 21/35] f**k windows --- maple2jax/libxc/gen_build.py | 4 ++-- maple2jax/libxc/wrap.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/maple2jax/libxc/gen_build.py b/maple2jax/libxc/gen_build.py index 07eaf95..ded1ee4 100644 --- a/maple2jax/libxc/gen_build.py +++ b/maple2jax/libxc/gen_build.py @@ -25,10 +25,10 @@ def main(_): else: c_file_basenames.append(basename) - with open(FLAGS.template, "r") as f: + with open(FLAGS.template, "r", encoding="utf8") as f: template = Template(f.read(), trim_blocks=True, lstrip_blocks=True) build = template.render(c_file_basenames=c_file_basenames) - with open(FLAGS.build, "w") as out: + with open(FLAGS.build, "w", encoding="utf8") as out: out.write(build) diff --git a/maple2jax/libxc/wrap.py b/maple2jax/libxc/wrap.py index ce17c22..d31e56b 100644 --- a/maple2jax/libxc/wrap.py +++ b/maple2jax/libxc/wrap.py @@ -18,7 +18,7 @@ def wrap_file(filename, out): - with open(filename, "r") as f: + with open(filename, "r", encoding="utf8") as f: content = f.read() # find all init function and the corresponding param struct name results = re.findall( @@ -74,14 +74,14 @@ def wrap_file(filename, out): fields.extend(members) register_struct.append((s, fields, struct_to_init[s])) - with open(FLAGS.template, "r") as f: + with open(FLAGS.template, "r", encoding="utf8") as f: t = Template(f.read(), trim_blocks=True, lstrip_blocks=True) content = t.render( filename=os.path.basename(filename), register_struct=register_struct, register_maple=register_maple, ) - with open(FLAGS.out, "wt") as fout: + with open(FLAGS.out, "wt", encoding="utf8") as fout: fout.write(content) From ce4995604e6ae79c58963ad7cdf3bc4f4691e7ef Mon Sep 17 00:00:00 2001 From: mavenlin Date: Mon, 4 Dec 2023 19:32:40 +0800 Subject: [PATCH 22/35] Update .bazelrc Pass correct flag to windows --- .bazelrc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.bazelrc b/.bazelrc index b58a78c..4cf9e2f 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,4 +1,7 @@ -build --copt=-g0 --copt=-O3 --copt=-DNDEBUG +build:linux --copt=-g0 --copt=-O3 --copt=-DNDEBUG +build:macos_x86_64 --copt=-g0 --copt=-O3 --copt=-DNDEBUG +build:macos_arm64 --copt=-g0 --copt=-O3 --copt=-DNDEBUG +build:windows_x86_64 -c opt build:linux --action_env=BAZEL_LINKLIBS=-l%:libstdc++.a:-lm build:linux --action_env=BAZEL_LINKOPTS=-static-libgcc From 5e020f1cec3e8e0d614e1370813c957f61e6596e Mon Sep 17 00:00:00 2001 From: mavenlin Date: Mon, 4 Dec 2023 20:25:27 +0800 Subject: [PATCH 23/35] Use clang --- .bazelrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bazelrc b/.bazelrc index 4cf9e2f..1b2a99d 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,7 +1,7 @@ build:linux --copt=-g0 --copt=-O3 --copt=-DNDEBUG build:macos_x86_64 --copt=-g0 --copt=-O3 --copt=-DNDEBUG build:macos_arm64 --copt=-g0 --copt=-O3 --copt=-DNDEBUG -build:windows_x86_64 -c opt +build:windows_x86_64 -c opt --compiler=clang-cl build:linux --action_env=BAZEL_LINKLIBS=-l%:libstdc++.a:-lm build:linux --action_env=BAZEL_LINKOPTS=-static-libgcc From 6e5db42f358f4beee6a4a845b1caeb92200ee30a Mon Sep 17 00:00:00 2001 From: mavenlin Date: Mon, 4 Dec 2023 22:24:29 +0800 Subject: [PATCH 24/35] split into many rules for better caching --- maple2jax/libxc/build.jinja | 44 ++++++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/maple2jax/libxc/build.jinja b/maple2jax/libxc/build.jinja index f76c943..1a74baa 100644 --- a/maple2jax/libxc/build.jinja +++ b/maple2jax/libxc/build.jinja @@ -35,6 +35,18 @@ cc_library( visibility = ["//visibility:public"], ) +cc_library( + name = "register", + hdrs = [ + "src_cc/register.h", + ], + deps = [ + ":xc_inc", + "@visit_struct", + "@pybind11", + ], +) + {% for src in c_file_basenames %} genrule( name = "gen_{{ src }}c", @@ -44,6 +56,26 @@ genrule( tools = [":wrap", ":wrap.cc.jinja"], ) +cc_library( + name = "{{ src }}c.obj", + srcs = ["src_cc/{{ src }}c"], + deps = [ + ":xc_inc", + ":register", + ], + includes = [ + ".", + "src", + ], + local_defines = [ + "XC_DONT_COMPILE_VXC", + "XC_DONT_COMPILE_FXC", + "XC_DONT_COMPILE_KXC", + "XC_DONT_COMPILE_LXC", + ], + alwayslink = True, +) + {% endfor %} cc_binary( @@ -54,10 +86,6 @@ cc_binary( "-parse_headers", ], linkshared = 1, - includes = [ - ".", - "src", - ], local_defines = [ "XC_DONT_COMPILE_VXC", "XC_DONT_COMPILE_FXC", @@ -69,14 +97,14 @@ cc_binary( "@visit_struct", "@pybind11", "@local_config_python//:python_headers", + ":register", +{% for basename in c_file_basenames %} + ":{{ basename }}c.obj", +{% endfor %} ], srcs = [ - "src_cc/register.h", "src_cc/register.cc", "src_cc/libxc.cc", -{% for basename in c_file_basenames %} - "src_cc/{{ basename }}c", -{% endfor %} ], visibility = ["//visibility:public"], ) From 618596812a9e0773ba20376aad9bdb4ff6c553f8 Mon Sep 17 00:00:00 2001 From: mavenlin Date: Mon, 4 Dec 2023 23:22:32 +0800 Subject: [PATCH 25/35] pass different flag for windows --- maple2jax/libxc/build.jinja | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/maple2jax/libxc/build.jinja b/maple2jax/libxc/build.jinja index 1a74baa..b3f8712 100644 --- a/maple2jax/libxc/build.jinja +++ b/maple2jax/libxc/build.jinja @@ -80,18 +80,15 @@ cc_library( cc_binary( name = "libxc.so", - copts = ["-std=c++14", "-fexceptions"], + copts = select({ + "@platforms//os:windows": [], + "//conditions:default": ["-std=c++14", "-fexceptions"], + }), features = [ "-use_header_modules", # Required for pybind11. "-parse_headers", ], linkshared = 1, - local_defines = [ - "XC_DONT_COMPILE_VXC", - "XC_DONT_COMPILE_FXC", - "XC_DONT_COMPILE_KXC", - "XC_DONT_COMPILE_LXC", - ], deps = [ ":xc_inc", "@visit_struct", From 0b4de9b48d3f37a9b5b7d236ff1c5ffcad91cb0c Mon Sep 17 00:00:00 2001 From: mavenlin Date: Mon, 4 Dec 2023 23:26:34 +0800 Subject: [PATCH 26/35] debug 3.9 only --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 44c3f18..851b5c5 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -7,7 +7,7 @@ jobs: runs-on: windows-2019 strategy: matrix: - python-version: ['3.9', '3.10', '3.11', '3.12'] + python-version: ['3.9'] steps: - name: Cancel previous run uses: styfle/cancel-workflow-action@0.9.1 From 613ecc30bab20fa015bc9e5ef2b85f912b99c271 Mon Sep 17 00:00:00 2001 From: mavenlin Date: Mon, 4 Dec 2023 23:34:38 +0800 Subject: [PATCH 27/35] cat link params --- .github/workflows/windows.yml | 1 + maple2jax/libxc/build.jinja | 13 +++---------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 851b5c5..444b08a 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -22,6 +22,7 @@ jobs: run: | pip install -r requirements.txt bazel build --config=windows_x86_64 --remote_cache=http://${{ secrets.BAZEL_CACHE }}:8080 @maple2jax//:jax_xc_wheel + cat bazel-out/x64_windows-opt-exec-2B5CBBC6/bin/external/maple2jax/jax_xc/libxc.so-2.params shell: pwsh - name: Upload artifact uses: actions/upload-artifact@main diff --git a/maple2jax/libxc/build.jinja b/maple2jax/libxc/build.jinja index b3f8712..05e3b93 100644 --- a/maple2jax/libxc/build.jinja +++ b/maple2jax/libxc/build.jinja @@ -78,22 +78,15 @@ cc_library( {% endfor %} -cc_binary( - name = "libxc.so", +pybind_extension( + name = "libxc", copts = select({ "@platforms//os:windows": [], - "//conditions:default": ["-std=c++14", "-fexceptions"], + "//conditions:default": ["-std=c++14"], }), - features = [ - "-use_header_modules", # Required for pybind11. - "-parse_headers", - ], - linkshared = 1, deps = [ ":xc_inc", "@visit_struct", - "@pybind11", - "@local_config_python//:python_headers", ":register", {% for basename in c_file_basenames %} ":{{ basename }}c.obj", From 85a20d8a985b89f6ed7d8ae4624e5a6e29de4a10 Mon Sep 17 00:00:00 2001 From: mavenlin Date: Mon, 4 Dec 2023 23:54:19 +0800 Subject: [PATCH 28/35] verbose --- .github/workflows/windows.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 444b08a..639ee31 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -21,8 +21,7 @@ jobs: - name: Build run: | pip install -r requirements.txt - bazel build --config=windows_x86_64 --remote_cache=http://${{ secrets.BAZEL_CACHE }}:8080 @maple2jax//:jax_xc_wheel - cat bazel-out/x64_windows-opt-exec-2B5CBBC6/bin/external/maple2jax/jax_xc/libxc.so-2.params + bazel build --verbose_failures -s --config=windows_x86_64 --remote_cache=http://${{ secrets.BAZEL_CACHE }}:8080 @maple2jax//:jax_xc_wheel shell: pwsh - name: Upload artifact uses: actions/upload-artifact@main From ee33187e213b7f33e0d44c8dc97a04fa861dabef Mon Sep 17 00:00:00 2001 From: mavenlin Date: Tue, 5 Dec 2023 00:01:13 +0800 Subject: [PATCH 29/35] export all symbols --- maple2jax/libxc/build.jinja | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/maple2jax/libxc/build.jinja b/maple2jax/libxc/build.jinja index 05e3b93..9c66944 100644 --- a/maple2jax/libxc/build.jinja +++ b/maple2jax/libxc/build.jinja @@ -59,6 +59,10 @@ genrule( cc_library( name = "{{ src }}c.obj", srcs = ["src_cc/{{ src }}c"], + features = select({ + "@platforms//os:windows": ["windows_export_all_symbols"], + "//conditions:default": [], + }), deps = [ ":xc_inc", ":register", @@ -84,6 +88,10 @@ pybind_extension( "@platforms//os:windows": [], "//conditions:default": ["-std=c++14"], }), + features = select({ + "@platforms//os:windows": ["windows_export_all_symbols"], + "//conditions:default": [], + }), deps = [ ":xc_inc", "@visit_struct", From 4810c8f14ffc69c56ac488f8880929f435bf7cc6 Mon Sep 17 00:00:00 2001 From: mavenlin Date: Tue, 5 Dec 2023 00:19:21 +0800 Subject: [PATCH 30/35] directly add features --- maple2jax/libxc/build.jinja | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/maple2jax/libxc/build.jinja b/maple2jax/libxc/build.jinja index 9c66944..b3af7d2 100644 --- a/maple2jax/libxc/build.jinja +++ b/maple2jax/libxc/build.jinja @@ -59,10 +59,7 @@ genrule( cc_library( name = "{{ src }}c.obj", srcs = ["src_cc/{{ src }}c"], - features = select({ - "@platforms//os:windows": ["windows_export_all_symbols"], - "//conditions:default": [], - }), + features = ["windows_export_all_symbols"], deps = [ ":xc_inc", ":register", @@ -88,10 +85,7 @@ pybind_extension( "@platforms//os:windows": [], "//conditions:default": ["-std=c++14"], }), - features = select({ - "@platforms//os:windows": ["windows_export_all_symbols"], - "//conditions:default": [], - }), + features = ["windows_export_all_symbols"], deps = [ ":xc_inc", "@visit_struct", From 2e04b0b28f3c00b6ea010dd5c0eeead706d8e0b6 Mon Sep 17 00:00:00 2001 From: mavenlin Date: Tue, 5 Dec 2023 00:32:42 +0800 Subject: [PATCH 31/35] try cat again --- .github/workflows/windows.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 639ee31..c4b536d 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -20,8 +20,10 @@ jobs: python-version: ${{ matrix.python-version }} - name: Build run: | + cat @bazel-out/x64_windows-opt-exec-2B5CBBC6/bin/external/maple2jax/jax_xc/libxc/libxc.so-2.params pip install -r requirements.txt - bazel build --verbose_failures -s --config=windows_x86_64 --remote_cache=http://${{ secrets.BAZEL_CACHE }}:8080 @maple2jax//:jax_xc_wheel + bazel build --config=windows_x86_64 --remote_cache=http://${{ secrets.BAZEL_CACHE }}:8080 @maple2jax//:jax_xc_wheel + cat @bazel-out/x64_windows-opt-exec-2B5CBBC6/bin/external/maple2jax/jax_xc/libxc/libxc.so-2.params shell: pwsh - name: Upload artifact uses: actions/upload-artifact@main From 5ae2d8ad9ae45cd82fb1b56cdb793e4802672f5b Mon Sep 17 00:00:00 2001 From: mavenlin Date: Tue, 5 Dec 2023 00:35:38 +0800 Subject: [PATCH 32/35] don't run windows build --- .github/workflows/windows.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index c4b536d..9b48587 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -1,6 +1,7 @@ name: Release for Windows -on: [push] +# Don't run yet, it fails at linking, very difficult to debug with only a remote runner. +# on: [push] jobs: release: @@ -20,10 +21,8 @@ jobs: python-version: ${{ matrix.python-version }} - name: Build run: | - cat @bazel-out/x64_windows-opt-exec-2B5CBBC6/bin/external/maple2jax/jax_xc/libxc/libxc.so-2.params pip install -r requirements.txt bazel build --config=windows_x86_64 --remote_cache=http://${{ secrets.BAZEL_CACHE }}:8080 @maple2jax//:jax_xc_wheel - cat @bazel-out/x64_windows-opt-exec-2B5CBBC6/bin/external/maple2jax/jax_xc/libxc/libxc.so-2.params shell: pwsh - name: Upload artifact uses: actions/upload-artifact@main From 4624871d7bac383c93adc3188b0e564402c4afba Mon Sep 17 00:00:00 2001 From: mavenlin Date: Tue, 5 Dec 2023 00:37:23 +0800 Subject: [PATCH 33/35] nothing changed, but just build for more platforms --- maple2jax/__init__.py | 2 +- maple2jax/wheel.BUILD | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/maple2jax/__init__.py b/maple2jax/__init__.py index 61ef665..07e97d1 100644 --- a/maple2jax/__init__.py +++ b/maple2jax/__init__.py @@ -7,4 +7,4 @@ from .functionals import * # noqa from . import experimental # noqa -__version__ = "0.0.9" +__version__ = "0.0.10" diff --git a/maple2jax/wheel.BUILD b/maple2jax/wheel.BUILD index 67ec457..814314f 100644 --- a/maple2jax/wheel.BUILD +++ b/maple2jax/wheel.BUILD @@ -60,7 +60,7 @@ py_wheel( "tensorflow-probability", "autofd", ], - version = "0.0.9", + version = "0.0.10", deps = [ "@maple2jax//jax_xc", "@maple2jax//jax_xc:experimental", From d031b81c0b7c27b148488ba9fb92419e428f8b7f Mon Sep 17 00:00:00 2001 From: mavenlin Date: Tue, 5 Dec 2023 00:38:28 +0800 Subject: [PATCH 34/35] fix indent --- maple2jax/python.bzl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/maple2jax/python.bzl b/maple2jax/python.bzl index 7412d95..16d8003 100644 --- a/maple2jax/python.bzl +++ b/maple2jax/python.bzl @@ -54,9 +54,9 @@ def _get_abi_tag(rctx, python_bin): ]) lines = result.stdout.splitlines() if len(lines) == 0: - return "" + return "" else: - return lines[0] + return lines[0] def _declare_python_abi_impl(rctx): python_bin = _get_python_bin(rctx) From c723727ab3a91e4d971c65faedfae3b2d157c830 Mon Sep 17 00:00:00 2001 From: mavenlin Date: Tue, 5 Dec 2023 00:41:47 +0800 Subject: [PATCH 35/35] fix order --- maple2jax/wheel.BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maple2jax/wheel.BUILD b/maple2jax/wheel.BUILD index 814314f..593eeff 100644 --- a/maple2jax/wheel.BUILD +++ b/maple2jax/wheel.BUILD @@ -1,6 +1,6 @@ +load("@bazel_skylib//lib:selects.bzl", "selects") load("@python_abi//:abi.bzl", "abi_tag", "python_tag") load("@rules_python//python:packaging.bzl", "py_wheel") -load("@bazel_skylib//lib:selects.bzl", "selects") selects.config_setting_group( name = "macos_arm64",