About version fetching #904
-
|
Right now at 0b98aaa , when I run: $ ov --version
ov version dev rev:HEADI dont know if this is a bug or not, so I will place it here first. Maybe it's just an user problem. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
This is not a bug - it's the expected behavior. When you see ov version dev rev:HEAD, it means you built the binary using go build or go install directly. To display the correct version information, you need to build using the Makefile: make build
# or
make installWhy this happensThe Makefile sets LDFLAGS to inject version information at build time: LDFLAGS := "-X main.Version=$(shell git describe --tags --abbrev=0 --always) -X main.Revision=$(shell git rev-parse --verify --short HEAD)"This sets:
When you use go build or go install directly without these flags, the default values defined in main.go are used (Version = "dev", Revision = "HEAD"). SolutionsRecommended: Use make build or make install go build -ldflags "-X main.Version=$(git describe --tags --abbrev=0 --always) -X main.Revision=$(git rev-parse --verify --short HEAD)" |
Beta Was this translation helpful? Give feedback.
This is not a bug - it's the expected behavior.
When you see ov version dev rev:HEAD, it means you built the binary using go build or go install directly.
To display the correct version information, you need to build using the Makefile:
make build # or make installWhy this happens
The Makefile sets LDFLAGS to inject version information at build time:
This sets:
When you use go build or go install directly without these flags, the default values defined in ma…