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

Building Tagged Release from Source Doesn't set Version #714

Closed
ibrokemypie opened this issue Jun 22, 2017 · 2 comments
Closed

Building Tagged Release from Source Doesn't set Version #714

ibrokemypie opened this issue Jun 22, 2017 · 2 comments

Comments

@ibrokemypie
Copy link

Description of the problem or steps to reproduce

The binary produced from downloading the source of a tagged release, then 'make build'ing it doest get a version number or commit hash.

$ make build                                                          
fatal: Not a git repository (or any of the parent directories): .git
go get -d ./cmd/micro
go build -ldflags "-s -w -X main.Version=0.0.0-unknown -X main.CommitHash= -X 'main.CompileDate=June 22, 2017' " ./cmd/micro

Specifications

You can use micro -version to get the commit hash.

Commit hash:
OS: void linux
Terminal: xiate

@tommyshem
Copy link
Contributor

If you are getting the source from Source code (tar.gz) then it does not include the git repo info so you can not get a version or hash from it, with out hard coding version info in the Makefile yourself.

You have to use the micro-1.2.0-src.tar.gz to get version and hash from the git repo. There is a tag fault on v1.2.0 at the minute but hopfully it will be updated soon.

@zyedidia
Copy link
Owner

@tommyshem is correct. If you are getting the source from Github's build in Source code tar.gz, then it will be provided without the .git directory so micro will be unable to get the version from the git history.

You should use the micro-version-src.tar.gz instead which will provide the .git directory (as well as all dependencies and their .git directories -- which explains for the huge size).

I stopped providing the micro-version-src.tar.gz for a limited time, and it was also slightly bugged before (as you pointed out in #713). Please see my response their for the new situation.

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

No branches or pull requests

3 participants