-
Notifications
You must be signed in to change notification settings - Fork 14
Description
Go 1.24 has support for managing tools via go.mod; see docs and this blog. We should replace the current tools.go files in both the examples module and the main module, and update the make targets accordingly.
- Upgrade
go.modto 1.24.1 - Upgrade
examples/go.modto 1.24.1 - Delete
tools.go - Delete
examples/tools.go - Update
Makefileto install tools - Update
examples/Makefileto install tools - Update
.github/workflows/go-test.ymlto 1.24.1 - Update
.github/workflows/golangci-lint.ymlto 1.24.1 - Migrate
gorums.code-workspacesettings to.vscode/settings.jsonand add ago.workfile for theexamplesmodule if necessary. - Run
go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -fix ./... - Update
Makefileandtests/Makefileto work more seamlessly. - Replace
protocwithbuf? - Replace the
third_party/status.protofile with the corresponding file from buf's BSR or from protobuf's go-mod path. - Replace
internal/leakcheck.gowith something more robust, such as uber-go/goleak.
The GitHub workflows should also upgrade to newer versions of the various actions.
Moreover, the Makefiles should ideally install versioned copies of the plugins managed by Go, which can be run by go tool protoc-gen-gorums. However, I'm not sure exactly how to run it via the protoc command, like this:
dev: installgorums ordering/ordering.pb.go ordering/ordering_grpc.pb.go
@rm -f $(dev_path)/zorums*.pb.go
@protoc -I=$(proto_path) \
--go_out=:. \
--gorums_out=dev=true:. \
--go_opt=default_api_level=API_OPAQUE \
$(zorums_proto)Or this:
%.pb.go : %.proto
@protoc -I=$(proto_path) \
--go_opt=default_api_level=API_OPAQUE \
--go_out=paths=source_relative:. $^However, this should be easy to replace:
$(static_file): $(static_files)
@cp $(static_file) $(static_file).bak
@protoc-gen-gorums --bundle=$(static_file)With something like:
$(static_file): $(static_files)
@cp $(static_file) $(static_file).bak
@go tool protoc-gen-gorums --bundle=$(static_file)I guess, when developing Gorums itself, we should probably use the current branch's code, but it is probably undesirable to install a dev version in the global path. This is because it might impact other modules (dat520, raft, oncetree etc.) that depend on an older version of protoc-gen-gorums.