Skip to content

Commit

Permalink
[Reverb] Fix the build.
Browse files Browse the repository at this point in the history
1. Updated bazel version
2. Added additional apple support bazel repos
3. Host cxxopt to c++-17
4. Updated absl to match TF's

PiperOrigin-RevId: 526109631
Change-Id: Ie7dc945552e416c7cddfa2dd29db042560275ed5
  • Loading branch information
ebrevdo authored and copybara-github committed Apr 21, 2023
1 parent 6316be4 commit d44cc58
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ build:manylinux2014 --crosstool_top=//third_party/toolchains/preconfig/ubuntu16.

build -c opt
build --cxxopt="-std=c++17"
build --host_cxxopt="-std=c++17"
# We can remove this flag (we keep it explicit for now)
build --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=1"
build --host_cxxopt="-D_GLIBCXX_USE_CXX11_ABI=1"
build --auto_output_filter=subpackages
build --copt="-Wall" --copt="-Wno-sign-compare"
build --linkopt="-lrt -lm"
Expand Down
3 changes: 3 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ load(
"//reverb/cc/platform/default:repo.bzl",
"absl_deps",
"cc_tf_configure",
"github_apple_deps",
"github_grpc_deps",
"googletest_deps",
"protoc_deps",
Expand All @@ -28,6 +29,8 @@ absl_deps()
# Note that the Python dependencies are not tracked by bazel here, but
# in setup.py.

github_apple_deps()

## Begin GRPC related deps
github_grpc_deps()

Expand Down
8 changes: 5 additions & 3 deletions docker/release.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ RUN ${APT_COMMAND} update && ${APT_COMMAND} install -y --no-install-recommends \
RUN curl -O https://bootstrap.pypa.io/get-pip.py

# Installs known working version of bazel.
ARG bazel_version=3.7.2
ARG bazel_version=5.3.0
ENV BAZEL_VERSION ${bazel_version}
RUN mkdir /bazel && \
cd /bazel && \
Expand Down Expand Up @@ -96,12 +96,14 @@ RUN ln -s "/usr/include/x86_64-linux-gnu/python3.11" "/dt9/usr/include/x86_64-li
# bazel build -c opt --copt=-mavx --config=manylinux2014 --test_output=errors //...

# Update binutils to avoid linker(gold) issue. See b/227299577#comment9
RUN wget http://old-releases.ubuntu.com/ubuntu/pool/main/b/binutils/binutils_2.35.1-1ubuntu1_amd64.deb \
RUN \
wget http://old-releases.ubuntu.com/ubuntu/pool/main/b/binutils/binutils_2.35.1-1ubuntu1_amd64.deb \
&& wget http://old-releases.ubuntu.com/ubuntu/pool/main/b/binutils/binutils-x86-64-linux-gnu_2.35.1-1ubuntu1_amd64.deb \
&& wget http://old-releases.ubuntu.com/ubuntu/pool/main/b/binutils/binutils-common_2.35.1-1ubuntu1_amd64.deb \
&& wget http://old-releases.ubuntu.com/ubuntu/pool/main/b/binutils/libbinutils_2.35.1-1ubuntu1_amd64.deb

RUN dpkg -i binutils_2.35.1-1ubuntu1_amd64.deb \
RUN \
dpkg -i binutils_2.35.1-1ubuntu1_amd64.deb \
binutils-x86-64-linux-gnu_2.35.1-1ubuntu1_amd64.deb \
binutils-common_2.35.1-1ubuntu1_amd64.deb \
libbinutils_2.35.1-1ubuntu1_amd64.deb
Expand Down
20 changes: 16 additions & 4 deletions reverb/cc/platform/default/repo.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,18 @@ def python_deps():
],
)

def github_apple_deps():
http_archive(
name = "build_bazel_rules_apple",
sha256 = "36072d4f3614d309d6a703da0dfe48684ec4c65a89611aeb9590b45af7a3e592",
urls = ["https://github.com/bazelbuild/rules_apple/releases/download/1.0.1/rules_apple.1.0.1.tar.gz"],
)
http_archive(
name = "build_bazel_apple_support",
sha256 = "ce1042cf936540eaa7b49c4549d7cd9b6b1492acbb6e765840a67a34b8e17a97",
urls = ["https://github.com/bazelbuild/apple_support/releases/download/1.1.0/apple_support.1.1.0.tar.gz"],
)

def github_grpc_deps():
http_archive(
name = "com_github_grpc_grpc",
Expand Down Expand Up @@ -347,11 +359,11 @@ def googletest_deps():
def absl_deps():
http_archive(
name = "com_google_absl",
sha256 = "94aef187f688665dc299d09286bfa0d22c4ecb86a80b156dff6aabadc5a5c26d", # SHARED_ABSL_SHA
strip_prefix = "abseil-cpp-273292d1cfc0a94a65082ee350509af1d113344d",
sha256 = "8eeec9382fc0338ef5c60053f3a4b0e0708361375fe51c9e65d0ce46ccfe55a7", # SHARED_ABSL_SHA
strip_prefix = "abseil-cpp-b971ac5250ea8de900eae9f95e06548d14cd95fe",
urls = [
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/abseil/abseil-cpp/archive/273292d1cfc0a94a65082ee350509af1d113344d.tar.gz",
"https://github.com/abseil/abseil-cpp/archive/273292d1cfc0a94a65082ee350509af1d113344d.tar.gz",
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/abseil/abseil-cpp/archive/b971ac5250ea8de900eae9f95e06548d14cd95fe.tar.gz",
"https://github.com/abseil/abseil-cpp/archive/b971ac5250ea8de900eae9f95e06548d14cd95fe.tar.gz",
],
)

Expand Down

0 comments on commit d44cc58

Please sign in to comment.