From 388c41c412c24b751c8c09465787ae79bceca9c7 Mon Sep 17 00:00:00 2001 From: David Finkel Date: Sun, 24 Aug 2025 15:15:06 -0400 Subject: cmd/go: skip git sha256 tests if git < 2.29 Fix test building on older Ubuntu LTS releases (that are still supported). Git SHA256 support was only included in 2.29, which came out in 2021. Check the output of `git version` and skip these tests if the version is older than that introduction. Thanks to @ianlancetaylor for flagging this. Updates: #73704 Change-Id: I9d413a63fa43f34f94c274bba7f7b883c80433b6 Reviewed-on: https://go-review.googlesource.com/c/go/+/698835 LUCI-TryBot-Result: Go LUCI Reviewed-by: Michael Matloob Reviewed-by: Michael Matloob Auto-Submit: Michael Matloob Reviewed-by: Ian Alexander --- src/cmd/internal/script/engine.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/cmd/internal') diff --git a/src/cmd/internal/script/engine.go b/src/cmd/internal/script/engine.go index 4607868379..05b9433d3e 100644 --- a/src/cmd/internal/script/engine.go +++ b/src/cmd/internal/script/engine.go @@ -55,6 +55,8 @@ import ( "errors" "fmt" "io" + "maps" + "slices" "sort" "strings" "time" @@ -518,7 +520,7 @@ func (e *Engine) conditionsActive(s *State, conds []condition) (bool, error) { if ok { impl = e.Conds[prefix] if impl == nil { - return false, fmt.Errorf("unknown condition prefix %q", prefix) + return false, fmt.Errorf("unknown condition prefix %q; known: %v", prefix, slices.Collect(maps.Keys(e.Conds))) } if !impl.Usage().Prefix { return false, fmt.Errorf("condition %q cannot be used with a suffix", prefix) -- cgit v1.3