Skip to content

Commit

Permalink
Upgrade from makego
Browse files Browse the repository at this point in the history
  • Loading branch information
doriable committed Dec 17, 2024
1 parent 94679e3 commit a899ec9
Show file tree
Hide file tree
Showing 26 changed files with 2,878 additions and 2,760 deletions.
5 changes: 5 additions & 0 deletions make/go/buf.mk
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,8 @@ bufbreaking: $(BUF)
postlint:: bufbreaking
endif
endif

.PHONY: updatebufversion
updatebufversion:
$(SED_I) -E "s/BUF_VERSION \?=.*/BUF_VERSION ?= v${RELEASE_BUF_VERSION}/" "make/go/dep_buf.mk"
$(SED_I) -E "s/\# https\:\/\/github.com\/bufbuild\/buf\/releases.*/\# https\:\/\/github.com\/bufbuild\/buf\/releases $(shell date "+%Y%m%d") checked $(shell date "+%Y%m%d")/" "make/go/dep_buf.mk"
4 changes: 2 additions & 2 deletions make/go/dep_buf.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ $(call _assert_var,CACHE_VERSIONS)
$(call _assert_var,CACHE_BIN)

# Settable
# https://github.com/bufbuild/buf/releases 20240911 checked 20240916
BUF_VERSION ?= v1.41.0
# https://github.com/bufbuild/buf/releases 20241114 checked 20241114
BUF_VERSION ?= v1.47.2
# Settable
#
# If set, this path will be installed every time someone depends on $(BUF)
Expand Down
7 changes: 3 additions & 4 deletions make/go/dep_golangci_lint.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@
# Must be set
$(call _assert_var,MAKEGO)
$(call _conditional_include,$(MAKEGO)/base.mk)
$(call _conditional_include,$(MAKEGO)/dep_jq.mk)
$(call _assert_var,CACHE_VERSIONS)
$(call _assert_var,CACHE_BIN)

# We want to ensure we rebuild golangci-lint every time we require a new Go minor version.
# Otherwise, the cached version may not support the latest language features.
GOLANGCI_LINT_GO_VERSION := $(shell go mod edit -json | jq -r .Go | cut -d'.' -f1-2)
GOLANGCI_LINT_GO_VERSION := $(shell go list -m -f '{{.GoVersion}}' | cut -d'.' -f1-2)

# Settable
# https://github.com/golangci/golangci-lint/releases 20240909 checked 20240916
# https://github.com/golangci/golangci-lint/releases 20241110 checked 20241113
# Contrast golangci-lint configuration with the one in https://github.com/connectrpc/connect-go/blob/main/.golangci.yml when upgrading
GOLANGCI_LINT_VERSION ?= v1.61.0
GOLANGCI_LINT_VERSION ?= v1.62.0

GOLANGCI_LINT := $(CACHE_VERSIONS)/golangci-lint/$(GOLANGCI_LINT_VERSION)-go$(GOLANGCI_LINT_GO_VERSION)
$(GOLANGCI_LINT):
Expand Down
11 changes: 4 additions & 7 deletions make/go/dep_jq.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,16 @@ JQ_VERSION ?= 1.7.1

ifeq ($(UNAME_OS),Darwin)
JQ_OS := macos
else ifeq ($(UNAME_OS),Linux)
JQ_OS := linux
endif

ifeq ($(UNAME_ARCH),x86_64)
JQ_ARCH := amd64
else
JQ_ARCH := $(UNAME_ARCH)
endif
endif

ifeq ($(UNAME_ARCH),x86_64)
ifeq ($(UNAME_OS),Linux)
JQ_OS := linux
JQ_ARCH := amd64
endif
endif
JQ := $(CACHE_VERSIONS)/jq/$(JQ_VERSION)
$(JQ):
@rm -f $(CACHE_BIN)/jq
Expand Down
4 changes: 2 additions & 2 deletions make/go/dep_protoc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ $(call _assert_var,CACHE_INCLUDE)
$(call _assert_var,CACHE_BIN)

