Skip to content

Conversation

@jrmadsen
Copy link
Contributor

Motivation

Currently, project versioning is done ad-hoc and lacks automated enforcement. This PR is a prototype for automating checks which enforce versioning updates. A reusable github workflow and an example of using this automated workflow for rocprofiler-sdk will be included soon.

The workflow relies on a combination of libabigail and (per-project) VERSION and versioning.yml files. The single source of truth for the project's version is in the VERSION file. The versioning.yml is used for the automated workflows using libabigail.

Enforcing Versioning Updates

  • When an ABI break is detected (via libabigail), a major or a minor version increase is required.
  • When there is not an ABI break and the content of any file(s) specified in the sources or headers section of the versioning.yml is modified (excluding modifications solely to code comments and/or formatting), a patch version increase is required.

Please see the updates to the CONTRIBUTING.md for more details.

Technical Details

  • Each project/package has a VERSION file and a versioning.yml file.
    • The VERSION file is a text file and contains the <major>.<minor>.<patch> version and a md5sum of the files when the version was last updated
      • The VERSION file is the single source of truth for the version.
      • The intention of the md5sum in the VERSION file is to force a git conflict when two PRs are updating the version and their CI has already run. When one of those PRs is merged, the other PR will then have a git conflict which will need to be resolved.
    • The versioning.yml is used for various specs: specifying the files to generate the md5sum from, which build products to check for ABI breaks, and some other miscellaneous parameters.
  • cmake/rocm_versioning.cmake is provided to parse VERSION file and get the values into CMake. An example of its usage is in rocprofiler-sdk.
  • .github/workflows/abi-guard.yml is a reusable workflow for performing ABI checks; it uses scripts/abi-guard.py and is passed a versioning.yml.
  • scripts/abi-guard.py is provided to do various workflows: check for ABI breakages (via libabigail), update a VERSION file, compute the hash for a version change, etc.
  • This PR includes an updated VERSION and (newly introduced) versioning.yml for rocprofiler-sdk according to this schema.

Test Plan

  • Another PR will be opened to be merged into this PR to test the automated workflows.
  • We will probably need to be able to handle the (early) situation where the baseline commit for the ABI checks does not contain a VERSION and/or versioning.yml file.

Test Result

  • TBD

Submission Checklist

- Each project/package has a `VERSION` file and a `versioning.yml` file.
  - The VERSION file is a text file and contains the major.minor.patch version and a md5sum of the files when the version was last updated — the intention here is to force a git conflict when two PRs are updating the version and their CI has already run. The VERSION file is the single source of truth for the version.
  - The `versioning.yml` is used for various specs: specifying the files to generate the md5sum from, which build products to check for ABI breaks, and some other miscellaneous parameters.
- `cmake/rocm_versioning.cmake` is provided to parse VERSION file and get the values into CMake.
- `.github/workflows/abi-guard.yml` is a reusable workflow for performing ABI checks; it uses `scripts/abi-guard.py` and is passed a `versioning.yml`.
- `scripts/abi-guard.py` is provided to do various workflows: check for ABI breakages (via libabigail), compute the hash for a version change, etc.
- This PR includes a VERSION and versioning.yml for rocprofiler-sdk according to this schema
Copilot AI review requested due to automatic review settings October 29, 2025 19:53
@jrmadsen jrmadsen requested a review from a team as a code owner October 29, 2025 19:53
@github-actions github-actions bot added documentation Improvements or additions to documentation project: rocprofiler-sdk labels Oct 29, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces an ABI (Application Binary Interface) guard system for versioning and compatibility checking across ROCm projects. The implementation uses libabigail to detect API/ABI changes and enforce semantic versioning policies.

  • Adds a Python script (abi-guard.py) for version management, hash computation, and ABI checking
  • Provides a Jinja2 template for generating versioning configuration files
  • Integrates versioning infrastructure into the build system via CMake modules

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
scripts/abi-guard.py Main Python tool for ABI checking, version management, and hash computation
scripts/templates/versioning.yml.j2 Jinja2 template for generating versioning configuration files
scripts/requirements.txt Python dependencies for the ABI guard tool
projects/rocprofiler-sdk/versioning.yml Example versioning configuration for rocprofiler-sdk project
projects/rocprofiler-sdk/VERSION Updated version file with hash comment
cmake/rocm_versioning.cmake CMake module for reading version files and installing version artifacts
projects/rocprofiler-sdk/CMakeLists.txt Integration of versioning system into project build configuration
projects/rocprofiler-sdk/cmake/rocprofiler_config_install.cmake Installation of version files
CONTRIBUTING.md Documentation on versioning practices and workflows

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation organization: ROCm project: rocprofiler-sdk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants