From 3ddb92d99b1c689debe9281a3f329f9087f09f46 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Fri, 5 Feb 2021 13:11:35 +0100 Subject: [PATCH] make: clean mobile stubs before building release To fix an issue where the vendor.tar.gz in a release build had a different hash if the mobile RPC stubs were in the mobile/ folder, we clean those out first. The culprit was the `google.golang.org/grpc/test/bufconn` package which is currently only used in the mobile RPC stubs and nowhere else. Therefore the vendor/module.txt was different when vendoring with the generated mobile RPC stubs being around. --- Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 8cc45fab..eef8a400 100644 --- a/Makefile +++ b/Makefile @@ -150,12 +150,14 @@ release-install: env CGO_ENABLED=0 $(GOINSTALL) -v -trimpath -ldflags="$(RELEASE_LDFLAGS)" -tags="$(RELEASE_TAGS)" $(PKG)/cmd/lnd env CGO_ENABLED=0 $(GOINSTALL) -v -trimpath -ldflags="$(RELEASE_LDFLAGS)" -tags="$(RELEASE_TAGS)" $(PKG)/cmd/lncli -release: +# Make sure the generated mobile RPC stubs don't influence our vendor package +# by removing them first in the clean-mobile target. +release: clean-mobile @$(call print, "Releasing lnd and lncli binaries.") $(VERSION_CHECK) ./scripts/release.sh build-release "$(VERSION_TAG)" "$(BUILD_SYSTEM)" "$(RELEASE_TAGS)" "$(RELEASE_LDFLAGS)" -docker-release: +docker-release: clean-mobile @$(call print, "Building release helper docker image.") if [ "$(tag)" = "" ]; then echo "Must specify tag=!"; exit 1; fi @@ -299,6 +301,10 @@ clean: $(RM) ./lnd-itest ./lncli-itest $(RM) -r ./vendor .vendor-new +clean-mobile: + @$(call print, "Cleaning autogenerated mobile RPC stubs.") + $(RM) -r mobile/build + $(RM) mobile/*_generated.go .PHONY: all \ btcd \