build: clean up the VERSION file#3112
Conversation
create two separate files, charm-version.h and charm-api-version.h in include/, with the git version and release/API version respectively.
|
This is somewhat risky and the changes are not very well tested, but it fixes an important issue users have been seeing. @rbuch: Could you please check if the changes related to the tarball packaging work as expected? |
CMakeLists.txt
Outdated
| file(WRITE ${CMAKE_BINARY_DIR}/include/.vdir "${CMK_VDIR}\n") | ||
| file(WRITE ${CMAKE_BINARY_DIR}/include/VERSION "${CHARM_VERSION}\n") | ||
| file(WRITE ${CMAKE_BINARY_DIR}/include/charm-version.h "#define CHARM_VERSION "${CHARM_VERSION}"\n") | ||
| file(WRITE ${CMAKE_BINARY_DIR}/include/charm-api-version.h "#define CHARM_API_VERSION ${PROJECT_VERSION}\n") |
There was a problem hiding this comment.
I suggest to #define CHARM_VERSION_{MAJOR,MINOR,PATCH} as well
rbuch
left a comment
There was a problem hiding this comment.
Using $(cat charm-version.h | grep CHARM_VERSION | awk '{print $3}') in package-tarball.sh doesn't strip the version of the quotation marks, is there some other command that should be used for that? I'm confused why its use in src/scripts/Makefile doesn't result in extra quotation marks.
Good catch. Both |
|
Should this PR add mention of |
We could add this and also add documentation to the manual regarding |
|
Turns out that CHARM_VERSION is already used in conv-autoconfig.h (value is the same as CHARM_API_VERSION). |
|
One thing to note is some applications (at least Enzo-E) read the root VERSION file as part of their build process. I don't think that should stop us from making this change, just know that it will be a breaking one. |
|
Ready for review. |
|
Does this work correctly from a packaged tarball too? I get this from CMake with current master from a tarball: I don't know if passing |
Good point, should be fixed now. |
|
buildold says this: |
Ok, but this is not a regression with this PR as far as I can see. |
| rm -f charm-version.h | ||
| $DESTINATION/tmp/system_ln $DESTINATION/include/charm-version.h charm-version.h |
There was a problem hiding this comment.
Do we also want to remove charm-version-git.h here?
There was a problem hiding this comment.
Not sure, but I think the rm refers to the symlink only, and there is no symlink created for charm-version-git.h.
create two separate files, charm-version.h and charm-version-git.h in include/, with the release/API version and git version respectively. The files look like this: $ cat ./netlrts-darwin-x86_64/include/charm-version.h #define CHARM_VERSION 61002 #define CHARM_VERSION_MAJOR 6 #define CHARM_VERSION_MINOR 10 #define CHARM_VERSION_PATCH 2 $ cat ./netlrts-darwin-x86_64/include/charm-version-git.h #define CHARM_VERSION_GIT "v6.11.0-devel-430-g50bd748ad*" Fixes #2844. For the old build system, commitid.sh creates the charm-version-git.h file containing the git version of Charm++ (this version was previously contained in tmp/VERSION.
create two separate files,
charm-version.handcharm-version-git.hininclude/, with the release/API version and git version respectively.The files look like this:
Fixes #2844.
For the old build system,
commitid.shcreates thecharm-version-git.hfile containing the git version of Charm++ (this version was previously contained intmp/VERSION.