Skip to content

Commit

Permalink
Merge pull request #1775 from ctiller/create-pull-request/patch-1b48b06
Browse files Browse the repository at this point in the history
Automated fix for refs/heads/v3-svall
  • Loading branch information
ctiller authored Jan 18, 2024
2 parents 1b48b06 + 1a07b8b commit 2fdcbbe
Showing 1 changed file with 31 additions and 9 deletions.
40 changes: 31 additions & 9 deletions tools/distrib/fix_build_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@
"opentelemetry/sdk/resource/semantic_conventions.h": "otel/sdk:headers",
"ares.h": "cares",
"fuzztest/fuzztest.h": ["fuzztest", "fuzztest_main"],
"google/api/monitored_resource.pb.h": ("google/api:monitored_resource_cc_proto"),
"google/api/monitored_resource.pb.h": (
"google/api:monitored_resource_cc_proto"
),
"google/devtools/cloudtrace/v2/tracing.grpc.pb.h": (
"googleapis_trace_grpc_service"
),
Expand All @@ -134,7 +136,9 @@
"opencensus-trace-stackdriver_exporter"
),
"opencensus/trace/context_util.h": "opencensus-trace-context_util",
"opencensus/trace/propagation/grpc_trace_bin.h": ("opencensus-trace-propagation"),
"opencensus/trace/propagation/grpc_trace_bin.h": (
"opencensus-trace-propagation"
),
"opencensus/tags/context_util.h": "opencensus-tags-context_util",
"opencensus/trace/span_context.h": "opencensus-trace-span_context",
"openssl/base.h": "libssl",
Expand Down Expand Up @@ -225,7 +229,11 @@ def config_setting_group(self, **kwargs):
# Convert the source or header target to a relative path.
def _get_filename(name, parsing_path):
filename = "%s%s" % (
(parsing_path + "/" if (parsing_path and not name.startswith("//")) else ""),
(
parsing_path + "/"
if (parsing_path and not name.startswith("//"))
else ""
),
name,
)
filename = filename.replace("//:", "")
Expand Down Expand Up @@ -307,7 +315,9 @@ def buildozer_set_list(name, values, target, via=""):
buildozer("remove %s" % name, target)
return
adjust = via if via else name
buildozer("set %s %s" % (adjust, " ".join('"%s"' % s for s in values)), target)
buildozer(
"set %s %s" % (adjust, " ".join('"%s"' % s for s in values)), target
)
if via:
buildozer("remove %s" % name, target)
buildozer("rename %s %s" % (via, name), target)
Expand Down Expand Up @@ -471,11 +481,19 @@ def __init__(self, library, substitutions):
def add_one_of(self, choices, trigger):
if not choices:
return
choices = sum([self.apply_substitutions(choice) for choice in choices], [])
choices = sum(
[self.apply_substitutions(choice) for choice in choices], []
)
if args.explain and (args.why is None or args.why in choices):
print("{}: Adding one of {} for {}".format(self.library, choices, trigger))
print(
"{}: Adding one of {} for {}".format(
self.library, choices, trigger
)
)
self.to_add.append(
tuple(make_relative_path(choice, self.library) for choice in choices)
tuple(
make_relative_path(choice, self.library) for choice in choices
)
)

def add(self, choice, trigger):
Expand Down Expand Up @@ -620,12 +638,16 @@ def make_library(library):
# assume a system include
continue

print("# ERROR: can't categorize header: %s used by %s" % (hdr, library))
print(
"# ERROR: can't categorize header: %s used by %s" % (hdr, library)
)
error = True

deps.remove(library)

deps = sorted(deps.best(lambda x: SCORERS[args.score](x, original_deps[library])))
deps = sorted(
deps.best(lambda x: SCORERS[args.score](x, original_deps[library]))
)
external_deps = sorted(
external_deps.best(
lambda x: SCORERS[args.score](x, original_external_deps[library])
Expand Down

0 comments on commit 2fdcbbe

Please sign in to comment.