Skip to content

Commit

Permalink
build(ç): align ld flags
Browse files Browse the repository at this point in the history
  • Loading branch information
snobbee committed Oct 31, 2023
1 parent acc33d1 commit e7024c1
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 21 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ smart-contracts/yarn-error.log
test/integration/output.json
test/integration/sifchainrelayerdb/*
*.log

dist
12 changes: 8 additions & 4 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ builds:
- -trimpath
ldflags:
- -X github.com/cosmos/cosmos-sdk/version.Name=sifchain
- -X github.com/cosmos/cosmos-sdk/version.AppName=sifnoded
- -X github.com/cosmos/cosmos-sdk/version.ServerName=sifnoded
- -X github.com/cosmos/cosmos-sdk/version.ClientName=sifnoded
- -X github.com/cosmos/cosmos-sdk/version.Version={{ .Version }}
- -X github.com/cosmos/cosmos-sdk/version.Commit={{ .Commit }}
- -X github.com/cosmos/cosmos-sdk/version.BuildTags=ledger
Expand All @@ -38,7 +39,8 @@ builds:
- -trimpath
ldflags:
- -X github.com/cosmos/cosmos-sdk/version.Name=sifchain
- -X github.com/cosmos/cosmos-sdk/version.AppName=sifnoded
- -X github.com/cosmos/cosmos-sdk/version.ServerName=sifnoded
- -X github.com/cosmos/cosmos-sdk/version.ClientName=sifnoded
- -X github.com/cosmos/cosmos-sdk/version.Version=v{{ .Version }}
- -X github.com/cosmos/cosmos-sdk/version.Commit={{ .Commit }}
- -X github.com/cosmos/cosmos-sdk/version.BuildTags=ledger
Expand All @@ -58,7 +60,8 @@ builds:
- -trimpath
ldflags:
- -X github.com/cosmos/cosmos-sdk/version.Name=sifchain
- -X github.com/cosmos/cosmos-sdk/version.AppName=sifnoded
- -X github.com/cosmos/cosmos-sdk/version.ServerName=sifnoded
- -X github.com/cosmos/cosmos-sdk/version.ClientName=sifnoded
- -X github.com/cosmos/cosmos-sdk/version.Version=v{{ .Version }}
- -X github.com/cosmos/cosmos-sdk/version.Commit={{ .Commit }}
- -X github.com/cosmos/cosmos-sdk/version.BuildTags=ledger
Expand All @@ -78,7 +81,8 @@ builds:
- -trimpath
ldflags:
- -X github.com/cosmos/cosmos-sdk/version.Name=sifchain
- -X github.com/cosmos/cosmos-sdk/version.AppName=sifnoded
- -X github.com/cosmos/cosmos-sdk/version.ServerName=sifnoded
- -X github.com/cosmos/cosmos-sdk/version.ClientName=sifnoded
- -X github.com/cosmos/cosmos-sdk/version.Version=v{{ .Version }}
- -X github.com/cosmos/cosmos-sdk/version.Commit={{ .Commit }}
- -X github.com/cosmos/cosmos-sdk/version.BuildTags=ledger
Expand Down
39 changes: 23 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
CHAINNET?=betanet
BINARY?=sifnoded
GOPATH?=$(shell go env GOPATH)
GOBIN?=$(GOPATH)/bin
NOW=$(shell date +'%Y-%m-%d_%T')
COMMIT:=$(shell git log -1 --format='%H')
VERSION:=$(shell cat version)
IMAGE_TAG?=latest
CHAINNET ?= betanet
BINARY ?= sifnoded
GOPATH ?= $(shell go env GOPATH)
GOBIN ?= $(GOPATH)/bin
NOW = $(shell date +'%Y-%m-%d_%T')
COMMIT := $(shell git log -1 --format='%H')
VERSION := $(shell cat version)
IMAGE_TAG ?= latest
HTTPS_GIT := https://github.com/sifchain/sifnode.git
DOCKER ?= docker
DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf

GOFLAGS:=""
GOTAGS:=ledger
GOFLAGS := ""
GOTAGS := ledger

GO_VERSION := $(shell cat go.mod | grep -E 'go [0-9].[0-9]+' | cut -d ' ' -f 2)

ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=sifchain \
LDFLAGS = -X github.com/cosmos/cosmos-sdk/version.Name=sifchain \
-X github.com/cosmos/cosmos-sdk/version.ServerName=sifnoded \
-X github.com/cosmos/cosmos-sdk/version.ClientName=sifnoded \
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT)
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \
-X github.com/cosmos/cosmos-sdk/version.BuildTags=$(GOTAGS)

BUILD_FLAGS := -ldflags '$(ldflags)' -tags '$(GOTAGS)'
BUILD_FLAGS := -ldflags '$(LDFLAGS)' -tags '$(GOTAGS)'

BINARIES=./cmd/sifnoded ./cmd/sifgen ./cmd/ebrelayer ./cmd/siftest
BINARIES = ./cmd/sifnoded ./cmd/sifgen ./cmd/ebrelayer ./cmd/siftest

all: lint install

Expand Down Expand Up @@ -90,8 +91,8 @@ rollback:
### Protobuf ###
###############################################################################

protoVer=v0.3
protoImageName=tendermintdev/sdk-proto-gen:$(protoVer)
protoVer = v0.3
protoImageName = tendermintdev/sdk-proto-gen:$(protoVer)

proto-all: proto-format proto-lint proto-gen

Expand Down Expand Up @@ -133,6 +134,8 @@ release:
docker run \
--rm \
-e GITHUB_TOKEN=$(GITHUB_TOKEN) \
-e LDFLAGS="$(LDFLAGS)" \
-e GOTAGS="$(GOTAGS)" \
-v /var/run/docker.sock:/var/run/docker.sock \
-v `pwd`:/go/src/sifnoded \
-w /go/src/sifnoded \
Expand All @@ -148,6 +151,8 @@ endif
release-dry-run:
docker run \
--rm \
-e LDFLAGS="$(LDFLAGS)" \
-e GOTAGS="$(GOTAGS)" \
-v /var/run/docker.sock:/var/run/docker.sock \
-v `pwd`:/go/src/sifnoded \
-w /go/src/sifnoded \
Expand All @@ -160,6 +165,8 @@ release-dry-run:
release-snapshot:
docker run \
--rm \
-e LDFLAGS="$(LDFLAGS)" \
-e GOTAGS="$(GOTAGS)" \
-v /var/run/docker.sock:/var/run/docker.sock \
-v `pwd`:/go/src/sifnoded \
-w /go/src/sifnoded \
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/Sifchain/sifnode

go 1.18
go 1.20

require (
github.com/BurntSushi/toml v1.2.0
Expand Down

0 comments on commit e7024c1

Please sign in to comment.