This is an automated email from the ASF dual-hosted git repository.
xushiyan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/hudi-rs.git
The following commit(s) were added to refs/heads/main by this push:
new 1f6b54e build: use build wrapper to handle macos 26 SDK loading (#479)
1f6b54e is described below
commit 1f6b54e3a12f06a3a98d31715e494e507587c1e1
Author: Shiyan Xu <[email protected]>
AuthorDate: Mon Nov 3 10:08:14 2025 -0800
build: use build wrapper to handle macos 26 SDK loading (#479)
---
.cargo/config.toml | 6 ++++++
Makefile | 12 ++++++------
build-wrapper.sh | 45 +++++++++++++++++++++++++++++++++++++++++++++
demo/ci_run.sh | 2 +-
4 files changed, 58 insertions(+), 7 deletions(-)
diff --git a/.cargo/config.toml b/.cargo/config.toml
index 0b24f30..406230e 100644
--- a/.cargo/config.toml
+++ b/.cargo/config.toml
@@ -20,3 +20,9 @@ rustflags = [
"-C", "link-arg=-undefined",
"-C", "link-arg=dynamic_lookup",
]
+
+[target.aarch64-apple-darwin]
+rustflags = [
+ "-C", "link-arg=-undefined",
+ "-C", "link-arg=dynamic_lookup",
+]
diff --git a/Makefile b/Makefile
index e73bc06..8c92533 100644
--- a/Makefile
+++ b/Makefile
@@ -43,12 +43,12 @@ setup: ## Setup the requirements
.PHONY: build
build: setup ## Build Python binding of hudi-rs
$(info --- Build Python binding ---)
- maturin build --features datafusion $(MATURIN_EXTRA_ARGS) -m
$(PYTHON_DIR)/Cargo.toml
+ ./build-wrapper.sh maturin build --features datafusion
$(MATURIN_EXTRA_ARGS) -m $(PYTHON_DIR)/Cargo.toml
.PHONY: develop
develop: setup ## Install Python binding of hudi-rs
$(info --- Develop with Python binding ---)
- maturin develop --extras=devel,datafusion --features datafusion
$(MATURIN_EXTRA_ARGS) -m $(PYTHON_DIR)/Cargo.toml
+ ./build-wrapper.sh maturin develop --extras=devel,datafusion --features
datafusion $(MATURIN_EXTRA_ARGS) -m $(PYTHON_DIR)/Cargo.toml
.PHONY: format
format: format-rust format-python ## Format Rust and Python code
@@ -56,7 +56,7 @@ format: format-rust format-python ## Format Rust and Python
code
.PHONY: format-rust
format-rust: ## Format Rust code
$(info --- Format Rust code ---)
- cargo fmt --all
+ ./build-wrapper.sh cargo fmt --all
.PHONY: format-python
format-python: ## Format Python code
@@ -69,9 +69,9 @@ check: check-rust check-python ## Run check on Rust and Python
.PHONY: check-rust
check-rust: ## Run check on Rust
$(info --- Check Rust clippy ---)
- cargo clippy --all-targets --all-features --workspace --no-deps -- -D
warnings
+ ./build-wrapper.sh cargo clippy --all-targets --all-features
--workspace --no-deps -- -D warnings
$(info --- Check Rust format ---)
- cargo fmt --all -- --check
+ ./build-wrapper.sh cargo fmt --all -- --check
.PHONY: check-python
check-python: ## Run check on Python
@@ -88,7 +88,7 @@ test: test-rust test-python ## Run tests on Rust and Python
.PHONY: test-rust
test-rust: ## Run tests on Rust
$(info --- Run Rust tests ---)
- cargo test --no-fail-fast --all-targets --all-features --workspace
+ ./build-wrapper.sh cargo test --no-fail-fast --all-targets
--all-features --workspace
.PHONY: test-python
test-python: ## Run tests on Python
diff --git a/build-wrapper.sh b/build-wrapper.sh
new file mode 100755
index 0000000..de58e1e
--- /dev/null
+++ b/build-wrapper.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Setup script for macOS 26 (Tahoe) build environment
+# This script detects macOS version and sets SDK environment variables if
needed
+
+set -e
+
+# Detect macOS version
+if [[ "$OSTYPE" == "darwin"* ]]; then
+ MACOS_VERSION=$(sw_vers -productVersion | cut -d. -f1)
+
+ if [[ "$MACOS_VERSION" -ge 26 ]]; then
+ echo "Detected macOS ${MACOS_VERSION} (Tahoe or later)"
+ echo "Setting SDK environment variables for build compatibility..."
+
+ # Export SDK environment variables
+ export SDKROOT="$(xcrun --show-sdk-path)"
+ export MACOSX_DEPLOYMENT_TARGET="14.0"
+ export CXXFLAGS="-isysroot ${SDKROOT}"
+ export CFLAGS="-isysroot ${SDKROOT}"
+
+ echo "SDK configuration:"
+ echo " SDKROOT=${SDKROOT}"
+ echo " MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET}"
+ fi
+fi
+
+# Run the command passed as arguments
+exec "$@"
diff --git a/demo/ci_run.sh b/demo/ci_run.sh
index 4223471..32f130d 100755
--- a/demo/ci_run.sh
+++ b/demo/ci_run.sh
@@ -71,7 +71,7 @@ elif [ "$app_path" = "hudi-table-api/python" ]; then
"
elif [ "$app_path" = "hudi-file-group-api/cpp" ]; then
docker compose exec -T runner /bin/bash -c "
- cd /opt/hudi-rs/cpp && cargo build --release && \
+ cd /opt/hudi-rs/cpp && ../build-wrapper.sh cargo build --release && \
cd $app_path_in_container && \
mkdir build && cd build && \
cmake .. && \