Skip to content

Commit

Permalink
Fix version for go.d plugin (netdata#17764)
Browse files Browse the repository at this point in the history
  • Loading branch information
vkalintiris authored May 28, 2024
1 parent 7ed4ea7 commit 2d59017
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions packaging/cmake/Modules/NetdataGoTools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion packaging/cmake/Modules/NetdataVersion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion packaging/cmake/config.cmake.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 2d59017

Please sign in to comment.