Follow-up: #34842
This is a follow-up commit that ensures relevant version information
regarding the build is located together as discussed in #34842.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
If user is specifying `-DBUILD_VERSION=<value>` then the proper way to
test is using `NOT DEFINED BUILD_VERSION`.
The difference between `NOT DEFINED BUILD_VERSION` and
`NOT BUILD_VERSION` is that a user specifying `-DBUILD_VERSION=0` will
result in `NOT BUILD_VERSION` becoming true, whereas
`NOT DEFINED BUILD_VERSION` would be false, which is the correct
behavior here, as the user actually provided a specific BUILD_VERSION.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
In an ideal world, good CIs make it very clear what exact git versions
are getting built. However:
- Zephyr is (re-)used in many projects and they cannot all be expected
to have ideal CI.
- CI with multiple git repos is complex (#34713) which makes the world
an even less ideal place: much more chance for some git versions to be
missing.
- Many developers don't realize that Github and other CIs do not test
pull/12345/head but the moving target pull/12345/merge instead. While
not resolving pull/12345/merge completely (maybe another day), this
commit provides at least evidence that pull/12345/head is NOT the
commit tested.
So the addition of the following line in the logs is a very small price
to pay that can save enormous amounts of time when trying to understand
some obscure build failures.
-- BUILD_VERSION=zephyr-v2.5.0-2957-g6230b5bb66bc
Note this obviously does not provide any git information when
BUILD_VERSION is overriden but it does not hurt either in this case:
knowing BUILD_VERSION was overriden is also useful.
The "BUILD_VERSION is left undefined" message was just wrong in
the (unlikely) case `git describe` printed something while also
failing. Remove it; it's so much simpler to just print $BUILD_VERSION
and give the direct, unfiltered information.
Note this simplification is also a partial revert of 1b80f00f56
which threw the entire git warnings "baby" with some obscure duplicate
1.13.0 "bathwater" that is not relevant any more and that I guess barely
anyone noticed even at the time.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
- Add examples for the latter.
- Point at each other and highlight how independent they are from each
other.
- State their inputs and outputs in plain English.
- Fix "git describe" error message giving the wrong impression that
everyone cares about BUILD_VERSION. Only the boot banner cares now.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This is needed to remove noise when comparing binaries across git
commits and more generally for anyone who wants to manual
control/override the version number when building with or without a
.git/ subdirectory.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier. Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.
By default all files without license information are under the default
license of Zephyr, which is Apache version 2.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Follow the same convention as that of ccache.
Improve readability of boilerplate.cmake file.
Move inclusion of version.cmake up to satisfy git.cmake dependency.
Signed-off-by: Mark Ruvald Pedersen <mped@oticon.com>