-
Notifications
You must be signed in to change notification settings - Fork 349
cmake: set git hash to 8 digit #3331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
9d942d5 to
33c48f4
Compare
|
@fredoh9 can you check this - I've had to fix both SUBSTRING ranges as they overflow. |
|
All targets build locally with GCC. |
scripts/cmake/version.cmake
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
string(SUBSTRING <string> <begin> <length> <out-var>)
string(SUBSTRING 1234567890 0 7 SOF_SRC_HASH) gives result Source content hash: 1234567 1234-567, so value 8 shouldn't overflow uint32_t src_hash;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, i tested with my local build also. 2nd number is length, so 8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok thanks guys - and now this works for me. I must have put in 9 as a typo when testing as it failed on overflow !
GIT_LOG_HASH can be more than 8 digits. Limit hash value up to first 8 digits. fixes: #3322 Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
33c48f4 to
5712792
Compare
fredoh9
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! thanks!
GIT_LOG_HASH can be more than 8 digits. Limit hash value up to
first 8 digits.
fixes: #3322
Signed-off-by: Fred Oh fred.oh@linux.intel.com