Repository navigation
Set the version only in hipobj.h - #259
Merged
Merged
Conversation
The version was set twice, by the HIPOBJ_VERSION_* macros in include/hipobj.h and by set() calls in the top-level CMakeLists.txt, and the two had to be changed together. The header is now the only place it's set. - CMakeLists.txt reads the three #define lines from the header with file(STRINGS) before project(), and fails to configure if one is missing or isn't a plain number. It adds the header to CMAKE_CONFIGURE_DEPENDS, so changing the version there reconfigures the build without rerunning CMake by hand. Everything after that still uses HIPOBJ_VERSION_* and HIPOBJ_LIBRARY_VERSION as before. - docs/conf.py reads the version from the header instead of CMakeLists.txt, so the documentation workflows no longer need to run when CMakeLists.txt changes; include/**/*.h already covers the header. - A comment in the header, above the macros, says that they're the only place the version is set and that CMakeLists.txt and docs/conf.py read them. The macros themselves are unchanged. AGENTS.md says that the version is set only in the public header. Testing: a RelWithDebInfo build with HIPOBJ_WERROR built without warnings and passed all 32 tests, including hipobj-install, hipobj-subproject, and the package tests, and the library is still libhipobj.so.0.1.0 with the soname libhipobj.so.0. In a copy of the tree, changing HIPOBJ_VERSION_MINOR to 2 made the next build reconfigure, giving project version 0.2.0 and libhipobj.so.0.2.0, and hipobj-install and hipobj-package-deb passed. Defining HIPOBJ_VERSION_PATCH as (0) stops configuring with an error naming the macro and the header. The documentation reports 0.1.0, and is the same whether it's built with CMake or with doxygen and sphinx-build -W directly. black, pylint, vermin, clang-format, cmakelint, actionlint, doc8, and codespell are clean. Co-authored-by: Claude <noreply@anthropic.com>
derobins
requested review from
akolliasAMD,
gaoikawa,
jordan-turbofish,
kurtmcmillan,
riley-dixon,
sbates130272 and
zbyrne
as code owners
October 19, 2026 01:00
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
Version handling is consistent across builds and documentation, with no unresolved blocking findings.
No open issues 🎉
What changed in this PR
Makes include/hipobj.h the single source of hipObject’s version, keeping builds and documentation aligned without changing the public API.
Changes:
- CMake reads and validates the header’s version macros and reconfigures when the header changes.
- Sphinx reads the version directly from the header.
- Updates contributor guidance and removes obsolete documentation workflow triggers.
| File | Description |
|---|---|
| include/hipobj.h | Documents the version macros as the sole source. |
| docs/conf.py | Reads the documentation version from the header. |
| CMakeLists.txt | Parses version macros and tracks header changes. |
| AGENTS.md | Updates versioning and workflow guidance. |
| .github/workflows/hipobject-documentation-deploy.yml | Removes the CMakeLists.txt trigger. |
| .github/workflows/hipobject-documentation-check.yml | Removes the CMakeLists.txt trigger. |
Review effort: Balanced
Contributor
Security scan found no critical or high findings on lines changed by this pull requestView the security scan run for complete reports. “New” means the finding is located in a changed file on an added or modified line; it is not a base-versus-head findings delta. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The version was set twice, by the HIPOBJ_VERSION_* macros in include/hipobj.h and by set() calls in the top-level CMakeLists.txt, and the two had to be changed together. The header is now the only place it's set.
AGENTS.md says that the version is set only in the public header.
Testing: a RelWithDebInfo build with HIPOBJ_WERROR built without warnings and passed all 32 tests, including hipobj-install, hipobj-subproject, and the package tests, and the library is still libhipobj.so.0.1.0 with the soname libhipobj.so.0. In a copy of the tree, changing HIPOBJ_VERSION_MINOR to 2 made the next build reconfigure, giving project version 0.2.0 and libhipobj.so.0.2.0, and hipobj-install and hipobj-package-deb passed. Defining HIPOBJ_VERSION_PATCH as (0) stops configuring with an error naming the macro and the header. The documentation reports 0.1.0, and is the same whether it's built with CMake or with doxygen and sphinx-build -W directly. black, pylint, vermin, clang-format, cmakelint, actionlint, doc8, and codespell are clean.