Skip to content
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

RFC: implement version information #90

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

ndechesne
Copy link
Contributor

Closes #40

In order to implement a proper versioning scheme, let's generate a
version.h file that defines VERSION variable built from git
workspace. The version format will be

v<MAJOR>.<MINOR>-<COMMIT##>-<SHA1>

Where:
* MAJOR and MINOR are from the most recent tag
* COMMIT## is the number of commits since last tag, to ensure
  incremental numbering
* SHA1 is an abbreviated representation of the actual commit SHA.

This requires building from a git workspace, with we are effectively
calling 'git describe' during the build.

We then define print_version() utility function to be used by all
programs.

Ensure that util.c depends on version.h and that we only update
version.h timestamps when the version actually changes to avoid
unnecessary rebuilds.

Signed-off-by: Nicolas Dechesne <[email protected]>
* add --version CLI option
* dislay version when running in --debug mode

Signed-off-by: Nicolas Dechesne <[email protected]>
It was missing , it will be used to show the version when running in
debug mode.

Signed-off-by: Nicolas Dechesne <[email protected]>
* add --version CLI option
* dislay version when running in --debug mode

Signed-off-by: Nicolas Dechesne <[email protected]>
* add --version CLI option
* dislay version when running in --debug mode

Signed-off-by: Nicolas Dechesne <[email protected]>
If for any reasons git describe does not work (git not installed, or
not running from a git workspace), set VERSION to unknown-version.

Signed-off-by: Nicolas Dechesne <[email protected]>
@ljkeller
Copy link

Did a clone and build on WSL: 5.15.167.4-microsoft-standard-WSL2

./qdl --version
qdl version v2.1-19-gc5ce09f
./qdl-ramdump --version
qdl-ramdump version v2.1-19-gc5ce09f

This change will make flashing & release management much less ambiguous for everyone working with QDL. This allows the creation of compatibility matrices with BSP releases x QDL versions.

Thank you so much 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

--version
2 participants