From 5d4da436d1def953436288eaa18bd1d352576184 Mon Sep 17 00:00:00 2001 From: Buzz-Lightyear Date: Fri, 9 Aug 2024 09:37:51 -0400 Subject: [PATCH] Removing comment, changing hard fail to soft when version is provided for module but sum doesn't exist --- internal/bzlmod/go_deps.bzl | 2 +- internal/go_repository.bzl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/bzlmod/go_deps.bzl b/internal/bzlmod/go_deps.bzl index 62f8aad15..dcd0db37c 100644 --- a/internal/bzlmod/go_deps.bzl +++ b/internal/bzlmod/go_deps.bzl @@ -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] diff --git a/internal/go_repository.bzl b/internal/go_repository.bzl index afb044229..582e6b9f7 100644 --- a/internal/go_repository.bzl +++ b/internal/go_repository.bzl @@ -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 = [