From 618fa2d425b7df4bdf5062cfd62c459fbb6fd6fe Mon Sep 17 00:00:00 2001 From: tsai Date: Tue, 28 Nov 2023 10:31:39 +0800 Subject: [PATCH 01/12] try add --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 65865733e..d9dfcac9a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,6 +40,7 @@ jobs: nif: ["2.16"] job: - { target: x86_64-unknown-linux-gnu, os: ubuntu-22.04 } + - { target: aarch64-apple-darwin, os: macos-11 } steps: - uses: actions/checkout@v3 - name: Set up Elixir From b4105617ba6caa494061d526655f6ec9d6e46499 Mon Sep 17 00:00:00 2001 From: tsai Date: Tue, 28 Nov 2023 14:44:34 +0800 Subject: [PATCH 02/12] add --- .github/workflows/release.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d9dfcac9a..c8b57c93a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -48,6 +48,10 @@ jobs: with: elixir-version: "1.14.0" # Define the elixir version [required] otp-version: "24.2" # Define the OTP version [required] + - name: Build with cibuildwheel + run: | + pip install cibuildwheel + cibuildwheel --output-dir wheelhouse - name: Set up Zig uses: goto-bus-stop/setup-zig@v2 with: From daab88db6a8be86306fda78f6c7dd697b862dbd8 Mon Sep 17 00:00:00 2001 From: tsai Date: Wed, 29 Nov 2023 15:37:49 +0800 Subject: [PATCH 03/12] add files --- native/py_proj/README.md | 3 +++ native/py_proj/pyproject.toml | 0 2 files changed, 3 insertions(+) create mode 100644 native/py_proj/README.md create mode 100644 native/py_proj/pyproject.toml diff --git a/native/py_proj/README.md b/native/py_proj/README.md new file mode 100644 index 000000000..4c2e65da1 --- /dev/null +++ b/native/py_proj/README.md @@ -0,0 +1,3 @@ +# Python Project for Beaver + +This project is created to make use of pip wheels tools to create multiple platform builds. diff --git a/native/py_proj/pyproject.toml b/native/py_proj/pyproject.toml new file mode 100644 index 000000000..e69de29bb From 13e6cb88931ba09e17e7bdcc6ea98507256182e1 Mon Sep 17 00:00:00 2001 From: tsai Date: Wed, 29 Nov 2023 15:40:56 +0800 Subject: [PATCH 04/12] refine steps --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c8b57c93a..96a200728 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -45,10 +45,12 @@ jobs: - uses: actions/checkout@v3 - name: Set up Elixir uses: erlef/setup-beam@v1 + if: contains(matrix.job.os, 'ubuntu') with: elixir-version: "1.14.0" # Define the elixir version [required] otp-version: "24.2" # Define the OTP version [required] - name: Build with cibuildwheel + working-directory: native/py_proj run: | pip install cibuildwheel cibuildwheel --output-dir wheelhouse From 950d6b54de5fd78a0ba2967f751b7d7c3e4bbbf6 Mon Sep 17 00:00:00 2001 From: tsai Date: Thu, 30 Nov 2023 11:05:45 +0800 Subject: [PATCH 05/12] CIBW_BUILD_VERBOSITY --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 96a200728..9584c24c0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -51,6 +51,8 @@ jobs: otp-version: "24.2" # Define the OTP version [required] - name: Build with cibuildwheel working-directory: native/py_proj + env: + CIBW_BUILD_VERBOSITY: 1 run: | pip install cibuildwheel cibuildwheel --output-dir wheelhouse From 09d5b0115390c6826b4462c1b9b396a17f9d79df Mon Sep 17 00:00:00 2001 From: tsai Date: Thu, 30 Nov 2023 11:15:40 +0800 Subject: [PATCH 06/12] add settings --- .github/workflows/release.yml | 2 -- native/py_proj/pyproject.toml | 6 ++++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9584c24c0..96a200728 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -51,8 +51,6 @@ jobs: otp-version: "24.2" # Define the OTP version [required] - name: Build with cibuildwheel working-directory: native/py_proj - env: - CIBW_BUILD_VERBOSITY: 1 run: | pip install cibuildwheel cibuildwheel --output-dir wheelhouse diff --git a/native/py_proj/pyproject.toml b/native/py_proj/pyproject.toml index e69de29bb..8bbe86125 100644 --- a/native/py_proj/pyproject.toml +++ b/native/py_proj/pyproject.toml @@ -0,0 +1,6 @@ +[tool.cibuildwheel] +build-verbosity = 3 +build = "cp310-*" +skip = ["*-manylinux_i686", "*-musllinux*"] +manylinux-aarch64-image = "manylinux_2_28" +manylinux-x86_64-image = "manylinux_2_28" From eef1c696b92d81a11f53ab410380ba97f7651fd8 Mon Sep 17 00:00:00 2001 From: tsai Date: Thu, 30 Nov 2023 11:27:00 +0800 Subject: [PATCH 07/12] add docker install --- native/py_proj/docker_prepare_elixir.sh | 17 +++++++++++++++++ native/py_proj/pyproject.toml | 3 +++ 2 files changed, 20 insertions(+) create mode 100644 native/py_proj/docker_prepare_elixir.sh diff --git a/native/py_proj/docker_prepare_elixir.sh b/native/py_proj/docker_prepare_elixir.sh new file mode 100644 index 000000000..681cbb002 --- /dev/null +++ b/native/py_proj/docker_prepare_elixir.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +set -xe + +# manylinux prep +if [[ -f "/etc/centos-release" ]]; then + yum install -y epel-release + yum makecache --refresh + # sometimes the epel server is down. retry 5 times + for i in $(seq 1 5); do + yum install -y elixir zig && s=0 && break || s=$? && sleep 15 + done + +elif [[ -f "/etc/alpine-release" ]]; then + # musllinux prep + # ccache already present + apk add elixir zig +fi diff --git a/native/py_proj/pyproject.toml b/native/py_proj/pyproject.toml index 8bbe86125..31298635e 100644 --- a/native/py_proj/pyproject.toml +++ b/native/py_proj/pyproject.toml @@ -4,3 +4,6 @@ build = "cp310-*" skip = ["*-manylinux_i686", "*-musllinux*"] manylinux-aarch64-image = "manylinux_2_28" manylinux-x86_64-image = "manylinux_2_28" + +[tool.cibuildwheel.linux] +before-build = ["{project}/scripts/docker_prepare_elixir.sh"] From 6fd239e3d57a17ae7b013131a9e4fe6cf94f2643 Mon Sep 17 00:00:00 2001 From: tsai Date: Thu, 30 Nov 2023 11:32:08 +0800 Subject: [PATCH 08/12] fix --- .github/workflows/release.yml | 1 - native/py_proj/pyproject.toml | 5 ++++- native/py_proj/{ => scripts}/docker_prepare_elixir.sh | 0 3 files changed, 4 insertions(+), 2 deletions(-) rename native/py_proj/{ => scripts}/docker_prepare_elixir.sh (100%) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 96a200728..ca63dc2f2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,7 +50,6 @@ jobs: elixir-version: "1.14.0" # Define the elixir version [required] otp-version: "24.2" # Define the OTP version [required] - name: Build with cibuildwheel - working-directory: native/py_proj run: | pip install cibuildwheel cibuildwheel --output-dir wheelhouse diff --git a/native/py_proj/pyproject.toml b/native/py_proj/pyproject.toml index 31298635e..183e64c38 100644 --- a/native/py_proj/pyproject.toml +++ b/native/py_proj/pyproject.toml @@ -6,4 +6,7 @@ manylinux-aarch64-image = "manylinux_2_28" manylinux-x86_64-image = "manylinux_2_28" [tool.cibuildwheel.linux] -before-build = ["{project}/scripts/docker_prepare_elixir.sh"] +before-build = ["{project}/native/py_proj/scripts/docker_prepare_elixir.sh"] + +[tool.cibuildwheel.macos] +before-build = ["brew install zig elixir"] diff --git a/native/py_proj/docker_prepare_elixir.sh b/native/py_proj/scripts/docker_prepare_elixir.sh similarity index 100% rename from native/py_proj/docker_prepare_elixir.sh rename to native/py_proj/scripts/docker_prepare_elixir.sh From 601572c05f0aeceb61e1b404cdf41d04764215e8 Mon Sep 17 00:00:00 2001 From: tsai Date: Thu, 30 Nov 2023 11:33:49 +0800 Subject: [PATCH 09/12] fix --- native/py_proj/pyproject.toml => pyproject.toml | 2 +- {native/py_proj/scripts => scripts}/docker_prepare_elixir.sh | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename native/py_proj/pyproject.toml => pyproject.toml (78%) rename {native/py_proj/scripts => scripts}/docker_prepare_elixir.sh (100%) diff --git a/native/py_proj/pyproject.toml b/pyproject.toml similarity index 78% rename from native/py_proj/pyproject.toml rename to pyproject.toml index 183e64c38..560d099b1 100644 --- a/native/py_proj/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ manylinux-aarch64-image = "manylinux_2_28" manylinux-x86_64-image = "manylinux_2_28" [tool.cibuildwheel.linux] -before-build = ["{project}/native/py_proj/scripts/docker_prepare_elixir.sh"] +before-build = ["{project}/scripts/docker_prepare_elixir.sh"] [tool.cibuildwheel.macos] before-build = ["brew install zig elixir"] diff --git a/native/py_proj/scripts/docker_prepare_elixir.sh b/scripts/docker_prepare_elixir.sh similarity index 100% rename from native/py_proj/scripts/docker_prepare_elixir.sh rename to scripts/docker_prepare_elixir.sh From b2a249025b24ec02510af698811d6a5432376082 Mon Sep 17 00:00:00 2001 From: tsai Date: Thu, 30 Nov 2023 11:37:31 +0800 Subject: [PATCH 10/12] fix permission --- scripts/docker_prepare_elixir.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/docker_prepare_elixir.sh diff --git a/scripts/docker_prepare_elixir.sh b/scripts/docker_prepare_elixir.sh old mode 100644 new mode 100755 From 98e62a3dc9e24649f585aee66baa09d294a9e400 Mon Sep 17 00:00:00 2001 From: tsai Date: Thu, 30 Nov 2023 11:45:23 +0800 Subject: [PATCH 11/12] try fix --- scripts/docker_prepare_elixir.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/docker_prepare_elixir.sh b/scripts/docker_prepare_elixir.sh index 681cbb002..0dd427ec5 100755 --- a/scripts/docker_prepare_elixir.sh +++ b/scripts/docker_prepare_elixir.sh @@ -7,7 +7,7 @@ if [[ -f "/etc/centos-release" ]]; then yum makecache --refresh # sometimes the epel server is down. retry 5 times for i in $(seq 1 5); do - yum install -y elixir zig && s=0 && break || s=$? && sleep 15 + dnf install -y elixir zig && s=0 && break || s=$? && sleep 15 done elif [[ -f "/etc/alpine-release" ]]; then From f596b4537435feab4e96cbf14ea04da6b4e986b7 Mon Sep 17 00:00:00 2001 From: tsai Date: Thu, 30 Nov 2023 11:45:32 +0800 Subject: [PATCH 12/12] fix --- scripts/docker_prepare_elixir.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/docker_prepare_elixir.sh b/scripts/docker_prepare_elixir.sh index 0dd427ec5..3118f62a7 100755 --- a/scripts/docker_prepare_elixir.sh +++ b/scripts/docker_prepare_elixir.sh @@ -3,9 +3,6 @@ set -xe # manylinux prep if [[ -f "/etc/centos-release" ]]; then - yum install -y epel-release - yum makecache --refresh - # sometimes the epel server is down. retry 5 times for i in $(seq 1 5); do dnf install -y elixir zig && s=0 && break || s=$? && sleep 15 done