-
Notifications
You must be signed in to change notification settings - Fork 349
version.cmake: switch SOF_MAJOR etc. to a new, static versions.json
#7532
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
28d1e41 to
3ca9547
Compare
|
This is ready for review CMake 3.19 is required for the JSON parser. The first 3.19 version was released at the end of 2020: https://github.com/Kitware/CMake/releases/tag/v3.19.0 These all passed for the most part
EDIT: now just one suspend/resume failure in https://sof-ci.01.org/sofpr/PR7532/build6883/devicetest/index.html, everything else green. |
As discussed in thesofproject#6952, relying on `git describe` for defining SOF_MAJOR and friends is very brittle and unreliable. Switch to a static versions.json file instead. Note the full `git describe --tags` output is _still_ present in the binary, this is useful and left unchanged. It's just not used any more to guess SOF_MAJOR, SOF_MINOR and SOF_MICRO. Use JSON because CMake and pretty much every other piece of software has a JSON parser out of the box. This aligns with linux/Makefile, Zephyr/VERSIONS and probably many others. - except we use JSON because we're in 2023 so we don't spend time having fun re-implementing parsers any more. Signed-off-by: Marc Herbert <marc.herbert@intel.com>
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.
I think this is a good start from moving on relying on git in order to get the version.
paulstelian97
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.
This is a great change. While it does create issues with redundant information between tags (which won't disappear) and the actual version, I believe we can take enough care to keep it in sync. So I'm more on the "yes this is good" side of the fence, approving.
kv2019i
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.
Thanks @marc-hb ! We need to add this to the release checklist for 2.6 once that is created. FYI @mengdonglin @lgirdwood
|
One fail in https://sof-ci.01.org/sofpr/PR7532/build6883/devicetest/index.html , not related, proceeding with merge. |
Submitted: Edited: |
As discussed in #6952, relying on
git describefor defining SOF_MAJOR and friends is very brittle and unreliable. Switch to a staticversions.jsonfile instead.Note the full
git describe --tagsoutput is still present in the binary, this is useful and left unchanged. It's just not used any more to guess SOF_MAJOR, SOF_MINOR and SOF_MICRO.Use JSON because CMake and pretty much every other piece of software has a JSON parser out of the box.
This aligns with linux/Makefile, Zephyr/VERSIONS and probably many others. - except we use JSON because we're in 2023 so we don't spend time having fun re-implementing parsers any more.