Skip to content

RFC: implement version information#90

Merged
andersson merged 6 commits intolinux-msm:masterfrom
ndechesne:version
Jan 21, 2025
Merged

RFC: implement version information#90
andersson merged 6 commits intolinux-msm:masterfrom
ndechesne:version

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 <nicolas.dechesne@oss.qualcomm.com>
* add --version CLI option
* dislay version when running in --debug mode

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@oss.qualcomm.com>
It was missing , it will be used to show the version when running in
debug mode.

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@oss.qualcomm.com>
* add --version CLI option
* dislay version when running in --debug mode

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@oss.qualcomm.com>
* add --version CLI option
* dislay version when running in --debug mode

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@oss.qualcomm.com>
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 <nicolas.dechesne@oss.qualcomm.com>
@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 😄

@andersson andersson merged commit ad320a1 into linux-msm:master Jan 21, 2025
6 checks passed
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

4 participants