Skip to content

[GLUTEN-9577] Add macOS Velox build workflow#11077

Merged
zhouyuan merged 21 commits intoapache:mainfrom
wangyum:mac-os
Nov 14, 2025
Merged

[GLUTEN-9577] Add macOS Velox build workflow#11077
zhouyuan merged 21 commits intoapache:mainfrom
wangyum:mac-os

Conversation

@wangyum
Copy link
Copy Markdown
Member

@wangyum wangyum commented Nov 13, 2025

What changes are proposed in this pull request?

Adds a macOS build GitHub Actions workflow velox_weekly.yml to ensure the Velox backend can be packaged on macOS. This supports common macOS development while targeting Linux runtime, improving debugging efficiency.

How was this patch tested?

Validated locally on macOS.

Related issue: #9577

@wangyum
Copy link
Copy Markdown
Member Author

wangyum commented Nov 13, 2025

@wForget
Copy link
Copy Markdown
Member

wForget commented Nov 14, 2025

It seems to take a long time because many dependencies need to be built. Should we change it to daily or weekly?

Comment thread .github/workflows/velox_build_mac.yml Outdated
@wangyum
Copy link
Copy Markdown
Member Author

wangyum commented Nov 14, 2025

@wangyum
Copy link
Copy Markdown
Member Author

wangyum commented Nov 14, 2025

On my macOS environment there were issues, so I had to make additional changes to build.
Velox:

Subject: [PATCH] Build gluten on mac
---
Index: scripts/setup-common.sh
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/scripts/setup-common.sh b/scripts/setup-common.sh
--- a/scripts/setup-common.sh	(revision 704b7d6f82b7735d5c1ecd5a5b61deb2a77860c1)
+++ b/scripts/setup-common.sh	(revision 3667f5005650f3614f903ee47f105ea0fc3dd894)
@@ -49,7 +49,7 @@
   # shellcheck disable=SC2034
   EXTRA_PKG_CXXFLAGS=" -DFOLLY_CFG_NO_COROUTINES"
   wget_and_untar https://github.com/facebook/folly/archive/refs/tags/"${FB_OS_VERSION}".tar.gz folly
-  cmake_install_dir folly -DBUILD_SHARED_LIBS="$VELOX_BUILD_SHARED" -DBUILD_TESTS=OFF -DFOLLY_HAVE_INT128_T=ON
+  cmake_install_dir folly -DBUILD_SHARED_LIBS="$VELOX_BUILD_SHARED" -DBUILD_TESTS=OFF -DFOLLY_HAVE_INT128_T=ON -DFOLLY_USE_JEMALLOC=OFF
 }
 
 function install_fizz {

Gluten:

Subject: [PATCH] Build gluten on mac
---
Index: ep/build-velox/src/build-velox.sh
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/ep/build-velox/src/build-velox.sh b/ep/build-velox/src/build-velox.sh
--- a/ep/build-velox/src/build-velox.sh	(revision ed2c2adf8060e772938a397e9bb67a6559d0851d)
+++ b/ep/build-velox/src/build-velox.sh	(revision e43597efaf36564084d71b74e6fe88ece795c0bb)
@@ -101,7 +101,7 @@
   # Maybe there is some set option in velox setup script. Run set command again.
   set -exu
 
-  CXX_FLAGS='-Wno-error=stringop-overflow -Wno-error=cpp -Wno-missing-field-initializers -Wno-unknown-warning-option'
+  CXX_FLAGS='-Wno-error=stringop-overflow -Wno-error=cpp -Wno-missing-field-initializers -Wno-unknown-warning-option -Wno-error=deprecated-declarations -Wno-error=macro-redefined -Wno-error=inconsistent-missing-override'
   COMPILE_OPTION="-DCMAKE_CXX_FLAGS=\"$CXX_FLAGS\" -DVELOX_ENABLE_PARQUET=ON -DVELOX_BUILD_TESTING=OFF -DVELOX_MONO_LIBRARY=ON -DVELOX_BUILD_RUNNER=OFF -DVELOX_SIMDJSON_SKIPUTF8VALIDATION=ON -DVELOX_ENABLE_GEO=ON"
   if [ $BUILD_TEST_UTILS == "ON" ]; then
     COMPILE_OPTION="$COMPILE_OPTION -DVELOX_BUILD_TEST_UTILS=ON"
Index: ep/build-velox/src/modify_arrow.patch
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/ep/build-velox/src/modify_arrow.patch b/ep/build-velox/src/modify_arrow.patch
--- a/ep/build-velox/src/modify_arrow.patch	(revision ed2c2adf8060e772938a397e9bb67a6559d0851d)
+++ b/ep/build-velox/src/modify_arrow.patch	(revision e43597efaf36564084d71b74e6fe88ece795c0bb)
@@ -133,3 +133,26 @@
 +#endif
    JNI_METHOD_END()
  }
