This is an automated email from the ASF dual-hosted git repository. yuxia pushed a commit to branch release-0.1 in repository https://gitbox.apache.org/repos/asf/fluss-rust.git
commit f59df658a2783160d57599225c73f7f801b618bf Author: luoyuxia <[email protected]> AuthorDate: Mon Mar 2 11:50:01 2026 +0800 ci: fix python wheel build issue --- .github/workflows/release_python.yml | 5 +++++ bindings/python/Cargo.toml | 2 +- crates/fluss/Cargo.toml | 1 + crates/fluss/build.rs | 6 ++++++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release_python.yml b/.github/workflows/release_python.yml index e5a176f..1f2d62a 100644 --- a/.github/workflows/release_python.yml +++ b/.github/workflows/release_python.yml @@ -104,6 +104,8 @@ jobs: command: build args: --release -o dist -i python3.9 manylinux: ${{ matrix.manylinux || 'auto' }} + # Build on host for Linux x86_64 so fluss's build.rs can find protoc (manylinux image has no protoc) + container: ${{ matrix.os == 'ubuntu-latest' && matrix.target == 'x86_64' && 'off' || '' }} - uses: PyO3/maturin-action@v1 with: working-directory: bindings/python @@ -111,6 +113,7 @@ jobs: command: build args: --release -o dist -i python3.10 manylinux: ${{ matrix.manylinux || 'auto' }} + container: ${{ matrix.os == 'ubuntu-latest' && matrix.target == 'x86_64' && 'off' || '' }} - uses: PyO3/maturin-action@v1 with: working-directory: bindings/python @@ -118,6 +121,7 @@ jobs: command: build args: --release -o dist -i python3.11 manylinux: ${{ matrix.manylinux || 'auto' }} + container: ${{ matrix.os == 'ubuntu-latest' && matrix.target == 'x86_64' && 'off' || '' }} - uses: PyO3/maturin-action@v1 with: working-directory: bindings/python @@ -125,6 +129,7 @@ jobs: command: build args: --release -o dist -i python3.12 manylinux: ${{ matrix.manylinux || 'auto' }} + container: ${{ matrix.os == 'ubuntu-latest' && matrix.target == 'x86_64' && 'off' || '' }} - 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 } diff --git a/crates/fluss/Cargo.toml b/crates/fluss/Cargo.toml index db1348a..c966e0d 100644 --- a/crates/fluss/Cargo.toml +++ b/crates/fluss/Cargo.toml @@ -83,3 +83,4 @@ test-env-helpers = "0.2.2" [build-dependencies] prost-build = { version = "0.14" } +protoc-bin-vendored = "3" diff --git a/crates/fluss/build.rs b/crates/fluss/build.rs index 265208a..d46548b 100644 --- a/crates/fluss/build.rs +++ b/crates/fluss/build.rs @@ -18,6 +18,12 @@ use std::io::Result; fn main() -> Result<()> { + // Use vendored protoc when PROTOC is not set (e.g. in CI manylinux containers). + if std::env::var_os("PROTOC").is_none() { + let path = protoc_bin_vendored::protoc_bin_path().expect("vendored protoc"); + // SAFETY: build script runs in a single-threaded context before any other code. + unsafe { std::env::set_var("PROTOC", path) }; + } let mut config = prost_build::Config::new(); config.bytes([ ".proto.PbProduceLogReqForBucket.records",
