Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix version info missing #1228

Closed
wants to merge 2 commits into from
Closed

Fix version info missing #1228

wants to merge 2 commits into from

Conversation

daixiang0
Copy link
Contributor

Fix #1208

If GO111MODULE does not turn on, set mod as vendor would make version info miss,

Signed-off-by: Xiang Dai 764524258@qq.com

Signed-off-by: Xiang Dai <764524258@qq.com>
Signed-off-by: Xiang Dai <764524258@qq.com>
@daixiang0
Copy link
Contributor Author

@slim-bean @rfratto @cyriltovena mind hava a look?

@slim-bean
Copy link
Collaborator

This overlaps some of the work done in #1095, however that PR looks more complete so I'd like to get that merged first and see if we still need this change.

Makefile Show resolved Hide resolved
@daixiang0
Copy link
Contributor Author

@slim-bean #1095 not fix this:

[root@test loki]# make cmd/loki/loki
CGO_ENABLED=0 go build -ldflags "-extldflags \"-static\" -s -w -X github.com/grafana/loki/vendor/github.com/prometheus/common/version.Branch=master -X github.com/grafana/loki/vendor/github.com/prometheus/common/version.Version=master-125cfbf -X github.com/grafana/loki/vendor/github.com/prometheus/common/version.Revision=125cfbf -X github.com/grafana/loki/vendor/github.com/prometheus/common/version.BuildUser=root@test.localdomain -X github.com/grafana/loki/vendor/github.com/prometheus/common/version.BuildDate=2019-11-27T11:12:14Z" -tags netgo -mod vendor -o cmd/loki/loki ./cmd/loki
[root@test loki]# ./cmd/loki/loki --version
loki, version  (branch: , revision: )
  build user:       
  build date:       
  go version:       go1.13.4
[root@test loki]# GO111MODULE=on make cmd/loki/loki
CGO_ENABLED=0 go build -ldflags "-extldflags \"-static\" -s -w -X github.com/grafana/loki/vendor/github.com/prometheus/common/version.Branch=master -X github.com/grafana/loki/vendor/github.com/prometheus/common/version.Version=master-125cfbf -X github.com/grafana/loki/vendor/github.com/prometheus/common/version.Revision=125cfbf -X github.com/grafana/loki/vendor/github.com/prometheus/common/version.BuildUser=root@test.localdomain -X github.com/grafana/loki/vendor/github.com/prometheus/common/version.BuildDate=2019-11-27T11:13:12Z" -tags netgo -mod vendor -o cmd/loki/loki ./cmd/loki
[root@test loki]# ./cmd/loki/loki --version
loki, version  (branch: , revision: )
  build user:       
  build date:       
  go version:       go1.13.4

@pstibrany
Copy link
Member

pstibrany commented Nov 27, 2019

-X github.com/grafana/loki/vendor/github.com/prometheus/common/version.Branch=master

if you still see this, then you're not using Makefile from #1095. It should look like this:

$ make cmd/loki/loki
CGO_ENABLED=0 go build -ldflags "-extldflags \"-static\" -s -w -X github.com/grafana/loki/pkg/loki.Branch=modvendor -X github.com/grafana/loki/pkg/loki.Version=modvendor-f5bf77d -X github.com/grafana/loki/pkg/loki.Revision=f5bf77da -X github.com/grafana/loki/pkg/loki.BuildUser=peter@Peters-iMac.local -X github.com/grafana/loki/pkg/loki.BuildDate=2019-11-27T11:18:23Z" -tags netgo -mod=vendor -o cmd/loki/loki ./cmd/loki

(it wasn't yet merged)

@daixiang0
Copy link
Contributor Author

oh my mistake, wait for merge! @pstibrany

@sh0rez
Copy link
Member

sh0rez commented Nov 30, 2019

Closing in favor of #1095.

In case there is still something valuable in here, please open a new PR

@sh0rez sh0rez closed this Nov 30, 2019
@daixiang0 daixiang0 deleted the version branch December 2, 2019 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v0.4.0: x_build_info isn't emitting version anymore.
4 participants