Skip to content

Commit

Permalink
Removing comment, changing hard fail to soft when version is provided…
Browse files Browse the repository at this point in the history
… for module but sum doesn't exist
  • Loading branch information
Buzz-Lightyear authored and Buzz-Lightyear committed Aug 9, 2024
1 parent 28cc129 commit 5d4da43
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/bzlmod/go_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ def _get_sum_from_module(path, module, sums):
elif module.local_path == None:
# When updating a dependency, its sum may not be in go.sum and we can't hard fail here
# since we need Bazel to tidy the module
print("No sum for {}@{} found, run bazel run @rules_go//go -- mod tidy to generate it".format(path, module.raw_version)) #module.parent_label))
print("No sum for {}@{} found, run bazel run @rules_go//go -- mod tidy to generate it".format(path, module.raw_version))
return None

return sums[entry]
Expand Down
2 changes: 1 addition & 1 deletion internal/go_repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def _go_repository_impl(ctx):
if getattr(ctx.attr, key):
fail("cannot specify both version and %s" % key)
if ctx.attr.version and not ctx.attr.sum:
fail("if version is specified, sum must also be")
print("No sum for {}@{} found, run bazel run @rules_go//go -- mod tidy to generate it".format(ctx.attr.importpath, ctx.attr.version))

fetch_path = ctx.attr.replace if ctx.attr.replace else ctx.attr.importpath
fetch_repo_args = [
Expand Down

0 comments on commit 5d4da43

Please sign in to comment.