From 987f340cf636e111d8b47c7460ed5c3c1f220a93 Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Tue, 30 Jan 2024 10:01:56 -0500 Subject: [PATCH 1/2] build(golang): Support faster local iteration and align better with upstream * Replace synthetic "go-mod-cache" Makefile target with direct dependence upon go.sum. * Introduce support for `make SKIP_MOD_VERIFY=1` to avoid unnecessary expensive scans when e.g. tweaking referents of local-directory `replace $modulePath => ../path/to/module` directives in go.mod. --- golang/cosmos/Makefile | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/golang/cosmos/Makefile b/golang/cosmos/Makefile index 0429668f13c..803d169aefd 100644 --- a/golang/cosmos/Makefile +++ b/golang/cosmos/Makefile @@ -61,10 +61,10 @@ node-compile-gyp: npm run build:gyp; \ fi -compile-agd: go-mod-cache +compile-agd: go.sum go build -v $(MOD_READONLY) $(BUILD_FLAGS) -buildmode=exe -o build/agd ./cmd/agd -install-agd: go-mod-cache +install-agd: go.sum go install -v $(MOD_READONLY) $(BUILD_FLAGS) -buildmode=exe ./cmd/agd # Only run from the package.json build:gyp script. @@ -73,17 +73,18 @@ compile-gyp: node-gyp configure build $(GYP_DEBUG) || { status=$$?; rm -f binding.gyp; exit $$status; } rm -f binding.gyp -compile-libdaemon: go-mod-cache +compile-libdaemon: go.sum go build -v $(MOD_READONLY) $(SHARED_BUILD_FLAGS) -buildmode=c-shared \ -o build/libagcosmosdaemon.so ./cmd/libdaemon/main.go -go-mod-cache: go.sum - @echo "--> Download go modules to local cache" - @go mod download - go.sum: go.mod - @echo "--> Ensure dependencies have not been modified" + @echo "--> Ensure dependencies have not been modified unless suppressed by SKIP_MOD_VERIFY ..." +ifndef SKIP_MOD_VERIFY GO111MODULE=on go mod verify +endif + GO111MODULE=on go mod tidy + @echo "--> Download go modules to local cache" + go mod download ############################################################################### ### Protobuf ### From 670cb8a58c99f0b0197eff4273f7ca2f66e6bbc6 Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Thu, 29 Aug 2024 11:46:20 -0400 Subject: [PATCH 2/2] chore: Update update-protos.sh to use correct make target --- packages/cosmic-proto/update-protos.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cosmic-proto/update-protos.sh b/packages/cosmic-proto/update-protos.sh index 3e73512067f..2c65c328070 100755 --- a/packages/cosmic-proto/update-protos.sh +++ b/packages/cosmic-proto/update-protos.sh @@ -7,7 +7,7 @@ AG_SDK=$(readlink -f "$(dirname -- "$(readlink -f -- "$0")")/../..") # go ensure fresh build cd "$AG_SDK"/golang/cosmos -make go-mod-cache +SKIP_MOD_VERIFY=1 make go.sum COSMOS_SDK=$(go list -m -f '{{ .Dir }}' github.com/cosmos/cosmos-sdk) IBC_GO=$(go list -m -f '{{ .Dir }}' github.com/cosmos/ibc-go/v6) cd -