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

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

commit e497b54e36236d9206c1b5c8eacbd3889afee908
Author: luoyuxia <[email protected]>
AuthorDate: Mon Mar 2 11:43:47 2026 +0800

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

diff --git a/.github/workflows/release_python.yml 
b/.github/workflows/release_python.yml
index d7bd04c..11bcbaa 100644
--- a/.github/workflows/release_python.yml
+++ b/.github/workflows/release_python.yml
@@ -84,7 +84,7 @@ jobs:
       - name: Generate Python README
         run: python3 bindings/python/generate_readme.py
 
-      - name: Install protoc (Linux)
+      - name: Install protoc (Linux host)
         if: runner.os == 'Linux'
         run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
 
@@ -94,9 +94,9 @@ jobs:
 
       - name: Install protoc (Windows)
         if: runner.os == 'Windows'
-        run: choco install protobuf -y
-        shell: pwsh
+        run: choco install protoc -y
 
+      # 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 +104,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 +126,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 +135,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 +144,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