# Settable
# https://github.com/protocolbuffers/protobuf/releases 20240523 checked 20240527
# https://github.com/protocolbuffers/protobuf/releases 20241204 checked 20241217
# NOTE: Set to version compatible with genproto source code (only used in tests).
PROTOC_VERSION ?= 27.0
PROTOC_VERSION ?= 29.1

# Google adds a dash to release candidate versions in the name of the
# release artifact, i.e. v27.0-rc1 -> v27.0-rc-1
Expand Down
2 changes: 1 addition & 1 deletion make/go/dep_protoc_gen_go.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ $(call _assert_var,CACHE_VERSIONS)
$(call _assert_var,CACHE_BIN)

# Settable
# https://github.com/protocolbuffers/protobuf-go/releases 20241216 checked 20241216
# https://github.com/protocolbuffers/protobuf-go/releases 20241216 checked 20241217
PROTOC_GEN_GO_VERSION ?= v1.36.0

GO_GET_PKGS := $(GO_GET_PKGS) \
Expand Down
18 changes: 9 additions & 9 deletions make/go/dep_yq.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ YQ_VERSION ?= v4.44.1

ifeq ($(UNAME_OS),Darwin)
YQ_OS := darwin
ifeq ($(UNAME_ARCH),x86_64)
YQ_ARCH := amd64
endif
ifeq ($(UNAME_ARCH),arm64)
YQ_ARCH := arm64
endif
else ifeq ($(UNAME_OS),Linux)
YQ_OS := linux
endif

ifeq ($(UNAME_ARCH),x86_64)
ifeq ($(UNAME_OS),Linux)
YQ_OS := linux
YQ_ARCH := amd64
else ifeq ($(UNAME_ARCH),arm64)
YQ_ARCH := arm64
else ifeq ($(UNAME_ARCH),aarch64)
YQ_ARCH := arm64
else
YQ_ARCH := $(UNAME_ARCH)
endif
endif


YQ := $(CACHE_VERSIONS)/yq/$(YQ_VERSION)
$(YQ):
Expand Down
20 changes: 2 additions & 18 deletions make/go/go.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@ GO_BINS ?=
# Settable
GO_TEST_BINS ?=
# Settable
GO_TEST_WASM_BINS ?=
# Settable
GO_GET_PKGS ?=
# Settable
GO_MOD_VERSION ?= 1.22
# Settable
GO_MOD_TOOLCHAIN ?= 1.23.2
GO_MOD_TOOLCHAIN ?= 1.23.4
# Settable
GO_ALL_REPO_PKGS ?= ./cmd/... ./internal/...
# Settable
Expand Down Expand Up @@ -144,7 +142,7 @@ build: prebuild ## Run go build.
pretest::

.PHONY: test
test: pretest installtest installtestwasm ## Run all go tests.
test: pretest installtest ## Run all go tests.
go test $(GO_TEST_FLAGS) $(GOPKGS)

.PHONY: testrace
Expand Down Expand Up @@ -205,17 +203,3 @@ endef

$(foreach gobin,$(sort $(GO_TEST_BINS)),$(eval $(call gotestbinfunc,$(gobin))))
$(foreach gobin,$(sort $(GO_TEST_BINS)),$(eval FILE_IGNORES := $(FILE_IGNORES) $(gobin)/$(notdir $(gobin))))

.PHONY: installtestwasm
installtestwasm::

define gotestwasmfunc
.PHONY: installtestwasm$(notdir $(1))
installtestwasm$(notdir $(1)):
GOOS=wasip1 GOARCH=wasm go build -o $(GOBIN)/$(notdir $(1)).wasm ./$(1)

installtestwasm:: installtestwasm$(notdir $(1))
endef

