Merge pull request #4190 from guggero/fix-windows-build

make+lnd+config: fix Windows build and version string
This commit is contained in:
Olaoluwa Osuntokun 2020-04-14 19:57:26 -07:00 committed by GitHub
commit 7b066ad91e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 6 deletions

@ -52,10 +52,10 @@ include make/testing_flags.mk
DEV_TAGS := $(if ${tags},$(DEV_TAGS) ${tags},$(DEV_TAGS)) DEV_TAGS := $(if ${tags},$(DEV_TAGS) ${tags},$(DEV_TAGS))
make_ldflags = $(shell echo -ldflags \"-X $(PKG)/build.Commit=$(COMMIT) \ make_ldflags = -ldflags "$(shell echo -X $(PKG)/build.Commit=$(COMMIT) \
-X $(PKG)/build.CommitHash=$(COMMIT_HASH) \ -X $(PKG)/build.CommitHash=$(COMMIT_HASH) \
-X $(PKG)/build.GoVersion=$(GOVERSION) \ -X $(PKG)/build.GoVersion=$(GOVERSION) \
-X $(PKG)/build.RawTags=$(shell echo $(1) | sed -e 's/ /,/g')\") -X $(PKG)/build.RawTags=$(shell echo $(1) | sed -e 's/ /,/g'))"
LDFLAGS := $(call make_ldflags, ${tags}) LDFLAGS := $(call make_ldflags, ${tags})
DEV_LDFLAGS := $(call make_ldflags, $(DEV_TAGS)) DEV_LDFLAGS := $(call make_ldflags, $(DEV_TAGS))

@ -205,7 +205,7 @@ func extractPathArgs(ctx *cli.Context) (string, string, error) {
func main() { func main() {
app := cli.NewApp() app := cli.NewApp()
app.Name = "lncli" app.Name = "lncli"
app.Version = build.Version() app.Version = build.Version() + " commit=" + build.Commit
app.Usage = "control plane for your Lightning Network Daemon (lnd)" app.Usage = "control plane for your Lightning Network Daemon (lnd)"
app.Flags = []cli.Flag{ app.Flags = []cli.Flag{
cli.StringFlag{ cli.StringFlag{

@ -478,7 +478,8 @@ func loadConfig() (*config, error) {
appName = strings.TrimSuffix(appName, filepath.Ext(appName)) appName = strings.TrimSuffix(appName, filepath.Ext(appName))
usageMessage := fmt.Sprintf("Use %s -h to show usage", appName) usageMessage := fmt.Sprintf("Use %s -h to show usage", appName)
if preCfg.ShowVersion { if preCfg.ShowVersion {
fmt.Println(appName, "version", build.Version()) fmt.Println(appName, "version", build.Version(),
"commit="+build.Commit)
os.Exit(0) os.Exit(0)
} }

5
lnd.go

@ -170,8 +170,9 @@ func Main(lisCfg ListenerCfg) error {
}() }()
// Show version at startup. // Show version at startup.
ltndLog.Infof("Version: %s, build=%s, logging=%s", ltndLog.Infof("Version: %s commit=%s, build=%s, logging=%s",
build.Version(), build.Deployment, build.LoggingType) build.Version(), build.Commit, build.Deployment,
build.LoggingType)
var network string var network string
switch { switch {