-
Notifications
You must be signed in to change notification settings - Fork 93
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
thisiscam
wants to merge
11
commits into
google-deepmind:master
Choose a base branch
from
thisiscam:osx_merge
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
5786912
[1/4] Support for macOS - update reverb/cc
lifeiteng b6063a3
[2/4] Support for macOS - Fix python code build
lifeiteng 32c3441
[3/4] Support for macOS - Fix Library not loaded ImportError
lifeiteng aed9c51
[3/4] Support for macOS - Format build scripts
lifeiteng c52865e
[3/4] Support for macOS - Fix @loader_path/../_solib_darwin image not…
lifeiteng f4e76ca
[4/4] Support for macOS - Fix bazel test //reverb:*_test
lifeiteng f4f9308
[4/4] Support for macOS - Fix python tests
lifeiteng 8fbb22d
Merge branch 'master' into osx
lifeiteng eef29e5
[4/4] Support for macOS - Address review comments
lifeiteng 7f02b78
Merge remote-tracking branch 'cam/osx' into osx_merge
thisiscam 7f73e78
hacks to fix macOS build
thisiscam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,6 +81,7 @@ ARG pip_dependencies=' \ | |
numpy \ | ||
oauth2client \ | ||
pandas \ | ||
platform \ | ||
portpicker' | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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(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)], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These |
||
srcs = ["libxxx{}.so".format(name)], | ||
deps = depset(deps + reverb_tf_deps()), | ||
alwayslink = 1, | ||
**kwargs | ||
|
@@ -294,6 +294,16 @@ def reverb_gen_op_wrapper_py(name, out, kernel_lib, linkopts = [], **kwargs): | |
fail("Argument out must end with '.py', but saw: {}".format(out)) | ||
|
||
module_name = "lib{}_gen_op".format(name) | ||
exported_symbols_file = "%s-exported-symbols.lds" % module_name | ||
# gen_client_ops -> reverb_client | ||
symbol = "reverb_{}".format(name.split('_')[1]) | ||
native.genrule( | ||
name = module_name + "_exported_symbols", | ||
outs = [exported_symbols_file], | ||
cmd = "echo '*%s*' >$@" % symbol, | ||
output_licenses = ["unencumbered"], | ||
visibility = ["//visibility:private"], | ||
) | ||
version_script_file = "%s-version-script.lds" % module_name | ||
native.genrule( | ||
name = module_name + "_version_script", | ||
|
@@ -304,16 +314,23 @@ def reverb_gen_op_wrapper_py(name, out, kernel_lib, linkopts = [], **kwargs): | |
) | ||
native.cc_binary( | ||
name = "{}.so".format(module_name), | ||
deps = [kernel_lib] + reverb_tf_deps() + [version_script_file], | ||
deps = [kernel_lib] + reverb_tf_deps() + [ | ||
exported_symbols_file, | ||
version_script_file | ||
], | ||
copts = tf_copts() + [ | ||
"-fno-strict-aliasing", # allow a wider range of code [aliasing] to compile. | ||
"-fvisibility=hidden", # avoid symbol clashes between DSOs. | ||
], | ||
linkshared = 1, | ||
linkopts = linkopts + _rpath_linkopts(module_name) + [ | ||
"-Wl,--version-script", | ||
"$(location %s)" % version_script_file, | ||
], | ||
linkopts = linkopts + _rpath_linkopts(module_name) + select({ | ||
"//reverb:macos": [ | ||
"-Wl,-exported_symbols_list,$(location %s)" % exported_symbols_file, | ||
], | ||
"//conditions:default": [ | ||
"-Wl,--version-script,$(location %s)" % version_script_file, | ||
], | ||
}), | ||
**kwargs | ||
) | ||
native.genrule( | ||
|
@@ -444,10 +461,15 @@ def reverb_pybind_extension( | |
"-fexceptions", # pybind relies on exceptions, required to compile. | ||
"-fvisibility=hidden", # avoid pybind symbol clashes between DSOs. | ||
], | ||
linkopts = linkopts + _rpath_linkopts(module_name) + [ | ||
"-Wl,--version-script", | ||
"$(location %s)" % version_script_file, | ||
], | ||
linkopts = linkopts + _rpath_linkopts(module_name) + | ||
select({"//reverb:macos": [ | ||
"-Wl,-exported_symbols_list,$(location %s)" % exported_symbols_file, | ||
], | ||
"//conditions:default": [ | ||
"-Wl,--version-script", | ||
"$(location %s)" % version_script_file, | ||
], | ||
}), | ||
deps = depset(deps + [ | ||
exported_symbols_file, | ||
version_script_file, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.