Skip to content

Commit 7ee5ef2

Browse files
authored
Update makego (#4624)
1 parent 9422641 commit 7ee5ef2

6 files changed

Lines changed: 21 additions & 9 deletions

File tree

make/go/bootstrap.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@ endef
1414
define _conditional_include
1515
$(if $(filter $(1),$(MAKEFILE_LIST)),,$(eval include $(1)))
1616
endef
17+
# Extracts the major.minor (e.g. 1.26) from a dotted version string (e.g. 1.26.3).
18+
define _major_minor
19+
$(word 1,$(subst ., ,$(1))).$(word 2,$(subst ., ,$(1)))
20+
endef

make/go/dep_buf.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ $(call _assert_var,CACHE_VERSIONS)
77
$(call _assert_var,CACHE_BIN)
88

99
# Settable
10-
# https://github.com/bufbuild/buf/releases 20260525 checked 20260525
11-
BUF_VERSION ?= v1.70.0
10+
# https://github.com/bufbuild/buf/releases 20260717 checked 20260717
11+
BUF_VERSION ?= v1.72.0
1212
# Settable
1313
#
1414
# If set, this path will be installed every time someone depends on $(BUF)

make/go/dep_bufstyle.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ $(call _assert_var,BUF_VERSION)
1010

1111
# We want to ensure we rebuild bufstyle every time we require a new Go minor version.
1212
# Otherwise, the cached version may not support the latest language features.
13-
BUFSTYLE_GO_VERSION := $(shell go list -m -f '{{.GoVersion}}' | cut -d'.' -f1-2)
13+
BUFSTYLE_GO_VERSION := $(call _major_minor,$(shell go list -m -f '{{.GoVersion}}'))
1414

1515
# Settable
1616
# https://github.com/bufbuild/bufstyle-go/releases

make/go/dep_godoclint.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ $(call _assert_var,BUF_VERSION)
1212
# Otherwise, the cached version may not support the latest language features.
1313
# This version is the go toolchain version (which may be more specific than the module
1414
# version) to ensure the build handles specific language features in newer toolchains.
15-
GODOCLINT_GOTOOLCHAIN_VERSION := $(shell go env GOVERSION | sed 's/^go//')
16-
GODOCLINT_GO_VERSION := $(shell echo $(GODOCLINT_GOTOOLCHAIN_VERSION) | cut -d'.' -f1-2)
15+
GODOCLINT_GOTOOLCHAIN_VERSION := $(patsubst go%,%,$(shell go env GOVERSION))
16+
GODOCLINT_GO_VERSION := $(call _major_minor,$(GODOCLINT_GOTOOLCHAIN_VERSION))
1717

1818
# Settable
1919
#

make/go/dep_govulncheck.mk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ $(call _assert_var,CACHE_BIN)
1010
# Otherwise, the cached version may not support the latest language features.
1111
# This version is the go toolchain version (which may be more specific than the module
1212
# version) to ensure the build handles specific language features in newer toolchains.
13-
GOVULNCHECK_GOTOOLCHAIN_VERSION := $(shell go env GOVERSION | sed 's/^go//')
14-
GOVULNCHECK_GO_VERSION := $(shell echo $(GOVULNCHECK_GOTOOLCHAIN_VERSION) | cut -d'.' -f1-2)
13+
GOVULNCHECK_GOTOOLCHAIN_VERSION := $(patsubst go%,%,$(shell go env GOVERSION))
14+
GOVULNCHECK_GO_VERSION := $(call _major_minor,$(GOVULNCHECK_GOTOOLCHAIN_VERSION))
1515

1616
# Settable
17-
# https://pkg.go.dev/golang.org/x/vuln/cmd/govulncheck 20260410 checked 20260422
18-
GOVULNCHECK_VERSION ?= v1.2.0
17+
# https://pkg.go.dev/golang.org/x/vuln/cmd/govulncheck 20260625 checked 20260625
18+
GOVULNCHECK_VERSION ?= v1.5.0
1919

2020
GOVULNCHECK := $(CACHE_BIN)/govulncheck
2121

make/go/go.mk

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ ci:
8787
@$(MAKE) lint
8888
@$(MAKE) test
8989

90+
.PHONY: preupgradegodeps
91+
preupgradegodeps::
92+
9093
.PHONY: postupgradegodeps
9194
postupgradegodeps::
9295

@@ -98,6 +101,7 @@ upgradegodeps:
98101
ifneq ($(GO_MOD_TOOLCHAIN),)
99102
go mod edit -toolchain=go$(GO_MOD_TOOLCHAIN)
100103
endif
104+
@$(MAKE) preupgradegodeps
101105
ifneq ($(GO_GET_PKGS),)
102106
go get $(GO_GET_PKGS)
103107
endif
@@ -172,8 +176,12 @@ endif
172176

173177
.PHONY: govulncheck
174178
govulncheck: $(GOVULNCHECK)
179+
ifneq ($(SKIP_GOVULNCHECK),)
180+
@echo Skipping govulncheck...
181+
else
175182
@echo govulncheck GOPKGS
176183
@govulncheck $(GOPKGS)
184+
endif
177185

178186
.PHONY: postlint
179187
postlint::

0 commit comments

Comments
 (0)