-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Overhaul how VERSION.TXT is generated
Generate VERSION.TXT at build time rather than configure time. Since configuring only needs to happen infrequently, it was possible that the contents would be significantly out of date if a user configures, then after some time, fetches the latest changes and builds again. By moving generation to build time, we ensure that the time stamp (which includes a time and not just a day) is always maximally correct, and likewise that the git SHA is correct. Additionally, rather than just a time stamp, the first of the two values in VERSION.TXT now defaults to an actual version identifier of the usual form for experimental builds (i.e. 0.0.YYYYMMDD.HHMMSS+git<sha8>). This can be overridden by undocumented CMake variables, which are used by wheel and CI builds to inject "real" version numbers. (The git SHA can be similarly overridden, which is needed for Linux wheel builds as the Docker build environment has only the raw sources and is therefore unable to obtain the git SHA on its own.) Finally, tweak wheel builds to make use of these new mechanisms.
- Loading branch information
1 parent
9a8f606
commit 89db496
Showing
8 changed files
with
74 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
@BUILD_TIMESTAMP@ @GIT_REVISION@ | ||
@DRAKE_VERSION@ @GIT_REVISION@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
set(GIT_REVISION HEAD) | ||
set(BUILD_IDENTIFIER unknown) | ||
|
||
if(DEFINED DRAKE_GIT_SHA_OVERRIDE) | ||
set(GIT_REVISION "${DRAKE_GIT_SHA_OVERRIDE}") | ||
else() | ||
if(GIT_EXECUTABLE AND EXISTS "${GIT_DIR}") | ||
execute_process(COMMAND | ||
"${GIT_EXECUTABLE}" "--git-dir=${GIT_DIR}" rev-parse HEAD | ||
RESULT_VARIABLE GIT_REV_PARSE_RESULT_VARIABLE | ||
OUTPUT_VARIABLE GIT_REV_PARSE_OUTPUT_VARIABLE | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
|
||
if(GIT_REV_PARSE_RESULT_VARIABLE EQUAL 0) | ||
set(GIT_REVISION "${GIT_REV_PARSE_OUTPUT_VARIABLE}") | ||
string(SUBSTRING ${GIT_REVISION} 0 8 GIT_REVISION_SHORT) | ||
set(BUILD_IDENTIFIER git${GIT_REVISION_SHORT}) | ||
endif() | ||
endif() | ||
endif() | ||
|
||
if(DEFINED DRAKE_VERSION_OVERRIDE) | ||
set(DRAKE_VERSION "${DRAKE_VERSION_OVERRIDE}") | ||
else() | ||
string(TIMESTAMP BUILD_TIMESTAMP "%Y%m%d.%H%M%S") | ||
set(DRAKE_VERSION "0.0.${BUILD_TIMESTAMP}+${BUILD_IDENTIFIER}") | ||
endif() | ||
|
||
configure_file(${INPUT_FILE} ${OUTPUT_FILE} @ONLY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters