mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-10 14:17:56 +01:00
build: build+install using GOEXPERIMENT=loopvar
We also update the release script to do the same as well.
This commit is contained in:
14
Makefile
14
Makefile
@@ -21,9 +21,17 @@ ANDROID_BUILD := $(ANDROID_BUILD_DIR)/Lndmobile.aar
|
|||||||
|
|
||||||
COMMIT := $(shell git describe --tags --dirty)
|
COMMIT := $(shell git describe --tags --dirty)
|
||||||
|
|
||||||
GOBUILD := go build -v
|
GO_VERSION := $(shell go version | sed -nre 's/^[^0-9]*(([0-9]+\.)*[0-9]+).*/\1/p')
|
||||||
GOINSTALL := go install -v
|
GO_VERSION_MINOR := $(shell echo $(GO_VERSION) | cut -d. -f2)
|
||||||
GOTEST := GOEXPERIMENT=loopvar go test
|
|
||||||
|
LOOPVARFIX :=
|
||||||
|
ifeq ($(shell expr $(GO_VERSION_MINOR) \>= 21), 1)
|
||||||
|
LOOPVARFIX := GOEXPERIMENT=loopvar
|
||||||
|
endif
|
||||||
|
|
||||||
|
GOBUILD := $(LOOPVARFIX) go build -v
|
||||||
|
GOINSTALL := $(LOOPVARFIX) go install -v
|
||||||
|
GOTEST := $(LOOPVARFIX) go test
|
||||||
|
|
||||||
GOFILES_NOVENDOR = $(shell find . -type f -name '*.go' -not -path "./vendor/*" -not -name "*pb.go" -not -name "*pb.gw.go" -not -name "*.pb.json.go")
|
GOFILES_NOVENDOR = $(shell find . -type f -name '*.go' -not -path "./vendor/*" -not -name "*pb.go" -not -name "*pb.gw.go" -not -name "*.pb.json.go")
|
||||||
|
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ function check_tag_correct() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Build lnd to extract version.
|
# Build lnd to extract version.
|
||||||
go build ${PKG}/cmd/lnd
|
env GOEXPERIMENT=loopvar go build ${PKG}/cmd/lnd
|
||||||
|
|
||||||
# Extract version command output.
|
# Extract version command output.
|
||||||
lnd_version_output=$(./lnd --version)
|
lnd_version_output=$(./lnd --version)
|
||||||
@@ -177,8 +177,8 @@ function build_release() {
|
|||||||
pushd "${dir}"
|
pushd "${dir}"
|
||||||
|
|
||||||
green " - Building: ${os} ${arch} ${arm} with build tags '${buildtags}'"
|
green " - Building: ${os} ${arch} ${arm} with build tags '${buildtags}'"
|
||||||
env CGO_ENABLED=0 GOOS=$os GOARCH=$arch GOARM=$arm go build -v -trimpath -ldflags="${ldflags}" -tags="${buildtags}" ${PKG}/cmd/lnd
|
env GOEXPERIMENT=loopvar CGO_ENABLED=0 GOOS=$os GOARCH=$arch GOARM=$arm go build -v -trimpath -ldflags="${ldflags}" -tags="${buildtags}" ${PKG}/cmd/lnd
|
||||||
env CGO_ENABLED=0 GOOS=$os GOARCH=$arch GOARM=$arm go build -v -trimpath -ldflags="${ldflags}" -tags="${buildtags}" ${PKG}/cmd/lncli
|
env GOEXPERIMENT=loopvar CGO_ENABLED=0 GOOS=$os GOARCH=$arch GOARM=$arm go build -v -trimpath -ldflags="${ldflags}" -tags="${buildtags}" ${PKG}/cmd/lncli
|
||||||
popd
|
popd
|
||||||
|
|
||||||
# Add the hashes for the individual binaries as well for easy verification
|
# Add the hashes for the individual binaries as well for easy verification
|
||||||
|
|||||||
Reference in New Issue
Block a user