Skip to content

Commit

Permalink
Hack: Allow duplicate calls to go_deps.from_file
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Penner committed Jan 4, 2024
1 parent e7e69c4 commit 519a434
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions internal/bzlmod/go_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,13 @@ def _go_deps_impl(module_ctx):
_process_overrides(module_ctx, module, "module_override", module_overrides, _process_module_override, archive_overrides)
_process_overrides(module_ctx, module, "archive_override", archive_overrides, _process_archive_override, module_overrides)

if len(module.tags.from_file) > 1:
fail(
"Multiple \"go_deps.from_file\" tags defined in module \"{}\": {}".format(
module.name,
", ".join([str(tag.go_mod) for tag in module.tags.from_file]),
),
)
# if len(module.tags.from_file) > 1:
# fail(
# "HHHHHHH Multiple \"go_deps.from_file\" tags defined in module \"{}\": {}".format(
# module.name,
# ", ".join([str(tag.go_mod) for tag in module.tags.from_file]),
# ),
# )
additional_module_tags = []
for from_file_tag in module.tags.from_file:
module_path, module_tags_from_go_mod, go_mod_replace_map = deps_from_go_mod(module_ctx, from_file_tag.go_mod)
Expand Down Expand Up @@ -306,7 +306,9 @@ def _go_deps_impl(module_ctx):
paths = {}
for module_tag in module.tags.module + additional_module_tags:
if module_tag.path in paths:
fail("Duplicate Go module path \"{}\" in module \"{}\".".format(module_tag.path, module.name))
# just ignore duplicates
continue
# fail("Duplicate Go module path \"{}\" in module \"{}\".".format(module_tag.path, module.name))
if module_tag.path in bazel_deps:
continue
paths[module_tag.path] = None
Expand Down

0 comments on commit 519a434

Please sign in to comment.