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

ENH: Version info in repo #1246

Merged
merged 3 commits into from
Oct 18, 2021
Merged

ENH: Version info in repo #1246

merged 3 commits into from
Oct 18, 2021

Conversation

cookpa
Copy link
Member

@cookpa cookpa commented Sep 30, 2021

ENH: Encode version information in repo

This avoids the placeholder version name 0.0.0.0 for tarball builds, which causes problems with external builds.

Version.cmake now contains hard-coded version numbers that are used
for builds (from git or tarball source). For releases, a variable
is set so that binaries have version vA.B.C. For other commits (not a
tagged release), the version is vA.B.C.dev. Builds from git repos
still contain the additional information about the number of commits
post-tag, and the short hash.

To make a release, first check out an up to date copy of master.
Then run Utilities/tagRelease.pl <tag>. This will update Version.cmake,
commit + push the changes, tag that commit, then change Version.cmake
back into dev mode, and commit + push the result.

This means:

  • Version info for git users will be similar to before. I added more chars to the abbreviated hash to conform to git convention
  • When building a release, users just need to download the source tarball from the releases page, and the binaries will have version "vX.Y.Z"
  • Git users can also use 'cmake -DANTS_BUILD_DISTRIBUTE=TRUE .beforemake install`, to get "vX.Y.Z".
  • When building HEAD not on a tagged commit, the version info in a source tarball has "vX.Y.Z.dev", so we know it was not the actual release code, but can localize it somewhat.

This is an alternative approach to the one proposed in #1241, which required a separate file to be bundled into releases. Fixes #1241

This avoids the placeholder version name 0.0.0.0 for tarball builds,
which causes problems with external builds.

Version.cmake now contains hard-coded version numbers that are used
for builds (from git or tarball source). For releases, a variable
is set so that binaries have version vA.B.C. For other commits (not a
tagged release), the version is vA.B.C.dev. Builds from git repos
still contain the additional information about the number of commits
post-tag, and the short hash.

To make a release, first be up to date on master, with a clean repo.
Then run Utilities/tagRelease.pl. This will update Version.cmake,
commit + push the changes, tag that commit, then change Version.cmake
back into dev mode, and commit + push the result.
Use 7 chars for short hash instead of 5 (git default is 7)
@gdevenyi
Copy link
Contributor

tag that commit, then change Version.cmake back into dev mode, and commit + push the result.

I think it's possible for the cmake/git code to detect if you're "on" a tag or not, such that you could avoid this dance and just append dev when you're not coincident with a tag>

@cookpa
Copy link
Member Author

cookpa commented Sep 30, 2021

tag that commit, then change Version.cmake back into dev mode, and commit + push the result.

I think it's possible for the cmake/git code to detect if you're "on" a tag or not, such that you could avoid this dance and just append dev when you're not coincident with a tag>

Git can detect that, and does in the code. But tarball users won't be able to use that.

I just want to avoid people saying "I have v2.3.5" when they could have any of a few dozen commits post 2.3.5

@cookpa cookpa merged commit 31f7a61 into master Oct 18, 2021
@cookpa cookpa deleted the versionInfoInRepo branch April 20, 2022 19:34
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.

None yet

2 participants