-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Implement new PCL versioning scheme #1905
Implement new PCL versioning scheme #1905
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks pretty good. Can you just confirme me what exactly is being generated here https://github.com/PointCloudLibrary/pcl/blob/master/PCLConfigVersion.cmake.in#L3
Good catch. I've double checked all occurrences of |
I was a looking at this PR #1614 and realized that with this versioning scheme I don't know how to properly handle situations like this https://github.com/aliosciapetrelli/pcl/blob/84e45b5e5c79de3958face842bada15172f3f31e/doc/tutorials/content/sources/ReLOC/CMakeLists.txt#L5 At some this will be merged into 1.8.1-dev but you really can't compile the example (after it's merged) because the minimum version is 1.9. Is there a good way to solve this? |
The problem is that Another option that I can exercise is to update the code responsible for version checking in CMake to support constructs like But either way, we end up with strange version numbers that won't exists in the changelog of the library. Though grepping and replacing them with the actual release version can be a part of the releasing protocol. Off the top of my head I do not see any other clean way around it. |
I prefer this. It's more consistent with the nomenclature were trying to adopt.
I don't see any other way around it |
OK, I'll check if this is possible. |
Unfortunately the
Only |
I assume major, minor patch and tweak need to numerals, otherwise you would have been able to parse the patch appropriately. Then the easiest is to use the tweak as 1 when it's a dev version. |
OK, so "1.8.1-dev" will be a synonym of "1.8.1.1". I was thinking about the C++ macro |
On the other hand, why bothering. Unlike CMake, in source code we can use strictly greater comparison and write |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jspricke Any final comment? Just to be sure we're not overlooking anything at this point.
It is set to 1 for development versions and 0 for release versions. Development versions are identified by a "-dev" prefix. This commit drops unused PCL_CANDIDATE_VERSION CMake variable.
…versions A development version is always greater than its precedent released version and less than any of the future releases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looking into it. I'm generally fine, except the one comment inline.
Also, I've seen other project integration the git describe
output into it, but we can think about that later.
cmake/pcl_utils.cmake
Outdated
set(PCL_VERSION_PLAIN "${PCL_MAJOR_VERSION}.${PCL_MINOR_VERSION}.${PCL_REVISION_VERSION}") | ||
if(${PCL_VERSION} MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+-dev$") | ||
set(PCL_DEV_VERSION 1) | ||
set(PCL_VERSION_PLAIN "${PCL_VERSION_PLAIN}.1") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would propose to use 90 or 99 instead of 1 to make it easier distinguishable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prefer 99 between the two.
Interesting, I did not know the git describe --tags --long I get:
We can use the number of commits since last tag as the tweak number instead of the arbitrary "1", "90", or "99". One problem, however, is that this won't work in source trees downloaded as archive, not by cloning. |
Actually, after reading up in this topic, I do not think it is a good idea. For example, we will run into problems already after 1.8.1 release. Recall that we agreed to make a release branch, revert one of the PRs there, and eventually tag. The mainline PCL will continue with the Jochen, can you give us some examples of projects that use it? (I see it in OpenCV, but only in CMake for reporting general build configuration to the user, not for tweak versioning.) |
This variable is just like PCL_VERSION, but with "-dev" suffix (if any) replaced by ".99" tweak number. fu
😞 The approach sounded really nice. Shall I squash merge this or do we need to keep the 'new version mechanism' and the 'bumping of current version' in different commits? |
I like granular commits, but I don't care. |
Thanks Sergey :) |
@taketwo sorry, I don't have a project at hand. Regarding the describe, I think basing it of the last tag in the branch is the right thing and we could still decode it (and for sure using the sha1), but we can reevaluate that at an other point. |
By the way guys I just found this here
Also
|
Well, this concerns only versioning of CMake itself. As a wrote before, |
I just revised it to be sure. I though that perhaps versions prior to CMake 3 didn't accept it. Really mean of Kitware to be able to use a very convenient version number for themselves and not allow the same type of functionality for the rest :( I like the idea of the tweak version during the development stage as a date in yyyyMMDD format though. |
Sounds attractive! |
(as discussed in #1682)
Current master (trunk) version is indicated by a "-dev" suffix appended to the latest released version. For instance, right now the latest released version is 1.8.0, therefore the master branch of PCL should build into version 1.8.0-dev.
In order to conditionally compile based on PCL version the
PCL_VERSION_COMPARE
macro should be used. It takes into account the development/release status of the build. A development version is always greater than its precedent released version and less than any of the future releases. For instance,1.8.0-dev > 1.8.0
is true, as is1.8.0-dev < 1.8.1
.No change is done to the existing C++ macros
PCL_VERSION
andPCL_VERSION_PRETTY
. The first one is a numeric representation of the version (e.g. 100800 for version 1.8.0) and does not take into account development/release status to avoid breaking existing codebases. The second one is a string representation with "-dev" suffix for development versions (e.g. "1.8.0-dev" right now).With the new versioning scheme the release process should involve the following steps:
PCL_VERSION
variable in the root "CMakeLists.txt" file:1.1. Bump major/minor/revision number as appropriate;
1.2. Remove "-dev" suffix.
PCL_VERSION
variable.