-
Notifications
You must be signed in to change notification settings - Fork 582
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
Override v2.13.0-555-g11e37a0bd from git describe with v2.13.6 #9649
base: master
Are you sure you want to change the base?
Conversation
TODOIt unlocks these changes to take effect:
|
We just had a discussion on this which I'll try to summarize here: The package tooling was recently changed to generate versions like My suggestion would be to take this as an opportunity to entirely replace the current Additionally, the CMake files have to be updated to also use that information instead of As an additional feature, it would be nice if the commit date was included in |
From a quick look at the code, this doesn't seem to do what we discussed earlier, i.e. it still uses |
It includes commits count and commit hash in the version so it's formatted similar to the packages. |
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.
As per #9649 (comment), I'd still add something like set(ICINGA2_VERSION "2.13.7")
to git-archive-version.cmake
and then rename the file to something like version.cmake
(I haven't checked if that variable or file name would cause name conflicts) and remove the ICINGA2_VERSION
file.
git-archive-version.cmake
Outdated
@@ -0,0 +1 @@ | |||
set(GIT_ARCHIVE_VERSION [=[$Format:%(describe)$]=]) |
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.
A small comment that this version is set by git archive
wouldn't hurt (and phrasing it something like that would make it correct in both cases, i.e. when looking at the file with the placeholder and the file with the actual describe string).
CMakeLists.txt
Outdated
include(git-archive-version.cmake) | ||
if(GIT_VERSION MATCHES "-NOTFOUND$" AND NOT GIT_ARCHIVE_VERSION MATCHES "Format") | ||
set(GIT_VERSION "${GIT_ARCHIVE_VERSION}") | ||
endif() |
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.
Do I understand correctly that this prefers GetGitRevisionDescription
and GIT_ARCHIVE_VERSION
set by git archive
is only used as a fallback?
If both find a version, I'd prefer the one from git archive
as if that's set, it means that the current source tree went through git archive
. If GetGitRevisionDescription
additionally finds commit information, odds are that this has been imported in some other git which probably doesn't have the version information we want here.
This would also mean that if GIT_ARCHIVE_VERSION
was set, we wouldn't even have to bother GetGitRevisionDescription
.
7971188
to
4e52b82
Compare
Windowshttps://git.icinga.com/packaging/windows-icinga2/-/pipelines/28960
|
CentOS 7
😅 |
Do you still think CMakeficating the |
What's going on here? Is that
Would there be anything wrong with just using regular
Also, where does this 42 come from? |
Seems so.
But then we had $ inside " ". A variable expansion.
My version file bump for PoC sake. |
TIL: we're actually still using CMake < 3.0 anywhere (that is 2.8.12 on CentOS 7 (and therefore probably also RHEL 7 but I haven't checked explicitly)). Then doing it inside of CMake files would be pretty annoying, so extra files it is. |
4e52b82
to
d3fc61f
Compare
Debianstill has problems. But this PR does what it shall do.
|
CentOSsame.
|
openSUSESurprise, surprise...
|
If we build all products' packages from one system, wouldn't it be smarter that the version is overridden only at one place – that one system? I.e. it assembles the version as needed and places it in a PRODUCT_VERSION file (literally) into the source. CMake reads it and compiles it in, Go go:embeds it and PHP... does its PHP things. This way we wouldn’t have to cherry-pick the version files. |
Which we don't do, prime example: docker images. Also doesn't hurt to have proper version information in local development builds or in externally maintained packages. |
|
I'd like too keep version files for the moment instead of changing everything. |
Then what's your plan on getting the package version right? (See my three comments starting with #9649 (comment) ) Lookup the latest tag in GitLab CI and merge like I did here? |
@julianbrost Do you agree with me that we shall first get the package versions right in GitLab and then continue here with fixing icinga2 --version? |
What would you change there? At the moment, it generates version numbers like |
with 2.13.7 from ./ICINGA2_VERSION -> v2.13.7-555-g11e37a0bd
d3fc61f
to
9509027
Compare
CC @julianbrost
Before
After
RPM
.deb
No improved. What the heck is happening here?
Windows