There are several components of the Ocre version that gets compiled in the project.
The file src/common/version.h includes the Ocre Library version string.
While the file commit_id.h includes the commit ID of the Ocre Library.
If this file is not present in the source tree, the file is generated during the build process and is stored in the build directory.
If the file does not exist, and the source tree is not a valid git repository, the build will fail.
Note that these are unrelated to the Zephyr version and the Zephyr application version mechanism (i.e. through the use of the VERSION file in the Zephyr application directory).
These files together form the Ocre version variables, which are compiled statically into the struct ocre_config ocre_build_configuration struct defined in ocre/library.h:
struct ocre_config {
const char *version; /**< Version of the Ocre Library */
const char *commit_id; /**< Commit ID of the build tree */
const char *build_info; /**< Host build information */
const char *build_date; /**< Build date */
};
extern const struct ocre_config ocre_build_configuration;The specific meaning of these variables is as follows:
The version of the Ocre Library. In the form Major.Minor.Patch and is defined in the version.h file.
It follows the semantic versioning format.
Note the version.h file is not generated automatically. Instead it is maintained manually or automatically whenever we release a new version of the Ocre Runtime.
The commit ID of the build tree.
Generated every time into commit_id.h if the source tree is a valid git repository, otherwise, set to whatever is defined in commit_id.h.
The format is commit-hash[-dirty]. This is generated by the build system using git describe --always --abbrev=0 --dirty, so it means the current commit hash and if there are any uncommitted changes in the working tree (as specificied by the optional -dirty suffix).
The include/ocre/commit_id.h includes the commit ID of the Ocre Library in Ocre Common library.
If this file is not present in the source tree, the file is generated during the build process and is stored in the build directory.
If this file does not exist, and the source tree is not a valid git repository, the build will fail.
This file should never be created or modified by the user. When making the source distribution package of Ocre Runtime, this file will be generated in the source directory and the Git metatada will be removed.
The host build information. Generated on every build system by the build system automatically.
It has the format user @ system. Where user is the value of the USER environment variable and system is the output of uname -a.
The build date. Generated on every build system by the build system automatically.
It has the format YYYY-MM-DD HH:MM:SS TZ and is generated by date +'%Y-%m-%d %H:%M:%S %Z'
For more information about the build system, see Linux Build System and Zephyr Build System documentation.