From 18dce8fe1a84c076a7ddf2b22e3122d19123ce45 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Thu, 5 Aug 2021 10:11:53 +0530 Subject: [PATCH 1/3] fix: fix the issue of make proto-gen --- Makefile | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 9d4d589becc..02ec77b2bfe 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,7 @@ MOCKS_DIR = $(CURDIR)/tests/mocks HTTPS_GIT := https://github.com/cosmos/cosmos-sdk.git DOCKER := $(shell which docker) DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf +PROJECT_NAME = $(shell git remote get-url origin | xargs basename -s .git) export GO111MODULE = on @@ -327,17 +328,17 @@ benchmark: ### Linting ### ############################################################################### -containerMarkdownLintImage=tmknom/markdownlint -containerMarkdownLint=cosmos-sdk-markdownlint -containerMarkdownLintFix=cosmos-sdk-markdownlint-fix +markdownLintImage=tmknom/markdownlint +containerMarkdownLint=$(PROJECT_NAME)-sdk-markdownlint +containerMarkdownLintFix=$(PROJECT_NAME)-sdk-markdownlint-fix lint: golangci-lint run --out-format=tab - @if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerMarkdownLint}$$"; then docker start -a $(containerMarkdownLint); else docker run --name $(containerMarkdownLint) -i -v "$(CURDIR):/work" $(containerMarkdownLintImage); fi + @if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerMarkdownLint}$$"; then docker start -a $(containerMarkdownLint); else docker run --name $(containerMarkdownLint) -i -v "$(CURDIR):/work" $(markdownLintImage); fi lint-fix: golangci-lint run --fix --out-format=tab --issues-exit-code=0 - @if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerMarkdownLintFix}$$"; then docker start -a $(containerMarkdownLintFix); else docker run --name $(containerMarkdownLintFix) -i -v "$(CURDIR):/work" $(containerMarkdownLintImage) . --fix; fi + @if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerMarkdownLintFix}$$"; then docker start -a $(containerMarkdownLintFix); else docker run --name $(containerMarkdownLintFix) -i -v "$(CURDIR):/work" $(markdownLintImage) . --fix; fi .PHONY: lint lint-fix @@ -377,11 +378,12 @@ devdoc-update: ### Protobuf ### ############################################################################### -containerProtoVer=v0.2 -containerProtoImage=tendermintdev/sdk-proto-gen:$(containerProtoVer) -containerProtoGen=cosmos-sdk-proto-gen-$(containerProtoVer) -containerProtoGenSwagger=cosmos-sdk-proto-gen-swagger-$(containerProtoVer) -containerProtoFmt=cosmos-sdk-proto-fmt-$(containerProtoVer) +protoVer=v0.2 +protoImageName=tendermintdev/sdk-proto-gen:$(protoVer) +containerProtoGen=$(PROJECT_NAME)-sdk-proto-gen-$(protoVer) +containerProtoGenAny=$(PROJECT_NAME)-sdk-proto-gen-any-$(protoVer) +containerProtoGenSwagger=$(PROJECT_NAME)-sdk-proto-gen-swagger-$(protoVer) +containerProtoFmt=$(PROJECT_NAME)-sdk-proto-fmt-$(protoVer) proto-all: proto-format proto-lint proto-gen @@ -393,7 +395,8 @@ proto-gen: # This generates the SDK's custom wrapper for google.protobuf.Any. It should only be run manually when needed proto-gen-any: @echo "Generating Protobuf Any" - $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(containerProtoImage) sh ./scripts/protocgen-any.sh + @if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGenAny}$$"; then docker start -a $(containerProtoGenAny); else docker run --name $(containerProtoGenAny) -v $(CURDIR):/workspace --workdir /workspace $(containerProtoImage) \ + sh ./scripts/protocgen-any.sh; fi proto-swagger-gen: @echo "Generating Protobuf Swagger" From 9da7fc4d320fbb15de49430176764d8379b1ac0b Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Thu, 5 Aug 2021 10:15:12 +0530 Subject: [PATCH 2/3] update: update the changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2880158a22f..1c4cb92c1ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -96,6 +96,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [\#9762](https://github.com/cosmos/cosmos-sdk/pull/9762) The init command uses the chain-id from the client config if --chain-id is not provided * [\#9793](https://github.com/cosmos/cosmos-sdk/pull/9793) Fixed ECDSA/secp256r1 transaction malleability. * [\#9836](https://github.com/cosmos/cosmos-sdk/pull/9836) Fixes capability initialization issue on tx revert by moving initialization logic to `InitChain` and `BeginBlock`. +* [\#9854](https://github.com/cosmos/cosmos-sdk/pull/9854) Fixes the `make proto-gen` issue ### State Machine Breaking From 31361dd3e1ceb83bb644054167f00c9aebf933fa Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Sat, 7 Aug 2021 10:59:15 +0530 Subject: [PATCH 3/3] refactor: removed `sdk` prefix from containerProtoNames --- Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 02ec77b2bfe..5f2e27bae54 100644 --- a/Makefile +++ b/Makefile @@ -329,8 +329,8 @@ benchmark: ############################################################################### markdownLintImage=tmknom/markdownlint -containerMarkdownLint=$(PROJECT_NAME)-sdk-markdownlint -containerMarkdownLintFix=$(PROJECT_NAME)-sdk-markdownlint-fix +containerMarkdownLint=$(PROJECT_NAME)-markdownlint +containerMarkdownLintFix=$(PROJECT_NAME)-markdownlint-fix lint: golangci-lint run --out-format=tab @@ -380,10 +380,10 @@ devdoc-update: protoVer=v0.2 protoImageName=tendermintdev/sdk-proto-gen:$(protoVer) -containerProtoGen=$(PROJECT_NAME)-sdk-proto-gen-$(protoVer) -containerProtoGenAny=$(PROJECT_NAME)-sdk-proto-gen-any-$(protoVer) -containerProtoGenSwagger=$(PROJECT_NAME)-sdk-proto-gen-swagger-$(protoVer) -containerProtoFmt=$(PROJECT_NAME)-sdk-proto-fmt-$(protoVer) +containerProtoGen=$(PROJECT_NAME)-proto-gen-$(protoVer) +containerProtoGenAny=$(PROJECT_NAME)-proto-gen-any-$(protoVer) +containerProtoGenSwagger=$(PROJECT_NAME)-proto-gen-swagger-$(protoVer) +containerProtoFmt=$(PROJECT_NAME)-proto-fmt-$(protoVer) proto-all: proto-format proto-lint proto-gen