Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@problame
Copy link
Member

Summary

Migrate from the old tools.go pattern (with a separate build/ module) to Go 1.24's native tool directive support as explained in https://go.dev/doc/modules/managing-dependencies#tools

Changes

  • Update go.mod to Go 1.24.0 with tool directive block
  • Remove build/go.mod, build/tools.go, and related scripts (go_install_tools.bash, go_install_host_tool.source)
  • Update Makefile to use go tool instead of installed binaries:
    • GOCOVMERGE now uses \$(GO) tool gocovmerge
    • lint target uses \$(GO) tool golangci-lint
    • format target uses \$(GO) tool goimports

Caveat

protoc plugins (protoc-gen-go, protoc-gen-go-grpc) still require go install tool because protoc doesn't yet support invoking tools via go tool directly. See review comment for tracking issue.

Before this PR, config parsing would accept duplicate job names.
`zrepl daemon` would later fail to start with a panic.
But tools like `zrepl configcheck` would pass.

This PR adds a check to ensure job names are unique.

Similarly, internal job names were not being rejected by config
parsing
Move that check to parse-time as well.
Migrate from the old tools.go pattern (with a separate build/ module)
to Go 1.24's native tool directive support.

Changes:
- Update go.mod to Go 1.24.0 with tool directive block
- Remove build/go.mod, build/tools.go, and related scripts
- Update Makefile to use 'go tool' instead of installed binaries
- GOCOVMERGE now uses '$(GO) tool gocovmerge'
- lint/format targets use '$(GO) tool golangci-lint/goimports'

Note: protoc plugins still require 'go install tool' because protoc
doesn't yet support 'go tool' directly.

Ref: https://go.dev/doc/modules/managing-dependencies#tools
Copy link
Member Author

@problame problame left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ TODO (Makefile L334): The go install tool is a workaround because protoc doesn't yet support invoking plugins via go tool directly.

Once protocolbuffers/protobuf#23509 is resolved, we can remove this and rely purely on go tool for all tools.

Track this issue and revisit when protobuf adds support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant