[GLUTEN-9577] Add macOS Velox build workflow#11077
Conversation
|
It seems to take a long time because many dependencies need to be built. Should we change it to daily or weekly? |
|
On my macOS environment there were issues, so I had to make additional changes to build. 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 |
|
FYI @beliefer also seems to have encountered the arrow compilation error when compiling gluten on macOS. |
|
The issue is not the same as I met. I downgraded the cmake to 3.31.6 and build gluten successfully. |
|
After applying this patch(facebookincubator/velox@ec1d56d), you can use CMake 4.x. |
| name: macOS Velox Weekly Build | ||
|
|
||
| on: | ||
| schedule: |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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'
There was a problem hiding this comment.
added to velox_weekly.yml
| strategy: | ||
| fail-fast: false | ||
| if: ${{ startsWith(github.repository, 'apache/') }} | ||
| runs-on: macos-latest |
There was a problem hiding this comment.
Can we target to a specific runner version?
There was a problem hiding this comment.
missed this. will cover this in the followup
|
The failures are not related |
What changes are proposed in this pull request?
Adds a macOS build GitHub Actions workflow
velox_weekly.ymlto 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