This is an automated email from the ASF dual-hosted git repository.

yuxia pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fluss-rust.git


The following commit(s) were added to refs/heads/main by this push:
     new b5f1284  ci: fix ci build wheel issue for python (#419)
b5f1284 is described below

commit b5f1284bab8ea4eb4874de0cfefdc370efa9902b
Author: yuxia Luo <[email protected]>
AuthorDate: Tue Mar 3 20:02:30 2026 +0800

    ci: fix ci build wheel issue for python (#419)
---
 .github/workflows/release_python.yml | 24 +++++++++++++++++++++++-
 bindings/python/Cargo.toml           |  2 +-
 2 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/release_python.yml 
b/.github/workflows/release_python.yml
index d7bd04c..7be7171 100644
--- a/.github/workflows/release_python.yml
+++ b/.github/workflows/release_python.yml
@@ -94,9 +94,10 @@ jobs:
 
       - name: Install protoc (Windows)
         if: runner.os == 'Windows'
-        run: choco install protobuf -y
+        run: choco install protoc -y
         shell: pwsh
 
+      # Install protoc in manylinux container (x86_64/aarch64); script shared 
via YAML anchor
       - uses: PyO3/maturin-action@v1
         with:
           working-directory: bindings/python
@@ -104,6 +105,21 @@ jobs:
           command: build
           args: --release -o dist -i python3.9
           manylinux: ${{ matrix.manylinux || 'auto' }}
+          container: ${{ matrix.os == 'ubuntu-latest' && matrix.target == 
'x86_64' && 'off' || '' }}
+          before-script-linux: &protoc-install |
+            set -e
+            ARCH=$(uname -m)
+            case "$ARCH" in
+              x86_64)  ZIP=protoc-27.1-linux-x86_64.zip ;;
+              aarch64) ZIP=protoc-27.1-linux-aarch_64.zip ;;
+              *) echo "Unsupported arch $ARCH"; exit 1 ;;
+            esac
+            curl -sLO 
"https://github.com/protocolbuffers/protobuf/releases/download/v27.1/${ZIP}";
+            python3 -c "import zipfile; 
zipfile.ZipFile('${ZIP}').extractall('/tmp/protoc_install')"
+            chmod +x /tmp/protoc_install/bin/protoc
+            rm -f "${ZIP}"
+            export PATH="/tmp/protoc_install/bin:$PATH"
+            export PROTOC=/tmp/protoc_install/bin/protoc
       - uses: PyO3/maturin-action@v1
         with:
           working-directory: bindings/python
@@ -111,6 +127,8 @@ jobs:
           command: build
           args: --release -o dist -i python3.10
           manylinux: ${{ matrix.manylinux || 'auto' }}
+          container: ${{ matrix.os == 'ubuntu-latest' && matrix.target == 
'x86_64' && 'off' || '' }}
+          before-script-linux: *protoc-install
       - uses: PyO3/maturin-action@v1
         with:
           working-directory: bindings/python
@@ -118,6 +136,8 @@ jobs:
           command: build
           args: --release -o dist -i python3.11
           manylinux: ${{ matrix.manylinux || 'auto' }}
+          container: ${{ matrix.os == 'ubuntu-latest' && matrix.target == 
'x86_64' && 'off' || '' }}
+          before-script-linux: *protoc-install
       - uses: PyO3/maturin-action@v1
         with:
           working-directory: bindings/python
@@ -125,6 +145,8 @@ jobs:
           command: build
           args: --release -o dist -i python3.12
           manylinux: ${{ matrix.manylinux || 'auto' }}
+          container: ${{ matrix.os == 'ubuntu-latest' && matrix.target == 
'x86_64' && 'off' || '' }}
+          before-script-linux: *protoc-install
 
       - name: Upload wheels
         uses: actions/upload-artifact@v4
diff --git a/bindings/python/Cargo.toml b/bindings/python/Cargo.toml
index 9cf20e3..30ac046 100644
--- a/bindings/python/Cargo.toml
+++ b/bindings/python/Cargo.toml
@@ -27,7 +27,7 @@ name = "fluss"
 crate-type = ["cdylib"]
 
 [dependencies]
-pyo3 = { version = "0.26.0", features = ["extension-module"] }
+pyo3 = { version = "0.26.0", features = ["extension-module", 
"generate-import-lib"] }
 fluss = { workspace = true, features = ["storage-all"] }
 tokio = { workspace = true }
 arrow = { workspace = true }

Reply via email to