diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 63c969303..331066e02 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -121,8 +121,8 @@ jobs: ``` tar -xvzf vendor.tar.gz tar -xvzf lnd-source-${{ env.RELEASE_VERSION }}.tar.gz - GO111MODULE=on go install -v -mod=vendor -ldflags "-X github.com/lightningnetwork/lnd/build.Commit=${{ env.RELEASE_VERSION }}" ./cmd/lnd - GO111MODULE=on go install -v -mod=vendor -ldflags "-X github.com/lightningnetwork/lnd/build.Commit=${{ env.RELEASE_VERSION }}" ./cmd/lncli + go install -v -mod=vendor -ldflags "-X github.com/lightningnetwork/lnd/build.Commit=${{ env.RELEASE_VERSION }}" ./cmd/lnd + go install -v -mod=vendor -ldflags "-X github.com/lightningnetwork/lnd/build.Commit=${{ env.RELEASE_VERSION }}" ./cmd/lncli ``` The `-mod=vendor` flag tells the `go build` command that it doesn't need to fetch the dependencies, and instead, they're all enclosed in the local vendor directory. diff --git a/Makefile b/Makefile index 30a568465..d4b55e108 100644 --- a/Makefile +++ b/Makefile @@ -25,19 +25,14 @@ COMMIT := $(shell git describe --tags --dirty) ACTIVE_GO_VERSION := $(shell $(GOCC) version | sed -nre 's/^[^0-9]*(([0-9]+\.)*[0-9]+).*/\1/p') ACTIVE_GO_VERSION_MINOR := $(shell echo $(ACTIVE_GO_VERSION) | cut -d. -f2) -LOOPVARFIX := -ifeq ($(shell expr $(ACTIVE_GO_VERSION_MINOR) \>= 21), 1) - LOOPVARFIX := GOEXPERIMENT=loopvar -endif - # GO_VERSION is the Go version used for the release build, docker files, and # GitHub Actions. This is the reference version for the project. All other Go # versions are checked against this version. GO_VERSION = 1.23.6 -GOBUILD := $(LOOPVARFIX) $(GOCC) build -v -GOINSTALL := $(LOOPVARFIX) $(GOCC) install -v -GOTEST := $(LOOPVARFIX) $(GOCC) test +GOBUILD := $(GOCC) build -v +GOINSTALL := $(GOCC) install -v +GOTEST := $(GOCC) 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") diff --git a/make/builder.Dockerfile b/make/builder.Dockerfile index c25ee6c96..88e3b283c 100644 --- a/make/builder.Dockerfile +++ b/make/builder.Dockerfile @@ -7,7 +7,6 @@ MAINTAINER Olaoluwa Osuntokun # Golang build related environment variables that are static and used for all # architectures/OSes. ENV GODEBUG netdns=cgo -ENV GO111MODULE=auto ENV CGO_ENABLED=0 # Set up cache directories. Those will be mounted from the host system to speed diff --git a/scripts/release.sh b/scripts/release.sh index 42a5f7d4e..3ae8c1ec7 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -98,7 +98,7 @@ function check_tag_correct() { fi # Build lnd to extract version. - env GOEXPERIMENT=loopvar go build ${PKG}/cmd/lnd + go build ${PKG}/cmd/lnd # Extract version command output. lnd_version_output=$(./lnd --version) @@ -189,8 +189,8 @@ required Go version ($goversion)." pushd "${dir}" green " - Building: ${os} ${arch} ${arm} with build tags '${buildtags}'" - env GOEXPERIMENT=loopvar 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/lncli + env 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 popd # Add the hashes for the individual binaries as well for easy verification