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

Include Git revision in version info #366

Closed
dnadlinger opened this issue May 25, 2013 · 3 comments
Closed

Include Git revision in version info #366

dnadlinger opened this issue May 25, 2013 · 3 comments

Comments

@dnadlinger
Copy link
Member

We should detect the presence of Git and include the commit hash in the version string for development builds. We had this with SVN (and maybe hg) in the past, but it was never ported to Git.

To make this workable, we should move to a single source file containing the version as a (C) string instead of adding a preprocessor define to every single compilation unit to avoid unnecessarily rebuilding the world all the time.

@redstar
Copy link
Member

redstar commented Jun 16, 2013

We could add this one: https://github.com/rpavlik/cmake-modules/blob/master/GetGitRevisionDescription.cmake
Boost license should be ok.

@dnadlinger
Copy link
Member Author

Yep, something like this looks good. Just need to move the version into its own file (as opposed to a preprocessor definition) to avoid recompiling the world every time the working tree is touched.

redstar added a commit to redstar/ldc that referenced this issue Jun 17, 2013
CMakeLists.txt contains now the version numbers for DMD and (next) LDC release.
If a .git folder is found then the LDC version is replaced by the first 6 chars
of the Git revision.

Possible improvements:
- If the build is not done at the master branch then it could be useful to
  check for a tag and use the tag instead of the revision. (for release builds)
- Maybe it is useful to include the branch name.

This fixes issue ldc-developers#366.
redstar added a commit to redstar/ldc that referenced this issue Jun 21, 2013
CMakeLists.txt contains now the version numbers for DMD and (next) LDC release.
If a .git folder is found then the LDC version is replaced by the first 6 chars
of the Git revision.

Possible improvements:

- If the build is not done at the master branch then it could be useful to check for a tag and use the tag instead of the revision. (for release builds)
- Maybe it is useful to include the branch name.

This fixes issue ldc-developers#366.
@redstar
Copy link
Member

redstar commented Jun 30, 2013

Fixed with pull request #408.

@redstar redstar closed this as completed Jun 30, 2013
redstar pushed a commit that referenced this issue Sep 27, 2014
Fixup 5375 due to lack of error message.
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

2 participants