Skip to content

Release version-git.h for inter release feature check (#9923)#9924

Merged
stsoe merged 1 commit into
Xilinx:XRT-2.25from
stsoe:cp-version-git
Jul 16, 2026
Merged

Release version-git.h for inter release feature check (#9923)#9924
stsoe merged 1 commit into
Xilinx:XRT-2.25from
stsoe:cp-version-git

Conversation

@stsoe

@stsoe stsoe commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Problem solved by the commit

XRT client code relying on Git metadata is not cool, but occasionally needed. For example, in the middle of a release cycle where a feature is introduced, users of XRT may need a compile time check for the availability.

Bug / issue (if any) fixed, which PR introduced the bug, how it was discovered

The problem is that upstreamed builds of XRT (Debian and Fedora) carry no Git metadata, and version-git.h would provide no help. It is the users responsibility to relax the compile time guard with the XRT_VERSION_CODE greater than or equal to next minor release.

How problem was solved, alternative solutions (if any) and why they were rejected

As an example, assume code is developed against XRT 2.22, a feature was enabled at commit level 8195. This feature can be used in the code under the following conditions:

#include <xrt/detail/version-git.h>
#if (XRT_HEAD_COMMITS >= 8195) || (XRT_VERSION_CODE >= XRT_VERSION(2,23))
...new code...
#else
...old code...
#endif

XRT_HEAD_COMMITS require Git metadata but XRT_VERSION_CODE does not.

(cherry picked from commit a21f10d)

XRT client code relying on Git metadata is not cool, but occasionally
needed.  For example, in the middle of a release cycle where a
feature is introduced, users of XRT may need a compile time check for the
availability.

The problem is that upstreamed builds of XRT (Debian and Fedora) carry
no Git metadata, and version-git.h would provide no help.  It is the
users responsibility to relax the compile time guard with the
XRT_VERSION_CODE greater than or equal to next minor release.

As an example, assume code is developed against XRT 2.22, a feature was
enabled at commit level 8195.   This feature can be used in the code
under the following conditions:

  #include <xrt/detail/version-git.h>
  #if (XRT_HEAD_COMMITS >= 8195) || (XRT_VERSION_CODE >= XRT_VERSION(2,23))
  ...new code...
  #else
  ...old code...
  #endif

`XRT_HEAD_COMMITS` require Git metadata but `XRT_VERSION_CODE` does not.

Signed-off-by: Soren Soe <2106410+stsoe@users.noreply.github.com>
(cherry picked from commit a21f10d)
@stsoe
stsoe merged commit 64a989c into Xilinx:XRT-2.25 Jul 16, 2026
19 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.

1 participant