$(foreach gobin,$(sort $(GO_TEST_WASM_BINS)),$(eval $(call gotestwasmfunc,$(gobin))))
$(foreach gobin,$(sort $(GO_TEST_WASM_BINS)),$(eval FILE_IGNORES := $(FILE_IGNORES) $(gobin)/$(notdir $(gobin))))
4 changes: 2 additions & 2 deletions private/buf/bufprotopluginexec/bufprotopluginexec.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ const (
// defaultMajorVersion is the default major version.
defaultMajorVersion = 5
// defaultMinorVersion is the default minor version.
defaultMinorVersion = 27
defaultMinorVersion = 29
// defaultPatchVersion is the default patch version.
defaultPatchVersion = 0
defaultPatchVersion = 1
// defaultSuffixVersion is the default suffix version.
defaultSuffixVersion = ""
)
Expand Down
12 changes: 6 additions & 6 deletions private/bufpkg/bufimage/bufimageutil/testdata/any/c1.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ option objc_class_prefix = "GPB";
option optimize_for = SPEED;
message FeatureSet {
optional FieldPresence field_presence = 1 [
edition_defaults = { value: "EXPLICIT", edition: EDITION_PROTO2 },
edition_defaults = { value: "EXPLICIT", edition: EDITION_LEGACY },
edition_defaults = { value: "IMPLICIT", edition: EDITION_PROTO3 },
edition_defaults = { value: "EXPLICIT", edition: EDITION_2023 },
feature_support = { edition_introduced: EDITION_2023 },
Expand All @@ -55,38 +55,38 @@ message FeatureSet {
targets = TARGET_TYPE_FILE
];
optional EnumType enum_type = 2 [
edition_defaults = { value: "CLOSED", edition: EDITION_PROTO2 },
edition_defaults = { value: "CLOSED", edition: EDITION_LEGACY },
edition_defaults = { value: "OPEN", edition: EDITION_PROTO3 },
feature_support = { edition_introduced: EDITION_2023 },
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_ENUM,
targets = TARGET_TYPE_FILE
];
optional RepeatedFieldEncoding repeated_field_encoding = 3 [
edition_defaults = { value: "EXPANDED", edition: EDITION_PROTO2 },
edition_defaults = { value: "EXPANDED", edition: EDITION_LEGACY },
edition_defaults = { value: "PACKED", edition: EDITION_PROTO3 },
feature_support = { edition_introduced: EDITION_2023 },
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_FIELD,
targets = TARGET_TYPE_FILE
];
optional Utf8Validation utf8_validation = 4 [
edition_defaults = { value: "NONE", edition: EDITION_PROTO2 },
edition_defaults = { value: "NONE", edition: EDITION_LEGACY },
edition_defaults = { value: "VERIFY", edition: EDITION_PROTO3 },
feature_support = { edition_introduced: EDITION_2023 },
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_FIELD,
targets = TARGET_TYPE_FILE
];
optional MessageEncoding message_encoding = 5 [
edition_defaults = { value: "LENGTH_PREFIXED", edition: EDITION_PROTO2 },
edition_defaults = { value: "LENGTH_PREFIXED", edition: EDITION_LEGACY },
feature_support = { edition_introduced: EDITION_2023 },
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_FIELD,
targets = TARGET_TYPE_FILE
];
optional JsonFormat json_format = 6 [
edition_defaults = { value: "LEGACY_BEST_EFFORT", edition: EDITION_PROTO2 },
edition_defaults = { value: "LEGACY_BEST_EFFORT", edition: EDITION_LEGACY },
edition_defaults = { value: "ALLOW", edition: EDITION_PROTO3 },
feature_support = { edition_introduced: EDITION_2023 },
retention = RETENTION_RUNTIME,
Expand Down
12 changes: 6 additions & 6 deletions private/bufpkg/bufimage/bufimageutil/testdata/any/c2.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ option objc_class_prefix = "GPB";
option optimize_for = SPEED;
message FeatureSet {
optional FieldPresence field_presence = 1 [
edition_defaults = { value: "EXPLICIT", edition: EDITION_PROTO2 },
edition_defaults = { value: "EXPLICIT", edition: EDITION_LEGACY },
edition_defaults = { value: "IMPLICIT", edition: EDITION_PROTO3 },
edition_defaults = { value: "EXPLICIT", edition: EDITION_2023 },
feature_support = { edition_introduced: EDITION_2023 },
Expand All @@ -60,38 +60,38 @@ message FeatureSet {
targets = TARGET_TYPE_FILE
];
optional EnumType enum_type = 2 [
edition_defaults = { value: "CLOSED", edition: EDITION_PROTO2 },
edition_defaults = { value: "CLOSED", edition: EDITION_LEGACY },
edition_defaults = { value: "OPEN", edition: EDITION_PROTO3 },
feature_support = { edition_introduced: EDITION_2023 },
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_ENUM,
targets = TARGET_TYPE_FILE
];
optional RepeatedFieldEncoding repeated_field_encoding = 3 [
edition_defaults = { value: "EXPANDED", edition: EDITION_PROTO2 },
edition_defaults = { value: "EXPANDED", edition: EDITION_LEGACY },
edition_defaults = { value: "PACKED", edition: EDITION_PROTO3 },
feature_support = { edition_introduced: EDITION_2023 },
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_FIELD,
targets = TARGET_TYPE_FILE
];
optional Utf8Validation utf8_validation = 4 [
edition_defaults = { value: "NONE", edition: EDITION_PROTO2 },
edition_defaults = { value: "NONE", edition: EDITION_LEGACY },
edition_defaults = { value: "VERIFY", edition: EDITION_PROTO3 },
feature_support = { edition_introduced: EDITION_2023 },
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_FIELD,
targets = TARGET_TYPE_FILE
];
optional MessageEncoding message_encoding = 5 [
edition_defaults = { value: "LENGTH_PREFIXED", edition: EDITION_PROTO2 },
edition_defaults = { value: "LENGTH_PREFIXED", edition: EDITION_LEGACY },
feature_support = { edition_introduced: EDITION_2023 },
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_FIELD,
targets = TARGET_TYPE_FILE
];
optional JsonFormat json_format = 6 [
edition_defaults = { value: "LEGACY_BEST_EFFORT", edition: EDITION_PROTO2 },
edition_defaults = { value: "LEGACY_BEST_EFFORT", edition: EDITION_LEGACY },
edition_defaults = { value: "ALLOW", edition: EDITION_PROTO3 },
feature_support = { edition_introduced: EDITION_2023 },
retention = RETENTION_RUNTIME,
Expand Down
12 changes: 6 additions & 6 deletions private/bufpkg/bufimage/bufimageutil/testdata/any/c3.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ option objc_class_prefix = "GPB";
option optimize_for = SPEED;
message FeatureSet {
optional FieldPresence field_presence = 1 [
edition_defaults = { value: "EXPLICIT", edition: EDITION_PROTO2 },
edition_defaults = { value: "EXPLICIT", edition: EDITION_LEGACY },
edition_defaults = { value: "IMPLICIT", edition: EDITION_PROTO3 },
edition_defaults = { value: "EXPLICIT", edition: EDITION_2023 },
feature_support = { edition_introduced: EDITION_2023 },
Expand All @@ -65,38 +65,38 @@ message FeatureSet {
targets = TARGET_TYPE_FILE
];
optional EnumType enum_type = 2 [
edition_defaults = { value: "CLOSED", edition: EDITION_PROTO2 },
edition_defaults = { value: "CLOSED", edition: EDITION_LEGACY },
edition_defaults = { value: "OPEN", edition: EDITION_PROTO3 },
feature_support = { edition_introduced: EDITION_2023 },
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_ENUM,
targets = TARGET_TYPE_FILE
];
optional RepeatedFieldEncoding repeated_field_encoding = 3 [
edition_defaults = { value: "EXPANDED", edition: EDITION_PROTO2 },
edition_defaults = { value: "EXPANDED", edition: EDITION_LEGACY },
edition_defaults = { value: "PACKED", edition: EDITION_PROTO3 },
feature_support = { edition_introduced: EDITION_2023 },
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_FIELD,
targets = TARGET_TYPE_FILE
];
optional Utf8Validation utf8_validation = 4 [
edition_defaults = { value: "NONE", edition: EDITION_PROTO2 },
edition_defaults = { value: "NONE", edition: EDITION_LEGACY },
edition_defaults = { value: "VERIFY", edition: EDITION_PROTO3 },
feature_support = { edition_introduced: EDITION_2023 },
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_FIELD,
targets = TARGET_TYPE_FILE
];
optional MessageEncoding message_encoding = 5 [
edition_defaults = { value: "LENGTH_PREFIXED", edition: EDITION_PROTO2 },
edition_defaults = { value: "LENGTH_PREFIXED", edition: EDITION_LEGACY },
feature_support = { edition_introduced: EDITION_2023 },
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_FIELD,
targets = TARGET_TYPE_FILE
];
optional JsonFormat json_format = 6 [
edition_defaults = { value: "LEGACY_BEST_EFFORT", edition: EDITION_PROTO2 },
edition_defaults = { value: "LEGACY_BEST_EFFORT", edition: EDITION_LEGACY },
edition_defaults = { value: "ALLOW", edition: EDITION_PROTO3 },
feature_support = { edition_introduced: EDITION_2023 },
retention = RETENTION_RUNTIME,
Expand Down
12 changes: 6 additions & 6 deletions private/bufpkg/bufimage/bufimageutil/testdata/any/c4.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ option objc_class_prefix = "GPB";
option optimize_for = SPEED;
message FeatureSet {
optional FieldPresence field_presence = 1 [
edition_defaults = { value: "EXPLICIT", edition: EDITION_PROTO2 },
edition_defaults = { value: "EXPLICIT", edition: EDITION_LEGACY },
edition_defaults = { value: "IMPLICIT", edition: EDITION_PROTO3 },
edition_defaults = { value: "EXPLICIT", edition: EDITION_2023 },
feature_support = { edition_introduced: EDITION_2023 },
Expand All @@ -78,38 +78,38 @@ message FeatureSet {
targets = TARGET_TYPE_FILE
];
optional EnumType enum_type = 2 [
edition_defaults = { value: "CLOSED", edition: EDITION_PROTO2 },
edition_defaults = { value: "CLOSED", edition: EDITION_LEGACY },
edition_defaults = { value: "OPEN", edition: EDITION_PROTO3 },
feature_support = { edition_introduced: EDITION_2023 },
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_ENUM,
targets = TARGET_TYPE_FILE
];
optional RepeatedFieldEncoding repeated_field_encoding = 3 [
edition_defaults = { value: "EXPANDED", edition: EDITION_PROTO2 },
edition_defaults = { value: "EXPANDED", edition: EDITION_LEGACY },
edition_defaults = { value: "PACKED", edition: EDITION_PROTO3 },
feature_support = { edition_introduced: EDITION_2023 },
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_FIELD,
targets = TARGET_TYPE_FILE
];
optional Utf8Validation utf8_validation = 4 [
edition_defaults = { value: "NONE", edition: EDITION_PROTO2 },
edition_defaults = { value: "NONE", edition: EDITION_LEGACY },
edition_defaults = { value: "VERIFY", edition: EDITION_PROTO3 },
feature_support = { edition_introduced: EDITION_2023 },
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_FIELD,
targets = TARGET_TYPE_FILE
];
optional MessageEncoding message_encoding = 5 [
edition_defaults = { value: "LENGTH_PREFIXED", edition: EDITION_PROTO2 },
edition_defaults = { value: "LENGTH_PREFIXED", edition: EDITION_LEGACY },
feature_support = { edition_introduced: EDITION_2023 },
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_FIELD,
targets = TARGET_TYPE_FILE
];
optional JsonFormat json_format = 6 [
edition_defaults = { value: "LEGACY_BEST_EFFORT", edition: EDITION_PROTO2 },
edition_defaults = { value: "LEGACY_BEST_EFFORT", edition: EDITION_LEGACY },
edition_defaults = { value: "ALLOW", edition: EDITION_PROTO3 },
feature_support = { edition_introduced: EDITION_2023 },
retention = RETENTION_RUNTIME,
Expand Down
Loading

0 comments on commit a899ec9

Please sign in to comment.