Skip to content

Building on Windows with GNU make results in unrunnable binary #11014

@bewing

Description

@bewing

Relevant telegraf.conf

[[outputs.file]]
   files = ["stdout"]

Logs from Telegraf

$ ./telegraf.exe --version
Telegraf -9e741ef2 (git: iss11007 9e741ef2)

./telegraf.exe --config C:\Users\bewing\telegraf.conf
panic:  is not in dotted-tri format

goroutine 1 [running]:
github.com/coreos/go-semver/semver.Must(...)
        C:/Users/bewing/go/pkg/mod/github.com/coreos/go-semver@v0.3.0/semver/semver.go:65
github.com/coreos/go-semver/semver.New({0x60736f0, 0xf})
        C:/Users/bewing/go/pkg/mod/github.com/coreos/go-semver@v0.3.0/semver/semver.go:49 +0x45
github.com/influxdata/telegraf/config.NewConfig()
        C:/Users/bewing/Projects/telegraf/config/config.go:121 +0x31c
main.runAgent({0x61cffc0, 0xc000442fc0}, {0x90206d8, 0x0, 0x0}, {0x90206d8, 0x0, 0x0})
        C:/Users/bewing/Projects/telegraf/cmd/telegraf/telegraf.go:210 +0x8b
main.reloadLoop({0x90206d8, 0x0, 0x0}, {0x90206d8, 0x0, 0x0})
        C:/Users/bewing/Projects/telegraf/cmd/telegraf/telegraf.go:158 +0x28a
main.run({0x90206d8, 0x0, 0x0}, {0x90206d8, 0x0, 0x0})
        C:/Users/bewing/Projects/telegraf/cmd/telegraf/telegraf_windows.go:28 +0xcc
main.main()
        C:/Users/bewing/Projects/telegraf/cmd/telegraf/telegraf.go:501 +0xa6a

System info

Telegraf 1.23.0, Windows 11, Powershell 5.1.22000.282, GNU make 3.81

Docker

No response

Steps to reproduce

Compile on Windows via make build

Expected behavior

Working binary

Actual behavior

Binary fails to start due to non-semantic versioning

Additional info

Output from make build:

$ make build
process_begin: CreateProcess(NULL, cat build_version.txt, ...) failed.
go build -ldflags " -X main.commit=9e741ef2 -X main.branch=iss11007 -X main.goos=windows -X main.goarch=amd64 -X main.version=-9e741ef2" ./cmd/telegraf

Having a fallback semantic version of 0.0.0 might work?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugunexpected problem or unintended behaviorplatform/windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions