Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT MERGE] Attempt and info for merging master into macOS build #39

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from
2 changes: 2 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ build --cxxopt="-DNDEBUG"

# Options from ./configure
try-import %workspace%/.reverb.bazelrc

build --features=-supports_dynamic_linker
Copy link
Author

Choose a reason for hiding this comment

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

This was necessary due to bazelbuild/bazel#4341.
I also had to use bazel==4.1.0rc04 -- I tried 4.0.0 (the latest homebrew version) and that didn't work for me for some reason.

6 changes: 3 additions & 3 deletions reverb/cc/platform/default/build_rules.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -107,20 +107,20 @@ def reverb_cc_proto_library(name, srcs = [], deps = [], **kwargs):
name = "{}_static".format(name),
srcs = gen_srcs,
hdrs = gen_hdrs,
deps = depset([dep.replace(":", ":lib") + ".so" for dep in deps] + reverb_tf_deps()),
deps = depset([dep.replace(":", ":libxxx") + ".so" for dep in deps] + reverb_tf_deps()),
alwayslink = 1,
**kwargs
)
native.cc_binary(
name = "lib{}.so".format(name),
name = "libxxx{}.so".format(name),
deps = ["{}_static".format(name)],
linkshared = 1,
**kwargs
)
native.cc_library(
name = name,
hdrs = gen_hdrs,
srcs = ["lib{}.so".format(name)],
Copy link
Author

Choose a reason for hiding this comment

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

These lib -> libxxx changes was necessary to let my Bazel not complain about conflicting names.
Inspired by bazelbuild/bazel#4341 (comment).

srcs = ["libxxx{}.so".format(name)],
deps = depset(deps + reverb_tf_deps()),
alwayslink = 1,
**kwargs
Expand Down
2 changes: 1 addition & 1 deletion reverb/cc/platform/default/repo.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def _find_python_solib_path(repo_ctx):
.format(exec_result.stderr))

if is_darwin(repo_ctx):
basename = "lib{}m.dylib".format(version)
Copy link
Author

Choose a reason for hiding this comment

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

basename = "lib{}.dylib".format(version)
solib_dir = "/".join(exec_result.stdout.splitlines()[-1].split("/")[:-2])
else:
basename = "lib{}.so".format(version)
Expand Down