diff options
author | Joel Rosdahl <joel@rosdahl.net> | 2023-04-17 18:08:24 +0200 |
---|---|---|
committer | Joel Rosdahl <joel@rosdahl.net> | 2023-04-17 18:14:56 +0200 |
commit | 65886dc168240ddbc60920c812458a70130191c3 (patch) | |
tree | 0c675da1a89cddceea5db240e0e11161dd108861 | |
parent | e07a0825b31c15cd57d5808e92118d758c921cba (diff) | |
download | ccache-65886dc168240ddbc60920c812458a70130191c3.tar.gz |
fix: Find Ccache version from lightweight Git tag
Ccache calculates its version from a matching Git tag by using the "git
describe" command, which only considers annotated tags. All ccache tags
are annotated. However, when running a GitHub action job for a tag the
local Git repository is (at least by default) a shallow clone with the
tag being converted to a lightweight tag. This makes "git describe" not
see the tag.
Fix this by adding --tags to "git describe" to make it consider
lightweight tags as well.
Fixes #1270.
-rw-r--r-- | cmake/CcacheVersion.cmake | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cmake/CcacheVersion.cmake b/cmake/CcacheVersion.cmake index 3d373bfa..34e7c965 100644 --- a/cmake/CcacheVersion.cmake +++ b/cmake/CcacheVersion.cmake @@ -54,7 +54,7 @@ elseif(EXISTS "${CMAKE_SOURCE_DIR}/.git") ERROR_VARIABLE git_stderr ERROR_STRIP_TRAILING_WHITESPACE) endmacro() - git(describe --abbrev=8 --dirty) + git(describe --tags --abbrev=8 --dirty) if(git_stdout MATCHES "^v([^-]+)(-dirty)?$") set(CCACHE_VERSION "${CMAKE_MATCH_1}") if(NOT "${CMAKE_MATCH_2}" STREQUAL "") |