From c147d452bb96b9e7647932e0ef5ecf0fed32605c Mon Sep 17 00:00:00 2001 From: Eduardo Silva Date: Tue, 6 Aug 2024 10:15:33 -0600 Subject: [PATCH] lib: cmetrics: upgrade to v0.9.3 Signed-off-by: Eduardo Silva --- lib/cmetrics/.github/workflows/build.yaml | 10 ++++++++-- lib/cmetrics/CMakeLists.txt | 8 +++++++- lib/cmetrics/scripts/win_build.bat | 2 -- lib/cmetrics/src/cmt_decode_prometheus.c | 2 +- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/lib/cmetrics/.github/workflows/build.yaml b/lib/cmetrics/.github/workflows/build.yaml index b975bf7be1d..42015b80d59 100644 --- a/lib/cmetrics/.github/workflows/build.yaml +++ b/lib/cmetrics/.github/workflows/build.yaml @@ -23,6 +23,11 @@ jobs: with: submodules: true + - name: Set up with Developer Command Prompt for Microsoft Visual C++ + uses: ilammy/msvc-dev-cmd@v1 + with: + toolset: 14.29 # For using VS2019 C++ + - name: Build on ${{ matrix.os }} with vs-2019 run: | .\scripts\win_build.bat @@ -39,10 +44,11 @@ jobs: steps: - name: Set up base image dependencies run: | + sed -i -e "s/^mirrorlist=http:\/\/mirrorlist.centos.org/#mirrorlist=http:\/\/mirrorlist.centos.org/g" /etc/yum.repos.d/CentOS-Base.repo + sed -i -e "s/^#baseurl=http:\/\/mirror.centos.org/baseurl=http:\/\/vault.centos.org/g" /etc/yum.repos.d/CentOS-Base.repo yum -y update && \ yum install -y ca-certificates cmake gcc gcc-c++ git make wget && \ - wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && \ - rpm -ivh epel-release-latest-7.noarch.rpm && \ + yum install -y epel-release yum install -y cmake3 shell: bash diff --git a/lib/cmetrics/CMakeLists.txt b/lib/cmetrics/CMakeLists.txt index 68dd66e507c..6509d7a35f4 100644 --- a/lib/cmetrics/CMakeLists.txt +++ b/lib/cmetrics/CMakeLists.txt @@ -6,7 +6,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # CMetrics Version set(CMT_VERSION_MAJOR 0) set(CMT_VERSION_MINOR 9) -set(CMT_VERSION_PATCH 1) +set(CMT_VERSION_PATCH 3) set(CMT_VERSION_STR "${CMT_VERSION_MAJOR}.${CMT_VERSION_MINOR}.${CMT_VERSION_PATCH}") # Include helpers @@ -241,6 +241,12 @@ if (NOT CMT_HAVE_CFL) COMPONENT headers PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) + install(TARGETS cfl-static + RUNTIME DESTINATION ${CMT_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMT_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMT_INSTALL_LIBDIR} + COMPONENT library) + # xxHash install(FILES lib/cfl/lib/xxhash/xxh3.h DESTINATION ${CMT_INSTALL_INCLUDEDIR} diff --git a/lib/cmetrics/scripts/win_build.bat b/lib/cmetrics/scripts/win_build.bat index f1fb6d87b16..907baf75176 100755 --- a/lib/cmetrics/scripts/win_build.bat +++ b/lib/cmetrics/scripts/win_build.bat @@ -1,6 +1,4 @@ setlocal -call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -path "C:\Program Files (x86)\MSBuild\16.0\Bin;C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin";%path% git submodule update --init --recursive cd build cmake -G "NMake Makefiles" -DCMT_TESTS=On ..\ diff --git a/lib/cmetrics/src/cmt_decode_prometheus.c b/lib/cmetrics/src/cmt_decode_prometheus.c index e33a9ef1670..3a87c34ee74 100644 --- a/lib/cmetrics/src/cmt_decode_prometheus.c +++ b/lib/cmetrics/src/cmt_decode_prometheus.c @@ -200,7 +200,7 @@ static int parse_uint64(const char *in, uint64_t *out) int64_t val; errno = 0; - val = strtol(in, &end, 10); + val = strtoll(in, &end, 10); if (end == in || *end != 0 || errno) { return -1; }