optris::sdk::BuildInfo
Where this library came from -- the answer to "what exactly are you running", which is the first question a support request needs.
Every field is a display string, and no field is ever empty: one that could not be determined at build time reads exactly "unknown". That is deliberate and it is the point of the type. An empty string is indistinguishable from a field nobody filled in, and a stale or invented commit is worse than no commit at all, because it sends support to code that is not in the binary. Values here are either true or visibly absent.
Before this was so, two builds reported nothing and said nothing about it. A build from a tree copied without .git -- which is how the per-distribution .deb packages are made -- left every git field as the empty string; and a detached checkout of a bare revision, which is how every CI build is made, reported its branch as the literal "HEAD".
Public attributes
version
std::string version
Product version as a display string, e.g. "12.0.0". The same value GetProductVersionString() returns; it is repeated here so that one struct answers the whole "which build is this" question. Both read the same generated constant and cannot disagree.
commit
std::string commit
Abbreviated hash of the commit the library was built from, with -dirty appended if the working tree differed from that commit, or "unknown".
Stamped when CMake last configured. Committing, checking out or resetting re-runs the stamp; editing a file and rebuilding without re-configuring does not, so the -dirty marker can lag on a developer's tree. A release build is unaffected: it configures once, from a clean checkout.
commit_date
std::string commit_date
Date of that commit, ISO 8601 with a zone offset, or "unknown".
branch
std::string branch
Branch the build was made from, or "unknown". A release build is made from a detached checkout of a bare revision, so this is the branch the build system said it was building rather than anything the checkout itself remembers.
build_type
std::string build_type
CMake build type, e.g. "Release" or "Debug".
build_date
std::string build_date
When the library was compiled, ISO 8601. Always UTC, and the +0000 is present in the text.
os
std::string os
Operating system the library was built for, e.g. "Linux".
platform
std::string platform
Architecture the library was built for, e.g. "amd64".