Skip to content

Commit

Permalink
warn if integrity not specified for archive_override (bazelbuild#1753)
Browse files Browse the repository at this point in the history
  • Loading branch information
scaiper committed Mar 13, 2024
1 parent f590ca1 commit eca3d74
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/go_repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,19 @@ def _go_repository_impl(ctx):
for key in ("commit", "tag", "vcs", "remote", "version", "sum", "replace"):
if getattr(ctx.attr, key):
fail("cannot specifiy both urls and %s" % key, key)
ctx.download_and_extract(
result = ctx.download_and_extract(
url = ctx.attr.urls,
sha256 = ctx.attr.sha256,
canonical_id = ctx.attr.canonical_id,
stripPrefix = ctx.attr.strip_prefix,
type = ctx.attr.type,
auth = use_netrc(read_user_netrc(ctx), ctx.attr.urls, ctx.attr.auth_patterns),
)
if not ctx.attr.sha256:
print("For Go module \"{path}\", integrity not specified, calculated sha256 = \"{sha256}\"".format(
path = ctx.attr.importpath,
sha256 = result.sha256,
))
elif ctx.attr.commit or ctx.attr.tag:
# repository mode
if ctx.attr.commit:
Expand Down

0 comments on commit eca3d74

Please sign in to comment.