diff --git a/.github/workflows/build.bazel.sh b/.github/workflows/build.bazel.sh index a5feb88f2..bf24cc322 100755 --- a/.github/workflows/build.bazel.sh +++ b/.github/workflows/build.bazel.sh @@ -49,10 +49,20 @@ $PYTHON tools/build/configure.py cat .bazelrc +if [[ $(uname -m) == "arm64" ]]; then + +bazel build \ + ${BAZEL_OPTIMIZATION} \ + -- //tensorflow_io:python/ops/libtensorflow_io.so //tensorflow_io:python/ops/libtensorflow_io_plugins.so //tensorflow_io_gcs_filesystem/... + +else + bazel build \ ${BAZEL_OPTIMIZATION} \ -- //tensorflow_io/... //tensorflow_io_gcs_filesystem/... +fi + rm -rf build && mkdir -p build if [[ $(uname) == "Linux" ]]; then diff --git a/tools/build/configure.py b/tools/build/configure.py index 520447654..9b825fc68 100644 --- a/tools/build/configure.py +++ b/tools/build/configure.py @@ -119,6 +119,7 @@ def write_config(): bazel_rc.write("build --enable_platform_specific_config\n") # Needed for GRPC build bazel_rc.write('build:macos --copt="-DGRPC_BAZEL_BUILD"\n') + bazel_rc.write('build:macos --copt="-D_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION"\n') # With macOS bazel_rc.write('build:macos --copt="--target=x86_64-apple-macosx12.1"\n') bazel_rc.write('build:macos --linkopt="--target=x86_64-apple-macosx12.1"\n')