mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-22 09:29:38 +00:00
config: drop BuildTime support, make builds reproducible
Nobody cares, really. But we care about build being reproducible, one source tree corresponds to one binary with one checksum.
This commit is contained in:
parent
3dfb1189f2
commit
6647317680
3 changed files with 2 additions and 9 deletions
|
@ -15,10 +15,9 @@ ARG VERSION=dev
|
|||
# https://github.com/golang/go/wiki/Modules#how-do-i-use-vendoring-with-modules-is-vendoring-going-away
|
||||
# go build -mod=vendor
|
||||
RUN set -x \
|
||||
&& export BUILD_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
|
||||
&& export GOGC=off \
|
||||
&& export CGO_ENABLED=0 \
|
||||
&& export LDFLAGS="-X ${REPO}/config.Version=${VERSION} -X ${REPO}/config.BuildTime=${BUILD_TIME}" \
|
||||
&& export LDFLAGS="-X ${REPO}/config.Version=${VERSION}" \
|
||||
&& go build -v -mod=vendor -ldflags "${LDFLAGS}" -o /go/bin/node ./cli/main.go
|
||||
|
||||
# Executable image
|
||||
|
|
4
Makefile
4
Makefile
|
@ -1,19 +1,17 @@
|
|||
BRANCH = "master"
|
||||
BUILD_TIME = "$(shell date -u +\"%Y-%m-%dT%H:%M:%SZ\")"
|
||||
REPONAME = "neo-go"
|
||||
NETMODE ?= "privnet"
|
||||
BINARY = "./bin/neo-go"
|
||||
|
||||
REPO ?= "$(shell go list -m)"
|
||||
VERSION ?= "$(shell git describe --tags 2>/dev/null | sed 's/^v//')"
|
||||
BUILD_FLAGS = "-X $(REPO)/config.Version=$(VERSION) -X $(REPO)/config.BuildTime=$(BUILD_TIME)"
|
||||
BUILD_FLAGS = "-X $(REPO)/config.Version=$(VERSION)"
|
||||
|
||||
build: deps
|
||||
@echo "=> Building binary"
|
||||
@set -x \
|
||||
&& export GOGC=off \
|
||||
&& export CGO_ENABLED=0 \
|
||||
&& echo $(VERSION)-$(BUILD_TIME) \
|
||||
&& go build -v -mod=vendor -ldflags $(BUILD_FLAGS) -o ${BINARY} ./cli/main.go
|
||||
|
||||
image: deps
|
||||
|
|
|
@ -25,10 +25,6 @@ const (
|
|||
var (
|
||||
// Version the version of the node, set at build time.
|
||||
Version string
|
||||
|
||||
// BuildTime the time and date the current version of the node built,
|
||||
// set at build time.
|
||||
BuildTime string
|
||||
)
|
||||
|
||||
type (
|
||||
|
|
Loading…
Reference in a new issue