Currently Roc tools (roc-recv, roc-send, roc-conv) can report version. The version is read from the version file during build time and passed to the tools using a preprocessor.
It would be very useful to report git commit sha as well. This is particularly useful when there are several boxes with binaries built from different commits yet from the same version.
The commit sha can be retrieved by:
git rev-parse HEAD
However, I think it would be better to avoid using git executable and retrieve it manually. Otherwise we will add build-time dependency on git, which is not really necessary and is inconvenient e.g. when building on an embedded host. Example:
cat .git/$(cat .git/HEAD | awk '{print $2}')
We should retrieve the sha SConstruct, add a preprocessor definition with the sha to the build, and report it in tools.
Currently Roc tools (roc-recv, roc-send, roc-conv) can report version. The version is read from the
version
file during build time and passed to the tools using a preprocessor.It would be very useful to report git commit sha as well. This is particularly useful when there are several boxes with binaries built from different commits yet from the same version.
The commit sha can be retrieved by:
However, I think it would be better to avoid using git executable and retrieve it manually. Otherwise we will add build-time dependency on git, which is not really necessary and is inconvenient e.g. when building on an embedded host. Example:
We should retrieve the sha SConstruct, add a preprocessor definition with the sha to the build, and report it in tools.