tailscale: fix -version

tailscale version, tailscaled -version and the web UI reported the wrong
version number which doesn't cause any issues, but it can be confusing.

This is fixed by specifying the version in go ldflags similar to how
it's done in many other go packages and the official tailscale Dockerfile.

version.Long version can not be specified in GO_PKG_LDFLAGS_X because it
contains a space and GO_PKG_LDFLAGS_X is always split at a space.

Signed-off-by: Michal Vasilek <michal.vasilek@nic.cz>
This commit is contained in:
Michal Vasilek 2022-10-12 19:29:55 +02:00 committed by Beginner-Go
parent 5ae0abe554
commit c8573bb2ba

View File

@ -27,6 +27,8 @@ PKG_USE_MIPS16:=0
GO_PKG:=\ GO_PKG:=\
tailscale.com/cmd/tailscale \ tailscale.com/cmd/tailscale \
tailscale.com/cmd/tailscaled tailscale.com/cmd/tailscaled
GO_PKG_LDFLAGS:=-X 'tailscale.com/version.Long=$(PKG_VERSION)-$(PKG_RELEASE) (OpenWrt)'
GO_PKG_LDFLAGS_X:=tailscale.com/version.Short=$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
include ../../lang/golang/golang-package.mk include ../../lang/golang/golang-package.mk