|
|
|
@ -35,6 +35,11 @@ git_submodule_hashes = { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
_BAZEL_TOOLCHAINS_DEP_NAME = 'com_github_bazelbuild_bazeltoolchains' |
|
|
|
|
_TWISTED_TWISTED_DEP_NAME = 'com_github_twisted_twisted' |
|
|
|
|
_YAML_PYYAML_DEP_NAME = 'com_github_yaml_pyyaml' |
|
|
|
|
_TWISTED_INCREMENTAL_DEP_NAME = 'com_github_twisted_incremental' |
|
|
|
|
_ZOPEFOUNDATION_ZOPE_INTERFACE_DEP_NAME = 'com_github_zopefoundation_zope_interface' |
|
|
|
|
_TWISTED_CONSTANTLY_DEP_NAME = 'com_github_twisted_constantly' |
|
|
|
|
|
|
|
|
|
_GRPC_DEP_NAMES = [ |
|
|
|
|
'boringssl', |
|
|
|
@ -46,6 +51,20 @@ _GRPC_DEP_NAMES = [ |
|
|
|
|
'com_github_cares_cares', |
|
|
|
|
'com_google_absl', |
|
|
|
|
_BAZEL_TOOLCHAINS_DEP_NAME, |
|
|
|
|
_TWISTED_TWISTED_DEP_NAME, |
|
|
|
|
_YAML_PYYAML_DEP_NAME, |
|
|
|
|
_TWISTED_INCREMENTAL_DEP_NAME, |
|
|
|
|
_ZOPEFOUNDATION_ZOPE_INTERFACE_DEP_NAME, |
|
|
|
|
_TWISTED_CONSTANTLY_DEP_NAME, |
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
_GRPC_BAZEL_ONLY_DEPS = [ |
|
|
|
|
_BAZEL_TOOLCHAINS_DEP_NAME, |
|
|
|
|
_TWISTED_TWISTED_DEP_NAME, |
|
|
|
|
_YAML_PYYAML_DEP_NAME, |
|
|
|
|
_TWISTED_INCREMENTAL_DEP_NAME, |
|
|
|
|
_ZOPEFOUNDATION_ZOPE_INTERFACE_DEP_NAME, |
|
|
|
|
_TWISTED_CONSTANTLY_DEP_NAME, |
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -70,7 +89,8 @@ class BazelEvalState(object): |
|
|
|
|
return [] |
|
|
|
|
|
|
|
|
|
def archive(self, **args): |
|
|
|
|
if args['name'] == _BAZEL_TOOLCHAINS_DEP_NAME: |
|
|
|
|
assert self.names_and_urls.get(args['name']) is None |
|
|
|
|
if args['name'] in _GRPC_BAZEL_ONLY_DEPS: |
|
|
|
|
self.names_and_urls[args['name']] = 'dont care' |
|
|
|
|
return |
|
|
|
|
self.names_and_urls[args['name']] = args['url'] |
|
|
|
@ -82,8 +102,10 @@ with open(os.path.join('bazel', 'grpc_deps.bzl'), 'r') as f: |
|
|
|
|
eval_state = BazelEvalState(names_and_urls) |
|
|
|
|
bazel_file = f.read() |
|
|
|
|
|
|
|
|
|
# grpc_deps.bzl only defines 'grpc_deps', add this to call it |
|
|
|
|
# grpc_deps.bzl only defines 'grpc_deps' and 'grpc_test_only_deps', add these |
|
|
|
|
# lines to call them. |
|
|
|
|
bazel_file += '\ngrpc_deps()\n' |
|
|
|
|
bazel_file += '\ngrpc_test_only_deps()\n' |
|
|
|
|
build_rules = { |
|
|
|
|
'native': eval_state, |
|
|
|
|
} |
|
|
|
@ -92,11 +114,12 @@ for name in _GRPC_DEP_NAMES: |
|
|
|
|
assert name in names_and_urls.keys() |
|
|
|
|
assert len(_GRPC_DEP_NAMES) == len(names_and_urls.keys()) |
|
|
|
|
|
|
|
|
|
# bazeltoolschains is an exception to this sanity check, |
|
|
|
|
# we don't require that there is a corresponding git module. |
|
|
|
|
names_without_bazeltoolchains = names_and_urls.keys() |
|
|
|
|
names_without_bazeltoolchains.remove(_BAZEL_TOOLCHAINS_DEP_NAME) |
|
|
|
|
archive_urls = [names_and_urls[name] for name in names_without_bazeltoolchains] |
|
|
|
|
# There are some "bazel-only" deps that are exceptions to this sanity check, |
|
|
|
|
# we don't require that there is a corresponding git module for these. |
|
|
|
|
names_without_bazel_only_deps = names_and_urls.keys() |
|
|
|
|
for dep_name in _GRPC_BAZEL_ONLY_DEPS: |
|
|
|
|
names_without_bazel_only_deps.remove(dep_name) |
|
|
|
|
archive_urls = [names_and_urls[name] for name in names_without_bazel_only_deps] |
|
|
|
|
workspace_git_hashes = { |
|
|
|
|
re.search(git_hash_pattern, url).group() |
|
|
|
|
for url in archive_urls |
|
|
|
|