multi: remove unneeded env variables

With Go 1.23 we don't need to set any of these variables anymore, as
they're the default values now.
This commit is contained in:
Oliver Gugger 2025-02-18 12:33:43 +01:00
parent 70ac201cb8
commit 576da75a07
No known key found for this signature in database
GPG key ID: 8E4256593F177720
4 changed files with 8 additions and 14 deletions

View file

@ -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.

View file

@ -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")

View file

@ -7,7 +7,6 @@ MAINTAINER Olaoluwa Osuntokun <laolu@lightning.engineering>
# 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

View file

@ -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