Skip to content

[Build] Updated VTR Versioning #3179

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

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

Conversation

AlexandreSinger
Copy link
Contributor

The way VTR was setting its version information was slightly non-standard and was potentially causing issues when VTR was being built using sudo and then used by a non-sudoer. The reason this process is so complicated is because we want the versioning information to change if anything is modified in the repository or a new commit is created.

Rylie Pavlik provides a CMake module to do exactly this, which is also used by the OpenROAD project. I updated our build process to use this CMake module.

This also resolved an issue where VTR's version was printing v9.0.0; while our revision was showing v8.0.0. Now they both show v9.0.0.

Resolves #3173

This is what vpr --version looked like before this change:
image

This is what it looks like now:
image

Notice that the revision now says v9.0.0.

Making any changes on the branch with a commit will change this version (by incrementing the number of commits since v9.0.0). Making any changes on the branch without a commit will change this version by adding "-dirty" to the version:
image

Since this CMake module came from an external source, it comes with the Boost Software License (BSL-1.0). Since this license is more permissive than the MIT license, it should be compatible with VTR's license.

The way VTR was setting its version information was slightly
non-standard and was potentially causing issues when VTR was being built
using sudo and then used by a non-sudoer. The reason this process is so
complicated is because we want the versioning information to change if
anything is modified in the repository or a new commit is created.

Ryan Pavlik provides a CMake module to do exactly this, which is also
used by the OpenROAD project. I updated our build process to use this
CMake module.

This also resolved an issue where VTR's version was printing v9.0.0;
while our revision was showing v8.0.0. Now they both show v9.0.0.
@github-actions github-actions bot added lang-cpp C/C++ code lang-make CMake/Make code libvtrutil labels Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang-cpp C/C++ code lang-make CMake/Make code libvtrutil
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Build] Version Header Generation
1 participant