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.
This commit is contained in:
Oliver Gugger 2021-02-05 13:11:35 +01:00
parent 2d9a030ae5
commit 3ddb92d99b
No known key found for this signature in database
GPG Key ID: 8E4256593F177720

View File

@ -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=<commit_or_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 \