In an ideal world, every CI engine records and shares the most important
CI information:
- current date and time in a well identified timezone
- git version of the pull request
- git version of the moving branch the PR is being merged with
In the real world we have multiple CI solutions and they unfortunately
cannot not all be trusted to perform their most basic job
correctly. Fortunately, they all make at least build logs available so
these very few lines of code adding very few lines of output cost near
zero extra build time and solve the problem once for all. I feel stupid
I didn't do this sooner, this would have saved me hours and hours in
vain requests and discussions and in trying to puzzle that information
together.
Sample output:
-- Preparing Xtensa toolchain
version.cmake starting SOF build at 2021-03-31T18:09:46Z UTC
Building git commit with parent(s):
150fd1e4c968 4249bdb1b305 [other parent if merge] (HEAD -> main) cmake: ...
-- GIT_TAG / GIT_LOG_HASH : v1.7-rc1-174-g150fd1e4c968-dirty / 150fd1e4c968
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
For at least two reasons:
- exposes sneaky change(s) performed by automation if/when any
- solves the mystery of the Source content hash (printed on the next
line) changing while the git version does not.
Example, at https://sof-ci.01.org/sofpr/PR3941/build8429/build/bdw_gcc.txt
-- Found Git: /usr/bin/git (found version "2.17.1")
-- GIT_TAG / GIT_LOG_HASH : v1.7-rc1-151-g023c4abacde1 / 023c4abac
-- Source content hash: 91f261ea
whereas at https://github.com/thesofproject/sof/runs/2166298087,
xtensa-build-all:
-- Found Git: /usr/bin/git (found version "2.17.1")
-- GIT_TAG / GIT_LOG_HASH : v1.7-rc1-151-g023c4abacde1 / 023c4abac
-- Source content hash: 67f31697
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
SOF_SRC_HASH always must have integer value, because of usage
them to initialize global variable in source code.
Variables, which may be empty should be used inside quotation
to prevent cmake incorect number of arguments error.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Temporary files are useful to understand and debug the build.
Moving output to another directory, keeps binary directory clean.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
This is possible location of .git folder, instead of CMAKE_SOURCE_DIR.
Without this patch, checked condition always return false and
GIT_LOG_HASH is used instead source code hash.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
GIT_TAG is user readable form of used source code version with
commit identifier, what is important for bugs reproducibility,
so it will be convenient to have this information in output logs.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
It may be used to check FW compatibility with ldc file.
It's much better than comparing DBG_ABI because logs content
may be updated without any DBG_ABI change in opposite to source
code hash value.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Before this fix, any random, later git tag like for instance
"releases/jsl/v3.0-rc1" would be picked up and then immediately
discarded and replaced with v0000 because it didn't start with 'v*'
Also log all the versions always and not just when there is already a
.tarball-version file.
Increase --abbrev=12 because --abbrev=4 doesn't seem to make sense.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
The git commands to get version strings need to run in the SOF source
directory. This is not automatically set when building for Zephyr so
fix it.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Command git describe looks only for annotated tags, but we should
get any tag reachable from master, that's why --tags flag is needed.
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>