+
+diff --git a/java/dataset/src/main/cpp/jni_wrapper.cc b/java/dataset/src/main/cpp/jni_wrapper.cc
+index d2d976677..eb4b6d1d2 100644
+--- a/java/dataset/src/main/cpp/jni_wrapper.cc
++++ b/java/dataset/src/main/cpp/jni_wrapper.cc
+@@ -26,6 +26,7 @@
+ #include "arrow/dataset/api.h"
+ #include "arrow/dataset/file_base.h"
+ #include "arrow/dataset/file_csv.h"
++#include "arrow/dataset/file_parquet.h"
+ #include "arrow/filesystem/localfs.h"
+ #include "arrow/filesystem/path_util.h"
+ #ifdef ARROW_S3
+@@ -101,7 +102,8 @@
+     jint file_format_id) {
+   switch (file_format_id) {
+     case 0:
+-      return std::make_shared<arrow::dataset::ParquetFileFormat>();
++    return std::static_pointer_cast<arrow::dataset::FileFormat>(
++        std::make_shared<arrow::dataset::ParquetFileFormat>());
+     case 1:
+       return std::make_shared<arrow::dataset::IpcFileFormat>();
+ #ifdef ARROW_ORC

@wForget
Copy link
Copy Markdown
Member

wForget commented Nov 14, 2025

FYI @beliefer also seems to have encountered the arrow compilation error when compiling gluten on macOS.

@beliefer
Copy link
Copy Markdown
Contributor

The issue is not the same as I met. I downgraded the cmake to 3.31.6 and build gluten successfully.

@wangyum
Copy link
Copy Markdown
Member Author

wangyum commented Nov 14, 2025

After applying this patch(facebookincubator/velox@ec1d56d), you can use CMake 4.x.

Copy link
Copy Markdown
Member

@wForget wForget left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @wangyum , lgtm

Comment thread .github/workflows/velox_build_mac.yml Outdated
name: macOS Velox Weekly Build

on:
schedule:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this job be put into the existing velox_weekly.yml?

If not, please add pull_request field with this file path included, then any modification on this file can trigger the workflow.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Mac the issue i ran into is the software stack will be upgraded automatically and it will break the build. So maybe it's better to run this in the cron job instead of blocking CI

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess @philo-he means just adding velox_build_mac.yml to pull_request. That makes sense to me.

on:
  pull_request:
    paths:
      - '.github/workflows/velox_build_mac.yml'

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added to velox_weekly.yml

strategy:
fail-fast: false
if: ${{ startsWith(github.repository, 'apache/') }}
runs-on: macos-latest
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missed this. will cover this in the followup

@zhouyuan zhouyuan merged commit 94fb7be into apache:main Nov 14, 2025
12 of 15 checks passed
@zhouyuan
Copy link
Copy Markdown
Member

The failures are not related

@wangyum wangyum deleted the mac-os branch November 15, 2025 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants