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

VERSION_FLAGS in Makefile are incorrect #666

Closed
r-ricci opened this issue Apr 3, 2022 · 1 comment · Fixed by #667
Closed

VERSION_FLAGS in Makefile are incorrect #666

r-ricci opened this issue Apr 3, 2022 · 1 comment · Fixed by #667

Comments

@r-ricci
Copy link
Contributor

r-ricci commented Apr 3, 2022

Describe the bug
since 1c28383 build info variables are defined in "github.com/mgechev/revive/cli", not "main", but the Makefile was not updated.

To Reproduce
Steps to reproduce the behavior:

$ git checkout b6c86a274f96f5351da68b225d3e394e5da2ac22
$ make build
$ ./revive -version
version (devel)

After applying this diff:

diff --git a/Makefile b/Makefile
index a707f32..6def06e 100644
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,7 @@ GIT_COMMIT ?= $(shell git rev-parse --verify HEAD)
 GIT_VERSION ?= $(shell git describe --tags --always --dirty="-dev")
 DATE ?= $(shell date -u '+%Y-%m-%d %H:%M UTC')
 BUILDER ?= Makefile
-VERSION_FLAGS := -X "main.version=$(GIT_VERSION)" -X "main.date=$(DATE)" -X "main.commit=$(GIT_COMMIT)" -X "main.builtBy=$(BUILDER)"
+VERSION_FLAGS := -X "github.com/mgechev/revive/cli.version=$(GIT_VERSION)" -X "github.com/mgechev/revive/cli.date=$(DATE)" -X "github.com/mgechev/revive/cli.commit=$(GIT_COMMIT)" -X "github.com/mgechev/revive/cli.builtBy=$(BUILDER)"
 
 install:
 	@go mod vendor
$ make build
$ ./revive -version
Version:        v1.2.0-4-gb6c86a2-dev
Commit:         b6c86a274f96f5351da68b225d3e394e5da2ac22
Built           2022-04-03 16:35 UTC by Makefile
@chavacava
Copy link
Collaborator

Hi @4ricci thanks for filling the issue. It seems you also know how to fix the problem,could you please make a PR?

chavacava pushed a commit that referenced this issue Apr 4, 2022
Since 1c28383 build info variables
are defined in "github.com/mgechev/revive/cli", not "main".

Fixes #666
subham-deepsource pushed a commit to DeepSourceCorp/revive that referenced this issue Apr 8, 2022
Since 1c28383 build info variables
are defined in "github.com/mgechev/revive/cli", not "main".

Fixes mgechev#666
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 a pull request may close this issue.

2 participants