Skip to content

Commit

Permalink
fix CI and COPR (#60)
Browse files Browse the repository at this point in the history
* fix GitHub actions CI by fixing the version of Conan (otherwise Conan 2.0 would be picked up -- and we're not ready yet) and black
* fix COPR builds for centos-7/8/9 and fedora up to 38; fedora 39 is failing due to presence of Python 3.12 having the "imp" module deprecated (and that's needed by Conan 1.xx)
  • Loading branch information
f18m authored Aug 22, 2023
1 parent e3b525f commit cc8bea5
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 9 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ jobs:
- uses: actions/checkout@v2
- name: install debian-packaged dependencies
run: sudo apt install -y libgtest-dev libbenchmark-dev libfmt-dev tidy git python3 python3-dateutil python3-pip

# NOTE: prometheus-cpp & its dependencies wants at least Conan 1.51.0
- name: install pypi-packaged dependencies
run: sudo pip3 install pytest black conan
run: sudo pip3 install pytest 'black==22.8.0' 'conan==1.60.2'

# NOTE: since we later run "make" using the normal "builder" user, we must use Conan using that same user (so avoid the "sudo"!!)
- name: install Conan-packaged dependencies
Expand Down
14 changes: 9 additions & 5 deletions collector/spec/collector.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@ Requires: fmt
# cmake3,
# python3-pip,
# python3-setuptools,
# perl
# requirements for libprometheus and its build system (Conan-based, cmake3-based);
# perl,
# perl-IPC-Cmd,
# perl-Digest-SHA
# requirements for prometheus-cpp 3rd party lib and its build system (Conan-based, cmake3-based);
# note that for some reason from FC35 and up we also need to request 'setuptools' pypi to install
# successfully the 'conan' pypi, and we install it with python3-setuptools
# perl is instead required from FC35 upward to build OpenSSL Conan package successfully
BuildRequires: gcc-c++, make, git, gtest-devel, fmt-devel, zlib-devel, cmake3, python3-pip, python3-setuptools, perl
# perl* are instead required from FC35 upward to build OpenSSL Conan package successfully

BuildRequires: gcc-c++, make, git, gtest-devel, fmt-devel, zlib-devel, cmake3, python3-pip, python3-setuptools, perl, perl-IPC-Cmd, perl-Digest-SHA

# Disable automatic debug package creation: it fails within Fedora 28, 29 and 30 for the lack
# of debug info files apparently:
Expand All @@ -42,8 +45,9 @@ echo "[Inside RPM prep] running setup"
# prometheus-cpp, since that library is not, unfortunately, packaged by Fedora/COPR
# NOTE: prometheus-cpp & its dependencies wants at least Conan 1.51.0
echo "[Inside RPM build] installing Conan"
pip3 install 'conan==1.51.2'
pip3 install --user 'conan==1.60.2'
echo "[Inside RPM build] bootstrapping Conan"
export PATH="$HOME/.local/bin:$PATH"
conan profile new %{buildroot}/cmonitor_rpmbuild --detect
conan profile update settings.compiler.libcxx=libstdc++11 %{buildroot}/cmonitor_rpmbuild
conan remote list
Expand Down
6 changes: 3 additions & 3 deletions collector/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ ROOT_DIR:=$(shell readlink -f $(THIS_DIR)/../..)
include $(ROOT_DIR)/Constants.mk
include $(ROOT_DIR)/Prometheus-Support.mk

# IMPORTANT: we do require c++11, i.e. GCC 4.8.1 or higher;
# Centos7 which is one of the oldest-supported distributions provides gcc 4.8.5 so we
# cannot move to e.g. c++14/17/20 yet
# IMPORTANT: Centos7 which is one of the oldest-supported distributions provides gcc 4.8.5;
# GCC 4.8.x is able to build C++11 but not e.g. C++14/17/20 yet... so we will stay with C++11
# till Centos7 has to be supported...
# IMPORTANT#2: -fPIC is required to build on fedora-rawhide
CXXFLAGS += -Wall -Werror -Wno-switch-bool -std=c++11 -fPIC $(DEFS)

Expand Down
1 change: 1 addition & 0 deletions collector/src/fast_file_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
// Includes
//------------------------------------------------------------------------------

#include <cstdint>
#include <map>
#include <set>
#include <string.h>
Expand Down
1 change: 1 addition & 0 deletions collector/src/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
// Includes
//------------------------------------------------------------------------------

#include <cstdint>
#include <map>
#include <set>
#include <string.h>
Expand Down
2 changes: 2 additions & 0 deletions conanfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#

[requires]
# prometheus-cpp 1.1.0 cannot be used because it supports only C++14 onward; however the compiler shipping with Centos7
# supports at most the C++11 dialect... so till we want to support Centos7, we need to stick with prometheus-cpp 1.0.0
prometheus-cpp/1.0.0@

[options]
Expand Down

0 comments on commit cc8bea5

Please sign in to comment.