diff --git a/.bazelrc b/.bazelrc index d8e7993683c..b94d4d2bf92 100644 --- a/.bazelrc +++ b/.bazelrc @@ -83,7 +83,7 @@ build --host_cxxopt=-std=c++17 # copy-on-write semantics of std::strings of the older ABI. build --cxxopt=-D_GLIBCXX_USE_CXX11_ABI=0 -build --workspace_status_command=/proc/self/cwd/tools/gen_status_stamp.sh +build --workspace_status_command=tools/gen_status_stamp.sh build --experimental_repo_remote_exec @@ -96,7 +96,17 @@ build --define=use_tensorflow_io=1 # TensorFlow Decision Forests does not use Absl concurrency primitives on MacOs. # Reason: TensorFlow/ABSL ODR violation (b/214189609) # copybara:strip -build:macos --define std_synchronization_primitives=1 +# DISABLED for native macOS build due to C++20 std::latch compatibility issues +# build:macos --define std_synchronization_primitives=1 + +# macOS-specific build configuration for native compilation +build:macos --cxxopt=-mmacosx-version-min=10.13 +build:macos --cxxopt=-faligned-allocation +build:macos --host_cxxopt=-mmacosx-version-min=10.13 +build:macos --host_cxxopt=-faligned-allocation +# Disable C++ modules to avoid indirect dependency issues +build:macos --features=-use_module_maps +build:macos --features=-layering_check # Taken from https://github.com/openxla/xla/blob/99559d7a4f7c55490f46385ad29a3cbf9c3911af/warnings.bazelrc#L6 # We silence warnings for code in `external`. @@ -111,3 +121,15 @@ build --copt=-Wno-unused-but-set-variable # due to `ifdefs` in ml_dtypes # and disable Bzlmod. common --enable_bzlmod=false common --noincompatible_enable_cc_toolchain_resolution + +# Increase timeout for repository fetches (especially for Boost with submodules) +fetch --repository_cache_hardlinks=false +fetch --http_timeout_scaling=10.0 +common --experimental_repository_downloader_retries=3 +common --experimental_scale_timeouts=10.0 + +# macOS: Use system tools instead of conda environment tools +build:macos --action_env AR=/usr/bin/ar +build:macos --action_env LD=/usr/bin/ld +build:macos --action_env LIBTOOL=/usr/bin/libtool +build:macos --action_env NM=/usr/bin/nm diff --git a/environment.yml b/environment.yml new file mode 100644 index 00000000000..6ce8a156cf5 --- /dev/null +++ b/environment.yml @@ -0,0 +1,30 @@ +name: tf-serving-build + +# Bazelisk is the recommended way to manage Bazel versions (automatically downloads and uses the right version). +# To install Bazelisk: +# 1. Create directory: mkdir -p ~/.local/bin +# 2. Download: curl -L https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-darwin-arm64 -o ~/.local/bin/bazel +# (use bazelisk-darwin-amd64 for Intel Macs) +# 3. Make executable: chmod +x ~/.local/bin/bazel +# 4. Add to PATH: export PATH="$HOME/.local/bin:$PATH" (add to ~/.zshrc or ~/.bash_profile) +# 5. Optional: Set specific Bazel version with export USE_BAZEL_VERSION=x.y.z +# 6. Verify: bazel --version + +channels: + - conda-forge + - defaults +dependencies: + - python=3.11 + - automake + - autoconf + - libtool + - make + - cmake + - git + - pkg-config + - wget + - curl + - patch + - unzip + - zip + - clang=18.1.1 diff --git a/tensorflow_serving/workspace.bzl b/tensorflow_serving/workspace.bzl index c7b7a8966b7..e6bd9c2d21d 100644 --- a/tensorflow_serving/workspace.bzl +++ b/tensorflow_serving/workspace.bzl @@ -128,6 +128,6 @@ def tf_serving_workspace(): commit = "b7b1371294b4bdfc8d85e49236ebced114bc1d8f", # boost-1.75.0 build_file = "//third_party/boost:BUILD", init_submodules = True, - recursive_init_submodules = True, + recursive_init_submodules = False, # Disabled to avoid timeout - Boost submodules don't have nested submodules remote = "https://github.com/boostorg/boost", )