فهرست منبع

build: pin and provision code generation tools

Co-authored-by: Cursor <cursoragent@cursor.com>
jamesread 1 روز پیش
والد
کامیت
fc74df041c
3فایلهای تغییر یافته به همراه17 افزوده شده و 10 حذف شده
  1. 1 2
      CONTRIBUTING.adoc
  2. 5 2
      Makefile
  3. 11 6
      service/Makefile

+ 1 - 2
CONTRIBUTING.adoc

@@ -46,8 +46,7 @@ pre-commit install
 pre-commit install --hook-type pre-push
 
 # Step3: compile binary for current dev env (OS, ARCH)
-# `make proto` will also run `make go-tools`, which installs "buf". This binary
-# will be put in your GOPATH/bin/, which should be on your path. buf is used to
+# `make proto` installs pinned protobuf tools in GOPATH/bin/ and uses buf to
 # generate the protobuf / Connect RPC stubs.
 make proto
 make

+ 5 - 2
Makefile

@@ -34,7 +34,10 @@ it:
 go-tools:
 	$(MAKE) -wC service go-tools
 
-proto: go-tools
+proto-tools:
+	$(MAKE) -wC service proto-tools
+
+proto: proto-tools
 	$(MAKE) -wC proto
 
 dist:
@@ -81,4 +84,4 @@ config-tool:
 devcheck:
 	python3 scripts/devcheck.py $(ARGS)
 
-.PHONY: proto default service windows-resources windows-msi frontend-unittests it devcheck
+.PHONY: proto proto-tools default service windows-resources windows-msi frontend-unittests it devcheck

+ 11 - 6
service/Makefile

@@ -2,6 +2,10 @@ define delete-files
 	python3 -c "import shutil;shutil.rmtree('$(1)', ignore_errors=True)"
 endef
 
+BUF_VERSION := v1.72.0
+GOLANGCI_LINT_VERSION := v2.13.2
+PROTOC_GEN_GO_VERSION := v1.36.12
+
 compile-currentenv:
 	go build
 
@@ -52,11 +56,12 @@ find-flakey-tests-inf:
 	go run ./scripts/find-flakey-tests-inf
 
 go-tools:
-	go install "github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.13.2"
+	go install "github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)"
+
+proto-tools:
+	go install "github.com/bufbuild/buf/cmd/buf@$(BUF_VERSION)"
+	go install "google.golang.org/protobuf/cmd/protoc-gen-go@$(PROTOC_GEN_GO_VERSION)"
 
-.PHONY: codestyle go-tools unittests unittests-fast find-flakey-tests find-flakey-tests-inf
+go-tools-all: go-tools proto-tools
 
-go-tools-all:
-	go install "github.com/bufbuild/buf/cmd/buf"
-	go install "github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.13.2"
-	go install "google.golang.org/protobuf/cmd/protoc-gen-go"
+.PHONY: codestyle go-tools proto-tools go-tools-all unittests unittests-fast find-flakey-tests find-flakey-tests-inf