From 2d59017ba52c82a85bff16b82e6c4ecf084a0374 Mon Sep 17 00:00:00 2001 From: vkalintiris Date: Tue, 28 May 2024 17:50:23 +0300 Subject: [PATCH] Fix version for go.d plugin (#17764) --- CMakeLists.txt | 1 - packaging/cmake/Modules/NetdataGoTools.cmake | 4 ++-- packaging/cmake/Modules/NetdataVersion.cmake | 2 +- packaging/cmake/config.cmake.h.in | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fe893fdf2d1461..d4eea531caf728 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2367,7 +2367,6 @@ set(CONFIGURE_COMMAND "dummy-configure-command") if (NOT NETDATA_USER) set(NETDATA_USER "netdata") endif() -set(VERSION "${GIT_DESCRIBE_OUTPUT}") configure_file(packaging/cmake/config.cmake.h.in config.h) diff --git a/packaging/cmake/Modules/NetdataGoTools.cmake b/packaging/cmake/Modules/NetdataGoTools.cmake index cc9e0e1112c6dc..6526c8d7bc8705 100644 --- a/packaging/cmake/Modules/NetdataGoTools.cmake +++ b/packaging/cmake/Modules/NetdataGoTools.cmake @@ -5,9 +5,9 @@ # SPDX-License-Identifier: GPL if(CMAKE_BUILD_TYPE STREQUAL Debug) - set(GO_LDFLAGS "-X github.com/netdata/netdata/go/go.d.plugin/pkg/buildinfo.Version=${NETDATA_VERSION}") + set(GO_LDFLAGS "-X github.com/netdata/netdata/go/go.d.plugin/pkg/buildinfo.Version=${NETDATA_VERSION_STRING}") else() - set(GO_LDFLAGS "-w -s -X github.com/netdata/netdata/go/go.d.plugin/pkg/buildinfo.Version=${NETDATA_VERSION}") + set(GO_LDFLAGS "-w -s -X github.com/netdata/netdata/go/go.d.plugin/pkg/buildinfo.Version=${NETDATA_VERSION_STRING}") endif() # add_go_target: Add a new target that needs to be built using the Go toolchain. diff --git a/packaging/cmake/Modules/NetdataVersion.cmake b/packaging/cmake/Modules/NetdataVersion.cmake index 96f840b1645ef1..b4bdd43b074ecc 100644 --- a/packaging/cmake/Modules/NetdataVersion.cmake +++ b/packaging/cmake/Modules/NetdataVersion.cmake @@ -24,7 +24,7 @@ function(netdata_version) endif() string(STRIP ${GIT_DESCRIBE_OUTPUT} GIT_DESCRIBE_OUTPUT) - set(GIT_DESCRIBE_OUTPUT "${GIT_DESCRIBE_OUTPUT}" PARENT_SCOPE) + set(NETDATA_VERSION_STRING "${GIT_DESCRIBE_OUTPUT}" PARENT_SCOPE) string(REGEX MATCH "v?([0-9]+)\\.([0-9]+)\\.([0-9]+)-?([0-9]+)?-?([0-9a-zA-Z]+)?" MATCHES "${GIT_DESCRIBE_OUTPUT}") if(CMAKE_MATCH_COUNT EQUAL 3) diff --git a/packaging/cmake/config.cmake.h.in b/packaging/cmake/config.cmake.h.in index cc74f37121dff5..5494782a5a3c65 100644 --- a/packaging/cmake/config.cmake.h.in +++ b/packaging/cmake/config.cmake.h.in @@ -166,7 +166,7 @@ #define NETDATA_VERSION_TWEAK "@NETDATA_VERSION_TWEAK@" #define NETDATA_VERSION_DESCR "@NETDATA_VERSION_DESCR@" -#define NETDATA_VERSION "@GIT_DESCRIBE_OUTPUT@" +#define NETDATA_VERSION "@NETDATA_VERSION_STRING@" #define ENABLE_JSONC 1