centreon / centreon-collect

Centreon collect software collection
11 stars 6 forks source link

Compilation issue with engine on 22.04 release #433

Closed Shadok closed 1 year ago

Shadok commented 2 years ago

Hello,

I'm trying to compile release 22.04 on Ubuntu 22.04 :

mkdir build
cd build
conan install --build=missing ..
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DWITH_TESTING=On -DWITH_MODULE_SIMU=On ..
make -j4

But i ran into an error :

-- Build files have been written to: /usr/local/src/centreon-collect-22.04.1/build
[  1%] Generating interface files of the bbdo file host.proto
[  1%] Generating interface files of the bbdo file service.proto
[  1%] Building CXX object bbdo/CMakeFiles/bbdo_bbdo.dir/cmake_pch.hxx.gch
[  1%] Generating table_max_size.hh
/bin/sh: 1: --cpp_out=/usr/local/src/centreon-collect-22.04.1/bbdo: not found
make[2]: *** [bbdo/CMakeFiles/target_service.dir/build.make:74: ../bbdo/service.pb.cc] Error 127
make[1]: *** [CMakeFiles/Makefile2:1263: bbdo/CMakeFiles/target_service.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/bin/sh: 1: --cpp_out=/usr/local/src/centreon-collect-22.04.1/bbdo: not found
make[2]: *** [bbdo/CMakeFiles/target_host.dir/build.make:74: ../bbdo/host.pb.cc] Error 127
make[1]: *** [CMakeFiles/Makefile2:1289: bbdo/CMakeFiles/target_host.dir/all] Error 2

/usr/local/src/centreon-collect-22.04.1/bbdo exists :

# pwd
/usr/local/src/centreon-collect-22.04.1/bbdo
# ls
bam  bbdo  CMakeLists.txt  events.hh  generate-accessor.py  host.proto  precomp_inc  rebuild_message.proto  remove_graph_message.proto  service.proto  severity.proto  storage  tag.proto

I'm not having much luck with 22.10 release anyway :

In file included from /root/.conan/data/abseil/20220623.0/_/_/package/6557f18ca99c0b6a233f43db00e30efaa525e27e/include/absl/container/flat_hash_map.h:41,
                 from /usr/local/src/centreon-collect-22.10.0/bbdo/precomp_inc/precomp.hpp:54,
                 from /usr/local/src/centreon-collect-22.10.0/build/bbdo/CMakeFiles/bbdo_bbdo.dir/cmake_pch.hxx:5,
                 from <command-line>:
/root/.conan/data/abseil/20220623.0/_/_/package/6557f18ca99c0b6a233f43db00e30efaa525e27e/include/absl/container/internal/hash_function_defaults.h: At global scope:
/root/.conan/data/abseil/20220623.0/_/_/package/6557f18ca99c0b6a233f43db00e30efaa525e27e/include/absl/container/internal/hash_function_defaults.h:106:21: error: ‘string_view’ is not a member of ‘absl’
  106 | struct HashEq<absl::string_view> : StringHashEq {};
      |                     ^~~~~~~~~~~
/root/.conan/data/abseil/20220623.0/_/_/package/6557f18ca99c0b6a233f43db00e30efaa525e27e/include/absl/container/internal/hash_function_defaults.h:106:21: error: ‘string_view’ is not a member of ‘absl’
/root/.conan/data/abseil/20220623.0/_/_/package/6557f18ca99c0b6a233f43db00e30efaa525e27e/include/absl/container/internal/hash_function_defaults.h:106:32: error: template argument 1 is invalid
  106 | struct HashEq<absl::string_view> : StringHashEq {};
      |                                ^
make[2]: *** [bbdo/CMakeFiles/bbdo_bbdo.dir/build.make:77: bbdo/CMakeFiles/bbdo_bbdo.dir/cmake_pch.hxx.gch] Error 1
make[1]: *** [CMakeFiles/Makefile2:1527: bbdo/CMakeFiles/bbdo_bbdo.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
Shadok commented 2 years ago

My bad, it's still the same abseil issue with 22.04.1 :

In file included from /root/.conan/data/abseil/20220623.0/_/_/package/6557f18ca99c0b6a233f43db00e30efaa525e27e/include/absl/container/flat_hash_map.h:41,
                 from /usr/local/src/centreon-collect-22.04.1/bbdo/precomp_inc/precomp.hpp:54,
                 from /usr/local/src/centreon-collect-22.04.1/build/bbdo/CMakeFiles/bbdo_bbdo.dir/cmake_pch.hxx:5,
                 from <command-line>:
/root/.conan/data/abseil/20220623.0/_/_/package/6557f18ca99c0b6a233f43db00e30efaa525e27e/include/absl/container/internal/hash_function_defaults.h: At global scope:
/root/.conan/data/abseil/20220623.0/_/_/package/6557f18ca99c0b6a233f43db00e30efaa525e27e/include/absl/container/internal/hash_function_defaults.h:106:21: error: ‘string_view’ is not a member of ‘absl’
  106 | struct HashEq<absl::string_view> : StringHashEq {};
      |                     ^~~~~~~~~~~
/root/.conan/data/abseil/20220623.0/_/_/package/6557f18ca99c0b6a233f43db00e30efaa525e27e/include/absl/container/internal/hash_function_defaults.h:106:21: error: ‘string_view’ is not a member of ‘absl’
/root/.conan/data/abseil/20220623.0/_/_/package/6557f18ca99c0b6a233f43db00e30efaa525e27e/include/absl/container/internal/hash_function_defaults.h:106:32: error: template argument 1 is invalid
  106 | struct HashEq<absl::string_view> : StringHashEq {};
      |                                ^
make[2]: *** [bbdo/CMakeFiles/bbdo_bbdo.dir/build.make:77: bbdo/CMakeFiles/bbdo_bbdo.dir/cmake_pch.hxx.gch] Error 1
make[1]: *** [CMakeFiles/Makefile2:1472: bbdo/CMakeFiles/bbdo_bbdo.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
Shadok commented 2 years ago

It looks like it comes from the cppstd version that isn't the same as the one used for centreon, i'll try changing it on monday. conan profile update settings.compiler.cppstd=14 default

Shadok commented 2 years ago

settings.compiler.cppstd=14 fixes the compiling issue with abseil, it may be useful to add it to the "Other distributions" section in the README.

But now, the next issue is with googleapis ...

[  0%] Running cpp protocol buffer compiler on /root/.conan/data/googleapis/cci.20220711/_/_/build/980fc2342a497a88858ad46f40d89e16a1b6cd2e/google/rpc/status.proto
google/protobuf/any.proto: File not found.
google/rpc/status.proto:19:1: Import "google/protobuf/any.proto" was not found or had errors.
google/rpc/status.proto:46:12: "google.protobuf.Any" is not defined.
gmake[2]: *** [CMakeFiles/google_rpc_status_proto.dir/build.make:75: google/rpc/status.pb.h] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:8107: CMakeFiles/google_rpc_status_proto.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2
googleapis/cci.20220711:
googleapis/cci.20220711: ERROR: Package '980fc2342a497a88858ad46f40d89e16a1b6cd2e' build failed
googleapis/cci.20220711: WARN: Build folder /root/.conan/data/googleapis/cci.20220711/_/_/build/980fc2342a497a88858ad46f40d89e16a1b6cd2e
ERROR: googleapis/cci.20220711: Error in build() method, line 138
        cmake.build()
        ConanException: Error 2 while executing cmake --build '/root/.conan/data/googleapis/cci.20220711/_/_/build/980fc2342a497a88858ad46f40d89e16a1b6cd2e' '--' '-j1'
-- The C compiler identification is GNU 11.3.0
-- The CXX compiler identification is GNU 11.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- id=ubuntu detected (compatible with Debian)
CMake Error at CMakeLists.txt:94 (include):
  include could not find requested file:

    /usr/local/src/centreon-collect-22.04.1/build/conanbuildinfo.cmake

The file is available, conan has it : /root/.conan/data/protobuf/3.21.4///build/caad570777f8bfa7873d307fb34fea9bdb600901/sourcesubfolder/src/google/protobuf/any.proto /root/.conan/data/protobuf/3.21.4///package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/any.proto /root/.conan/data/protobuf/3.21.4//_/source/source_subfolder/src/google/protobuf/any.proto

bouda1 commented 2 years ago

Hi Guillaume,

At the root of the project, there is a cmake.sh script.

I think you will find how to fix your issues if you read how it configures conan, cmake, etc...

Otherwise, you can just execute it, it produces a build directory ready to compile the project.

Now, you have made several attempts, the script can also fail because conan creates a file ~/.conan/profiles/default that may be badly configured.

The content of my file is as follows: [settings] os=Linux os_build=Linux arch=x86_64 arch_build=x86_64 compiler=gcc compiler.version=11 compiler.libcxx=libstdc++11 compiler.cppstd=14 build_type=Release [options] [build_requires] [env]

I hope this will help you. Cheers.

On Mon, Nov 7, 2022 at 2:33 PM Guillaume @.***> wrote:

Having /usr/include/google/protobuf/any.proto isn't enough :

[ 0%] Running cpp protocol buffer compiler on /root/.conan/data/googleapis/cci.20220711///build/980fc2342a497a88858ad46f40d89e16a1b6cd2e/google/rpc/status.proto google/protobuf/any.proto: File not found. google/rpc/status.proto:19:1: Import "google/protobuf/any.proto" was not found or had errors. google/rpc/status.proto:46:12: "google.protobuf.Any" is not defined. gmake[2]: [CMakeFiles/google_rpc_status_proto.dir/build.make:75: google/rpc/status.pb.h] Error 1 gmake[1]: [CMakeFiles/Makefile2:8107: CMakeFiles/google_rpc_status_proto.dir/all] Error 2 gmake: *** [Makefile:91: all] Error 2

— Reply to this email directly, view it on GitHub https://github.com/centreon/centreon-collect/issues/433#issuecomment-1305623637, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQIBPKPWZR4XBKZI5CB6NLWHEAJNANCNFSM6AAAAAARXISW2I . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- David Boucher

[image: Icône téléphone] [image: Icône email] @.*** [image: Icône site web]

centreon.com https://centreon.com/en

[image: Logo Centreon] ​ [image: Twitter] http://www.twitter.com/Centreon [image: LinkedIn] https://www.linkedin.com/company/merethis/ [image: GitHub] https://github.com/centreon/centreon [image: Slack] https://www.centreon.com/slack-register/

https://events.centreon.com/centreon-summit-2022?utm_source=CentreonSummit_Signatures&utm_medium=medium&utm_campaign=CentreonSummit22

Shadok commented 2 years ago

I use a chroot for now so i recreate it at each try.

Same issue with ./cmake.sh -r :

googleapis/cci.20220711: Aggregating env generators
googleapis/cci.20220711: Calling build()
googleapis/cci.20220711: ERROR: Unrecognized dep: monitoring_proto -- google/api/BUILD.bazel
googleapis/cci.20220711: ERROR: Unrecognized dep: quota_proto -- google/api/BUILD.bazel
-- The C compiler identification is GNU 11.3.0
-- The CXX compiler identification is GNU 11.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Conan: called by CMake conan helper
-- Conan: called inside local cache
-- Conan: Adjusting output directories
-- Conan: Using cmake targets configuration
-- Library protoc found /root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/lib/libprotoc.a
-- Library protobuf found /root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/lib/libprotobuf.a
-- Library z found /root/.conan/data/zlib/1.2.12/_/_/package/dfbe50feef7f3c6223a476cd5aeadb687084a646/lib/libz.a
-- Conan: Adjusting default RPATHs Conan policies
-- Conan: Adjusting language standard
-- Conan setting CPP STANDARD: 14 WITH EXTENSIONS OFF
-- Conan: Adjusting fPIC flag (ON)
-- Conan: Compiler GCC>=5, checking major version 11
-- Conan: Checking correct version: 11
-- Conan: C++ stdlib: libstdc++11
-- Library protoc found /root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/lib/libprotoc.a
-- Found: /root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/lib/libprotoc.a
-- Library protobuf found /root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/lib/libprotobuf.a
-- Found: /root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/lib/libprotobuf.a
-- Library protobuf found /root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/lib/libprotobuf.a
-- Found: /root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/lib/libprotobuf.a
-- Library protoc found /root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/lib/libprotoc.a
-- Found: /root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/lib/libprotoc.a
-- Library z found /root/.conan/data/zlib/1.2.12/_/_/package/dfbe50feef7f3c6223a476cd5aeadb687084a646/lib/libz.a
-- Found: /root/.conan/data/zlib/1.2.12/_/_/package/dfbe50feef7f3c6223a476cd5aeadb687084a646/lib/libz.a
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_EXPORT_NO_PACKAGE_REGISTRY
    CMAKE_INSTALL_BINDIR
    CMAKE_INSTALL_DATAROOTDIR
    CMAKE_INSTALL_INCLUDEDIR
    CMAKE_INSTALL_LIBDIR
    CMAKE_INSTALL_LIBEXECDIR
    CMAKE_INSTALL_OLDINCLUDEDIR
    CMAKE_INSTALL_SBINDIR

-- Build files have been written to: /root/.conan/data/googleapis/cci.20220711/_/_/build/980fc2342a497a88858ad46f40d89e16a1b6cd2e
[  0%] Running cpp protocol buffer compiler on /root/.conan/data/googleapis/cci.20220711/_/_/build/980fc2342a497a88858ad46f40d89e16a1b6cd2e/google/rpc/status.proto
google/protobuf/any.proto: File not found.
google/rpc/status.proto:19:1: Import "google/protobuf/any.proto" was not found or had errors.
google/rpc/status.proto:46:12: "google.protobuf.Any" is not defined.
gmake[2]: *** [CMakeFiles/google_rpc_status_proto.dir/build.make:75: google/rpc/status.pb.h] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:8107: CMakeFiles/google_rpc_status_proto.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2
googleapis/cci.20220711:
googleapis/cci.20220711: ERROR: Package '980fc2342a497a88858ad46f40d89e16a1b6cd2e' build failed
googleapis/cci.20220711: WARN: Build folder /root/.conan/data/googleapis/cci.20220711/_/_/build/980fc2342a497a88858ad46f40d89e16a1b6cd2e
ERROR: googleapis/cci.20220711: Error in build() method, line 138
        cmake.build()
        ConanException: Error 2 while executing cmake --build '/root/.conan/data/googleapis/cci.20220711/_/_/build/980fc2342a497a88858ad46f40d89e16a1b6cd2e' '--' '-j1
jean-christophe81 commented 1 year ago

Hi Guillaume, Have you tried to erase /root/.conan/data/grpc directory? Sometimes, you have several version of grpc or googleapis in .conan directories and erase it is a solution. Regards

Shadok commented 1 year ago

Hi,

As i use a chroot, and recreate it at each try, i don't have this issue :)

Thanks for trying to help. But i think we will pursue with AlmaLinux and the official packages.

jean-christophe81 commented 1 year ago

Hi, Another issue I had when I have compiled on my linux mint. Before, I had installed protoc on my computer. So conan used bad protoc version.

Shadok commented 1 year ago

Sadly, i'm not installing protoc in the chroot, here's all i install : packages=apt wget ca-certificates cmake build-essential checkinstall python3 python3-pip vim libssh2-1-dev libperl-dev git pkg-config libmariadb-dev librrd-dev libgnutls28-dev liblua5.3-dev lsb-release fakeroot libzmq3-dev libssh-dev libextutils-makemaker-cpanfile-perl libmodule-build-perl libmodule-install-perl libcryptx-perl libschedule-cron-perl libcrypt-cbc-perl libcpanel-json-xs-perl libjson-pp-perl libyaml-perl libyaml-libyaml-perl libdbd-sqlite3-perl libdbd-mysql-perl libapache-dbi-perl libdata-uuid-perl libhttp-daemon-perl libhttp-message-perl libmime-base64-urlsafe-perl libdigest-md5-file-perl libwww-curl-perl libio-socket-ssl-perl libnetaddr-ip-perl libhash-merge-perl php php-curl php-db php-date php-pear php-xml curl apache2 php-fpm sudo rrdtool nagios-nrpe-plugin mlocate protobuf-compiler libprotobuf-dev libgcrypt20-dev ninja-build libmariadb3 g++ gcc

Shadok commented 1 year ago

If this helps, here the script that create my chroot :

sudo su - <<EOSU
rm -rf /home/mockbuild/centreon/chroot

## Creation de la chroot avec multistrap
multistrap -d /home/mockbuild/centreon/chroot -f /home/mockbuild/centreon/multistrap.conf

## Copie des scripts de travail dans la chroot
mkdir -p /home/mockbuild/centreon/chroot/files
cp /home/mockbuild/centreon/files/* /home/mockbuild/centreon/chroot/files/

## Configuration de la chroot (serveur DNS, user centreon, repertoire de compilation)
chroot /home/mockbuild/centreon/chroot bash -c "echo 'nameserver 10.17.30.4' > /etc/resolv.conf"

chroot /home/mockbuild/centreon/chroot bash -c "groupadd -g 4577 centreon"
chroot /home/mockbuild/centreon/chroot bash -c "useradd -m -d \"/home/centreon\" -u 4577 -g 4577 -s \"/bin/bash\" -c \"User Centreon\" -p NP centreon"

chroot /home/mockbuild/centreon/chroot bash -c "mkdir -p /usr/local/src"

chroot /home/mockbuild/centreon/chroot bash -c "[ -f /dev/null ] && rm /dev/null ; mknod -m 666 /dev/null c 1 3"

## Installation de Conan
chroot /home/mockbuild/centreon/chroot bash -c "https_proxy=http://10.22.208.216:22222 pip3 install conan"
chroot /home/mockbuild/centreon/chroot bash -c "conan profile new default --detect"
chroot /home/mockbuild/centreon/chroot bash -c "conan profile update settings.compiler.libcxx=libstdc++11 default"
chroot /home/mockbuild/centreon/chroot bash -c "conan profile update settings.compiler.cppstd=14 default"
EOSU

Then, the one that's supposed to compile collect and create the dpkg package (and fails) :

## Variables
##
export LANG="C.UTF-8"
export http_proxy=http://10.22.208.216:22222
export https_proxy=http://10.22.208.216:22222

# chargement des versions
source /files/versions.sh

## Compilation de centreon collect
##
if [ ! -d "/usr/local/src/centreon-collect-${VERSION_COLLECT}" ]; then
        mkdir -p "/usr/local/src/centreon-collect-${VERSION_COLLECT}"
fi
cd "/usr/local/src/centreon-collect-${VERSION_COLLECT}"

[ -f centreon-collect-${VERSION_COLLECT}.tar.gz ] || wget https://s3-eu-west-1.amazonaws.com/centreon-download/public/centreon-collect/centreon-collect-${VERSION_COLLECT}.tar.gz
[ -d centreon-collect-${VERSION_COLLECT} ] && rm -rf centreon-collect-${VERSION_COLLECT}

tar -xzf centreon-collect-${VERSION_COLLECT}.tar.gz

./cmake.sh

mkdir build
cd build

# Installation des librairies C++ necessaires
conan install -s compiler.cppstd=17 -s compiler.libcxx=libstdc++11 --build=missing ..
# cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/home/centreon/product -DWITH_TESTING=On -DWITH_MODULE_SIMU=On ..
CXXFLAGS="-Wall -Wextra" cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/home/centreon/product -DWITH_TESTING=On -DDWITH_PREFIX_LIB_CLIB=/home/centreon/product -DWITH_MODULE_SIMU=On -DWITH_BENCH=On -DWITH_USER_BROKER=centreon -DWITH_USER_ENGINE=centreon -DWITH_GROUP_BROKER=centreon -DWITH_GROUP_ENGINE=centreon -DWITH_CREATE_FILES=OFF -DNG=OFF ..
make -j4

## Ajout des fichiers pour la creation du package
##
echo /home/centreon/product > /etc/ld.so.conf.d/collect.conf
echo /etc/ld.so.conf.d/collect.conf > collect.txt

cp /files/collect-postinst ./postinstall-pak

echo "Centreon Collect ${VERSION_COLLECT}" > ./description-pak

## Creation du package deb
##
checkinstall -y --pkgname centreon-collect-sncf --pkgversion ${VERSION_COLLECT} --maintainer 'Guillaume PENIN \<guillaume.penin@sncf.fr\> \& Guillaume Hilt \<ext.g.hilt@sncf.fr\>' --include collect.txt

The any.proto file the builder can't find is present, inside the chroot, in /usr/include/google/protobuf/any.proto

jean-christophe81 commented 1 year ago

Hi, cmake.sh yet call conan before calling cmake. It uses protoc provided by protobuf installation in /.conan directory

conan install protobuf in you home directory. As exemple, I can find any.proto in /.conan/data/protobuf/3.21.4///package/de1b813c2bbb787028570146f612814b489d9b66/include/google/protobuf/any.proto

There are sometimes strange things with conan. In the build/CMakeCache.txt, You must find a line like Protobuf_INCLUDEDIR:PATH=/root/.conan/data/protobuf/3.21.4//_/package/de1b813c2bbb787028570146f612814b489d9b66/include

if this line is present and this path contains any.proto, I advise you to add --proto_path=${Protobuf_INCLUDE_DIR} in each CMakeLists.txt that contains the command Protobuf_PROTOC_EXECUTABLE

Example: in bbdo/CMakeLists.txt, You have the command: ${Protobuf_PROTOC_EXECUTABLE} ARGS --cpp_out=${CMAKE_SOURCE_DIR}/bbdo --proto_path=${CMAKE_SOURCE_DIR}/bbdo ${proto_file} || \ / ${Protobuf_PROTOC_EXECUTABLE} ARGS --cpp_out=${CMAKE_SOURCE_DIR}/bbdo --proto_path=${CMAKE_SOURCE_DIR}/bbdo --proto_path=${Protobuf_INCLUDE_DIR} ${proto_file}**

Shadok commented 1 year ago

I'm not familiar at all with conan, or compilation in general (but we managed to compile and create deb packages with centreon 20.10 on Ubuntu 20.04, the issue is with the latest packages and U22).

The error is near the end of the ./cmake.sh command from /usr/local/src/centreon-collect-22.10.0.

I have a any.proto in this path : /root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf

In /usr/local/src/centreon-collect-22.10.0/build/CMakeCache.txt i don't have any reference to Protobuf_INCLUDE_DIR. That may be why it can't find any.proto.

Editing CMakeCache.txt by adding it and re-reunning cmake.sh doesn't help.

jean-christophe81 commented 1 year ago

First, cmake.sh yet executes:

mkdir build
cd build

# Installation des librairies C++ necessaires
conan install -s compiler.cppstd=17 -s compiler.libcxx=libstdc++11 --build=missing ..
# cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/home/centreon/product -DWITH_TESTING=On -DWITH_MODULE_SIMU=On ..
CXXFLAGS="-Wall -Wextra" cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/home/centreon/product -DWITH_TESTING=On -DDWITH_PREFIX_LIB_CLIB=/home/centreon/product -DWITH_MODULE_SIMU=On -DWITH_BENCH=On -DWITH_USER_BROKER=centreon -DWITH_USER_ENGINE=centreon -DWITH_GROUP_BROKER=centreon -DWITH_GROUP_ENGINE=centreon -DWITH_CREATE_FILES=OFF -DNG=OFF ..

So it's probably useless.

The problem is when you launch make, protoc fail to compile porotobuf files, isn't it? If I'm right, can you launch instead of "make", "strace -f -o strace.log make -j 4" Then you will find in strace.log witch protoc is used by compilation

Shadok commented 1 year ago

I digged into the compilation processus, as i understand a bit more how it works now.

It fails in cmake.sh, provided in centreon-collect-22.10.0.tar.gz, near the end of googleapis build (during $conan install .. -s compiler.cppstd=$STD -s compiler.libcxx=libstdc++11 --build=missing) :

-- Build files have been written to: /root/.conan/data/googleapis/cci.20220711/_/_/build/980fc2342a497a88858ad46f40d89e16a1b6cd2e
[  0%] Running cpp protocol buffer compiler on /root/.conan/data/googleapis/cci.20220711/_/_/build/980fc2342a497a88858ad46f40d89e16a1b6cd2e/google/rpc/status.proto
google/protobuf/any.proto: File not found.
google/rpc/status.proto:19:1: Import "google/protobuf/any.proto" was not found or had errors.
google/rpc/status.proto:46:12: "google.protobuf.Any" is not defined.
gmake[2]: *** [CMakeFiles/google_rpc_status_proto.dir/build.make:75: google/rpc/status.pb.h] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:8107: CMakeFiles/google_rpc_status_proto.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2
googleapis/cci.20220711:
googleapis/cci.20220711: ERROR: Package '980fc2342a497a88858ad46f40d89e16a1b6cd2e' build failed
googleapis/cci.20220711: WARN: Build folder /root/.conan/data/googleapis/cci.20220711/_/_/build/980fc2342a497a88858ad46f40d89e16a1b6cd2e
ERROR: googleapis/cci.20220711: Error in build() method, line 163
        cmake.build()
        ConanException: Error 2 while executing cmake --build '/root/.conan/data/googleapis/cci.20220711/_/_/build/980fc2342a497a88858ad46f40d89e16a1b6cd2e' '--' '-j1'

-- The C compiler identification is GNU 11.3.0
-- The CXX compiler identification is GNU 11.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- id=ubuntu detected (compatible with Debian)
CMake Error at CMakeLists.txt:104 (include):
  include could not find requested file:

    /usr/local/src/centreon-collect-22.10.0/build/conanbuildinfo.cmake

CMake Error at CMakeLists.txt:105 (conan_basic_setup):
  Unknown CMake command "conan_basic_setup".

-- Configuring incomplete, errors occurred!
See also "/usr/local/src/centreon-collect-22.10.0/build/CMakeFiles/CMakeOutput.log".

So i guess i can strace this command. conanbuildinfo.cmake must be missing since conan install fails.

Shadok commented 1 year ago

google/rpc/status.proto tries to import protobuf this way : import "google/protobuf/any.proto";

any.proto is in : /root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf

So, that must mean /root/.conan/data/protobuf/3.21.4///package/caad570777f8bfa7873d307fb34fea9bdb600901 isn't in the path it's looking for.

Shadok commented 1 year ago

cmake.txt Here's the full log of running cmake.sh.

Near the end, and before the issue, we can see that it's aware of protobuf location : -- Found: /root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/lib/libprotoc.a

jean-christophe81 commented 1 year ago

I will build a ubuntu 22.04 docker and I will try to build in it when I have a moment

Shadok commented 1 year ago

Thanks :) I tried a few things without luck.

WARN: Using the new toolchains and generators without specifying a build profile (e.g: -pr:b=default) is discouraged and might cause failures and unexpected behavior Added conan parameters to default profile and used "-pr:b=default" in conan install command line.

WARN: grpc/1.46.3: requirement openssl/1.1.1s overridden by your conanfile to openssl/1.1.1q
WARN: grpc/1.46.3: requirement zlib/1.2.13 overridden by your conanfile to zlib/1.2.12
WARN: protobuf/3.21.4: requirement zlib/1.2.13 overridden by grpc/1.46.3 to zlib/1.2.12
WARN: mariadb-connector-c/3.1.12: requirement zlib/1.2.13 overridden by your conanfile to zlib/1.2.12
WARN: mariadb-connector-c/3.1.12: requirement openssl/1.1.1s overridden by your conanfile to openssl/1.1.1q
WARN: libcurl/7.85.0: requirement openssl/1.1.1s overridden by mariadb-connector-c/3.1.12 to openssl/1.1.1q
WARN: libcurl/7.85.0: requirement zlib/1.2.13 overridden by mariadb-connector-c/3.1.12 to zlib/1.2.12

Updated conanfile to fix the dependancies.

I noticed that before the compilation files, i got this (same as yesterday) :

googleapis/cci.20220711: ERROR: Unrecognized dep: monitoring_proto -- google/api/BUILD.bazel
googleapis/cci.20220711: ERROR: Unrecognized dep: quota_proto -- google/api/BUILD.bazel

It seems caused by https://github.com/conan-io/conan-center-index/pull/11651 (as reported in https://github.com/conan-io/conan-center-index/issues/11951) and if that's the issue, i don't know when it will be fixed.

Shadok commented 1 year ago

I even tried by forcing these previous packages in the conanfile :

googleapis/cci.20210730
grpc-proto/cci.20211106

It's the same kind of issue, it can't find google/protobuf/duration.proto, although present in /root/.conan/data/protobuf/3.21.4///package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/duration.proto

jean-christophe81 commented 1 year ago

Hi, I have compiled it in an ubuntu container. How I have procced:

First create the ubuntu container and jump into docker container run --name ubuntu22.04 -ti -v /data/dev/centreon-collect:/root/centreon-collect ubuntu:22.04 /bin/bash Now you are in your ubuntu container

cd /root/centreon-collect/
apt update
apt install python3
apt install python3-pip
pip3 install conan
apt install libgnutls28-dev
apt install liblua5.4-dev
apt install librrd-dev
apt install cmake

./cmake.sh 
cd build
make

Then you have all binaries compiled in the ubuntu distribution. You can access it outside the container in the /data/dev/centreon-collect/build directory

Shadok commented 1 year ago

Thanks, i'll try tomorrow, given your output, my issue might be caused by some of the package i install when creating the chroot :)

bouda1 commented 1 year ago

Hi @Shadok

I noticed in your script the following lines:

conan install -s compiler.cppstd=17 -s compiler.libcxx=libstdc++11 --build=missing ..
# cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/home/centreon/product -DWITH_TESTING=On -DWITH_MODULE_SIMU=On ..
CXXFLAGS="-Wall -Wextra" cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/home/centreon/product -DWITH_TESTING=On -DDWITH_PREFIX_LIB_CLIB=/home/centreon/product -DWITH_MODULE_SIMU=On -DWITH_BENCH=On -DWITH_USER_BROKER=centreon -DWITH_USER_ENGINE=centreon -DWITH_GROUP_BROKER=centreon -DWITH_GROUP_ENGINE=centreon -DWITH_CREATE_FILES=OFF -DNG=OFF ..
make -j4

where you force the C++ standard to C++17. Because of some retro compatibility with centos7, we still use C++14.

So I recommand you to change this block into something like:

conan install -s compiler.cppstd=14 -s compiler.libcxx=libstdc++11 --build=missing ..
# cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/home/centreon/product -DWITH_TESTING=On -DWITH_MODULE_SIMU=On ..
CXXFLAGS="-Wall -Wextra" cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/home/centreon/product -DWITH_TESTING=On -DDWITH_PREFIX_LIB_CLIB=/home/centreon/product -DWITH_MODULE_SIMU=On -DWITH_BENCH=On -DWITH_USER_BROKER=centreon -DWITH_USER_ENGINE=centreon -DWITH_GROUP_BROKER=centreon -DWITH_GROUP_ENGINE=centreon -DWITH_CREATE_FILES=OFF -DNG=OFF ..
make -j4

I know, for example, the absl library provides its own string_view, optional or others if you specify 14 but they use the std versions with 17.

My 2 cents. Cheers.

Shadok commented 1 year ago

@jean-christophe81 I'm surprised you don't have to install build-essential or at least make.

@bouda1 i'm using compiler.cppstd=14 now, i used 17 at start and setting 14 fixed my first issue, but i'm stll struggling when building googleapis/cci.

Shadok commented 1 year ago

I'm still failing to compile googleapis/cci in a chroot, now that i only install the same packages you had in your docker (with build-essential).

-- Build files have been written to: /root/.conan/data/googleapis/cci.20220711/_/_/build/980fc2342a497a88858ad46f40d89e16a1b6cd2e
[  0%] Running cpp protocol buffer compiler on /root/.conan/data/googleapis/cci.20220711/_/_/build/980fc2342a497a88858ad46f40d89e16a1b6cd2e/google/rpc/status.proto
google/protobuf/any.proto: File not found.
google/rpc/status.proto:19:1: Import "google/protobuf/any.proto" was not found or had errors.
google/rpc/status.proto:46:12: "google.protobuf.Any" is not defined.
gmake[2]: *** [CMakeFiles/google_rpc_status_proto.dir/build.make:75: google/rpc/status.pb.h] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:8107: CMakeFiles/google_rpc_status_proto.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2

I'll see if i can have a container with the same image you used ...

Shadok commented 1 year ago

And it compiles well in a container, thanks. So it seems there is an issue with our U22 master when compiling centreon.

Shadok commented 1 year ago

Yeah ... It seemed to easy, i have errors with make ...

root@76afda884709:~/centreon-collect/22.04.1/build# make
[  0%] Generating interface files of the bbdo file host.proto
[  0%] Built target target_host
[  1%] Generating interface files of the bbdo file tag.proto
[  1%] Building CXX object bbdo/CMakeFiles/pb_tag_lib.dir/tag.pb.cc.o
In file included from /root/centreon-collect/22.04.1/bbdo/tag.pb.cc:4:
/root/centreon-collect/22.04.1/bbdo/tag.pb.h:17:2: error: #error This file was generated by an older version of protoc which is
   17 | #error This file was generated by an older version of protoc which is
      |  ^~~~~
/root/centreon-collect/22.04.1/bbdo/tag.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please
   18 | #error incompatible with your Protocol Buffer headers. Please
      |  ^~~~~
/root/centreon-collect/22.04.1/bbdo/tag.pb.h:19:2: error: #error regenerate this file with a newer version of protoc.
   19 | #error regenerate this file with a newer version of protoc.
      |  ^~~~~
In file included from /root/centreon-collect/22.04.1/bbdo/tag.pb.h:26,
                 from /root/centreon-collect/22.04.1/bbdo/tag.pb.cc:4:
/usr/include/google/protobuf/generated_message_table_driven.h:287:25: error: ‘MapEntryHelper’ does not name a type; did you mean ‘MapEntryLite’?
  287 |   bool operator()(const MapEntryHelper<T>& a,
      |                         ^~~~~~~~~~~~~~
      |                         MapEntryLite
/usr/include/google/protobuf/generated_message_table_driven.h:287:39: error: expected ‘,’ or ‘...’ before ‘<’ token
  287 |   bool operator()(const MapEntryHelper<T>& a,
      |                                       ^
/usr/include/google/protobuf/generated_message_table_driven.h: In member function ‘bool google::protobuf::internal::CompareMapKey::operator()(int) const’:
/usr/include/google/protobuf/generated_message_table_driven.h:289:20: error: ‘a’ was not declared in this scope
  289 |     return Compare(a.key_, b.key_);
      |                    ^
/usr/include/google/protobuf/generated_message_table_driven.h:289:28: error: ‘b’ was not declared in this scope
  289 |     return Compare(a.key_, b.key_);
      |                            ^
/usr/include/google/protobuf/generated_message_table_driven.h: In function ‘void google::protobuf::internal::MapFieldSerializer(const uint8*, google::protobuf::uint32, google::protobuf::uint32, google::protobuf::uint32, google::protobuf::io::CodedOutputStream*)’:
/usr/include/google/protobuf/generated_message_table_driven.h:300:11: error: ‘MapEntryHelper’ does not name a type; did you mean ‘MapEntryLite’?
  300 |   typedef MapEntryHelper<typename MapFieldType::EntryTypeTrait> Entry;
      |           ^~~~~~~~~~~~~~
      |           MapEntryLite
/usr/include/google/protobuf/generated_message_table_driven.h:311:7: error: ‘Entry’ was not declared in this scope; did you mean ‘MapEntry’?
  311 |       Entry map_entry(*it);
      |       ^~~~~
      |       MapEntry
/usr/include/google/protobuf/generated_message_table_driven.h:313:29: error: ‘map_entry’ was not declared in this scope; did you mean ‘MapEntry’?
  313 |       output->WriteVarint32(map_entry._cached_size_);
      |                             ^~~~~~~~~
      |                             MapEntry
/usr/include/google/protobuf/generated_message_table_driven.h:318:17: error: ‘Entry’ was not declared in this scope; did you mean ‘MapEntry’?
  318 |     std::vector<Entry> v;
      |                 ^~~~~
      |                 MapEntry
/usr/include/google/protobuf/generated_message_table_driven.h:318:22: error: template argument 1 is invalid
  318 |     std::vector<Entry> v;
      |                      ^
/usr/include/google/protobuf/generated_message_table_driven.h:318:22: error: template argument 2 is invalid
/usr/include/google/protobuf/generated_message_table_driven.h:321:9: error: request for member ‘push_back’ in ‘v’, which is of non-class type ‘int’
  321 |       v.push_back(Entry(*it));
      |         ^~~~~~~~~
/usr/include/google/protobuf/generated_message_table_driven.h:323:17: error: request for member ‘begin’ in ‘v’, which is of non-class type ‘int’
  323 |     std::sort(v.begin(), v.end(), CompareMapKey());
      |                 ^~~~~
/usr/include/google/protobuf/generated_message_table_driven.h:323:28: error: request for member ‘end’ in ‘v’, which is of non-class type ‘int’
  323 |     std::sort(v.begin(), v.end(), CompareMapKey());
      |                            ^~~
/usr/include/google/protobuf/generated_message_table_driven.h:324:27: error: request for member ‘size’ in ‘v’, which is of non-class type ‘int’
  324 |     for (int i = 0; i < v.size(); i++) {
      |                           ^~~~
/usr/include/google/protobuf/generated_message_table_driven.h:326:30: error: invalid types ‘int[int]’ for array subscript
  326 |       output->WriteVarint32(v[i]._cached_size_);
      |                              ^
/usr/include/google/protobuf/generated_message_table_driven.h:327:58: error: invalid types ‘int[int]’ for array subscript
  327 |       SerializeInternal(reinterpret_cast<const uint8*>(&v[i]), t->field_table,
      |                                                          ^
In file included from /root/centreon-collect/22.04.1/bbdo/tag.pb.cc:4:
/root/centreon-collect/22.04.1/bbdo/tag.pb.h: At global scope:
/root/centreon-collect/22.04.1/bbdo/tag.pb.h:196:15: error: ‘com::centreon::broker::Tag* com::centreon::broker::Tag::New() const’ marked ‘final’, but is not virtual
  196 |   inline Tag* New() const final {
      |               ^~~
/root/centreon-collect/22.04.1/bbdo/tag.pb.h:203:8: error: ‘void com::centreon::broker::Tag::CopyFrom(const google::protobuf::Message&)’ marked ‘final’, but is not virtual
  203 |   void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
      |        ^~~~~~~~
/root/centreon-collect/22.04.1/bbdo/tag.pb.h:425:19: error: ‘com::centreon::broker::TagInfo* com::centreon::broker::TagInfo::New() const’ marked ‘final’, but is not virtual
  425 |   inline TagInfo* New() const final {
      |                   ^~~
/root/centreon-collect/22.04.1/bbdo/tag.pb.h:432:8: error: ‘void com::centreon::broker::TagInfo::CopyFrom(const google::protobuf::Message&)’ marked ‘final’, but is not virtual
  432 |   void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
      |        ^~~~~~~~
/root/centreon-collect/22.04.1/bbdo/tag.pb.h: In member function ‘void com::centreon::broker::Tag::clear_id()’:
/root/centreon-collect/22.04.1/bbdo/tag.pb.h:521:9: error: ‘PROTOBUF_ULONGLONG’ was not declared in this scope
  521 |   id_ = PROTOBUF_ULONGLONG(0);
      |         ^~~~~~~~~~~~~~~~~~
/root/centreon-collect/22.04.1/bbdo/tag.pb.h: In member function ‘void com::centreon::broker::Tag::clear_name()’:
/root/centreon-collect/22.04.1/bbdo/tag.pb.h:581:21: error: no matching function for call to ‘google::protobuf::internal::ArenaStringPtr::ClearToEmpty(const string*, google::protobuf::Arena*)’
  581 |   name_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
      |   ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /root/centreon-collect/22.04.1/bbdo/tag.pb.h:25,
                 from /root/centreon-collect/22.04.1/bbdo/tag.pb.cc:4:
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:325:8: note: candidate: ‘void google::protobuf::internal::ArenaStringPtr::ClearToEmpty()’
  325 |   void ClearToEmpty();
      |        ^~~~~~~~~~~~
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:325:8: note:   candidate expects 0 arguments, 2 provided
In file included from /root/centreon-collect/22.04.1/bbdo/tag.pb.cc:4:
/root/centreon-collect/22.04.1/bbdo/tag.pb.h: In member function ‘void com::centreon::broker::Tag::_internal_set_name(const string&)’:
/root/centreon-collect/22.04.1/bbdo/tag.pb.h:600:12: error: no matching function for call to ‘google::protobuf::internal::ArenaStringPtr::Set(const string*, const string&, google::protobuf::Arena*)’
  600 |   name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena());
      |   ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /root/centreon-collect/22.04.1/bbdo/tag.pb.h:25,
                 from /root/centreon-collect/22.04.1/bbdo/tag.pb.cc:4:
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:273:8: note: candidate: ‘template<class RefWrappedType> void google::protobuf::internal::ArenaStringPtr::Set(std::reference_wrapper<_Tp>, google::protobuf::Arena*)’
  273 |   void Set(std::reference_wrapper<RefWrappedType> const_string_ref,
      |        ^~~
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:273:8: note:   template argument deduction/substitution failed:
In file included from /root/centreon-collect/22.04.1/bbdo/tag.pb.cc:4:
/root/centreon-collect/22.04.1/bbdo/tag.pb.h:600:12: note:   mismatched types ‘std::reference_wrapper<_Tp>’ and ‘const string*’ {aka ‘const std::__cxx11::basic_string<char>*’}
  600 |   name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena());
      |   ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /root/centreon-collect/22.04.1/bbdo/tag.pb.h:25,
                 from /root/centreon-collect/22.04.1/bbdo/tag.pb.cc:4:
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:262:8: note: candidate: ‘void google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::ConstStringParam, google::protobuf::Arena*)’
  262 |   void Set(ConstStringParam value, Arena* arena);
      |        ^~~
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:262:8: note:   candidate expects 2 arguments, 3 provided
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:263:8: note: candidate: ‘void google::protobuf::internal::ArenaStringPtr::Set(std::string&&, google::protobuf::Arena*)’
  263 |   void Set(std::string&& value, Arena* arena);
      |        ^~~
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:263:8: note:   candidate expects 2 arguments, 3 provided
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:408:13: note: candidate: ‘void google::protobuf::internal::ArenaStringPtr::Set(const char*, google::protobuf::Arena*)’
  408 | inline void ArenaStringPtr::Set(const char* s, Arena* arena) {
      |             ^~~~~~~~~~~~~~
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:408:13: note:   candidate expects 2 arguments, 3 provided
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:412:13: note: candidate: ‘void google::protobuf::internal::ArenaStringPtr::Set(const char*, size_t, google::protobuf::Arena*)’
  412 | inline void ArenaStringPtr::Set(const char* s, size_t n, Arena* arena) {
      |             ^~~~~~~~~~~~~~
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:412:45: note:   no known conversion for argument 1 from ‘const string*’ {aka ‘const std::__cxx11::basic_string<char>*’} to ‘const char*’
  412 | inline void ArenaStringPtr::Set(const char* s, size_t n, Arena* arena) {
      |                                 ~~~~~~~~~~~~^
In file included from /root/centreon-collect/22.04.1/bbdo/tag.pb.cc:4:
/root/centreon-collect/22.04.1/bbdo/tag.pb.h: In member function ‘void com::centreon::broker::Tag::set_name(std::string&&)’:
/root/centreon-collect/22.04.1/bbdo/tag.pb.h:604:12: error: no matching function for call to ‘google::protobuf::internal::ArenaStringPtr::Set(const string*, std::remove_reference<std::__cxx11::basic_string<char>&>::type, google::protobuf::Arena*)’
  604 |   name_.Set(
      |   ~~~~~~~~~^
  605 |     &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena());
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /root/centreon-collect/22.04.1/bbdo/tag.pb.h:25,
                 from /root/centreon-collect/22.04.1/bbdo/tag.pb.cc:4:
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:273:8: note: candidate: ‘template<class RefWrappedType> void google::protobuf::internal::ArenaStringPtr::Set(std::reference_wrapper<_Tp>, google::protobuf::Arena*)’
  273 |   void Set(std::reference_wrapper<RefWrappedType> const_string_ref,
      |        ^~~
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:273:8: note:   template argument deduction/substitution failed:
In file included from /root/centreon-collect/22.04.1/bbdo/tag.pb.cc:4:
/root/centreon-collect/22.04.1/bbdo/tag.pb.h:604:12: note:   mismatched types ‘std::reference_wrapper<_Tp>’ and ‘const string*’ {aka ‘const std::__cxx11::basic_string<char>*’}
  604 |   name_.Set(
      |   ~~~~~~~~~^
  605 |     &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena());
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /root/centreon-collect/22.04.1/bbdo/tag.pb.h:25,
                 from /root/centreon-collect/22.04.1/bbdo/tag.pb.cc:4:
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:262:8: note: candidate: ‘void google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::ConstStringParam, google::protobuf::Arena*)’
  262 |   void Set(ConstStringParam value, Arena* arena);
      |        ^~~
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:262:8: note:   candidate expects 2 arguments, 3 provided
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:263:8: note: candidate: ‘void google::protobuf::internal::ArenaStringPtr::Set(std::string&&, google::protobuf::Arena*)’
  263 |   void Set(std::string&& value, Arena* arena);
      |        ^~~
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:263:8: note:   candidate expects 2 arguments, 3 provided
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:408:13: note: candidate: ‘void google::protobuf::internal::ArenaStringPtr::Set(const char*, google::protobuf::Arena*)’
  408 | inline void ArenaStringPtr::Set(const char* s, Arena* arena) {
      |             ^~~~~~~~~~~~~~
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:408:13: note:   candidate expects 2 arguments, 3 provided
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:412:13: note: candidate: ‘void google::protobuf::internal::ArenaStringPtr::Set(const char*, size_t, google::protobuf::Arena*)’
  412 | inline void ArenaStringPtr::Set(const char* s, size_t n, Arena* arena) {
      |             ^~~~~~~~~~~~~~
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:412:45: note:   no known conversion for argument 1 from ‘const string*’ {aka ‘const std::__cxx11::basic_string<char>*’} to ‘const char*’
  412 | inline void ArenaStringPtr::Set(const char* s, size_t n, Arena* arena) {
      |                                 ~~~~~~~~~~~~^
In file included from /root/centreon-collect/22.04.1/bbdo/tag.pb.cc:4:
/root/centreon-collect/22.04.1/bbdo/tag.pb.h: In member function ‘void com::centreon::broker::Tag::set_name(const char*)’:
/root/centreon-collect/22.04.1/bbdo/tag.pb.h:611:12: error: no matching function for call to ‘google::protobuf::internal::ArenaStringPtr::Set(const string*, std::string, google::protobuf::Arena*)’
  611 |   name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
      |   ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  612 |               GetArena());
      |               ~~~~~~~~~~~
In file included from /root/centreon-collect/22.04.1/bbdo/tag.pb.h:25,
                 from /root/centreon-collect/22.04.1/bbdo/tag.pb.cc:4:
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:273:8: note: candidate: ‘template<class RefWrappedType> void google::protobuf::internal::ArenaStringPtr::Set(std::reference_wrapper<_Tp>, google::protobuf::Arena*)’
  273 |   void Set(std::reference_wrapper<RefWrappedType> const_string_ref,
      |        ^~~
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:273:8: note:   template argument deduction/substitution failed:
In file included from /root/centreon-collect/22.04.1/bbdo/tag.pb.cc:4:
/root/centreon-collect/22.04.1/bbdo/tag.pb.h:611:12: note:   mismatched types ‘std::reference_wrapper<_Tp>’ and ‘const string*’ {aka ‘const std::__cxx11::basic_string<char>*’}
  611 |   name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
      |   ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  612 |               GetArena());
      |               ~~~~~~~~~~~
In file included from /root/centreon-collect/22.04.1/bbdo/tag.pb.h:25,
                 from /root/centreon-collect/22.04.1/bbdo/tag.pb.cc:4:
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:262:8: note: candidate: ‘void google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::ConstStringParam, google::protobuf::Arena*)’
  262 |   void Set(ConstStringParam value, Arena* arena);
      |        ^~~
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:262:8: note:   candidate expects 2 arguments, 3 provided
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:263:8: note: candidate: ‘void google::protobuf::internal::ArenaStringPtr::Set(std::string&&, google::protobuf::Arena*)’
  263 |   void Set(std::string&& value, Arena* arena);
      |        ^~~
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:263:8: note:   candidate expects 2 arguments, 3 provided
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:408:13: note: candidate: ‘void google::protobuf::internal::ArenaStringPtr::Set(const char*, google::protobuf::Arena*)’
  408 | inline void ArenaStringPtr::Set(const char* s, Arena* arena) {
      |             ^~~~~~~~~~~~~~
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:408:13: note:   candidate expects 2 arguments, 3 provided
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:412:13: note: candidate: ‘void google::protobuf::internal::ArenaStringPtr::Set(const char*, size_t, google::protobuf::Arena*)’
  412 | inline void ArenaStringPtr::Set(const char* s, size_t n, Arena* arena) {
      |             ^~~~~~~~~~~~~~
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:412:45: note:   no known conversion for argument 1 from ‘const string*’ {aka ‘const std::__cxx11::basic_string<char>*’} to ‘const char*’
  412 | inline void ArenaStringPtr::Set(const char* s, size_t n, Arena* arena) {
      |                                 ~~~~~~~~~~~~^
In file included from /root/centreon-collect/22.04.1/bbdo/tag.pb.cc:4:
/root/centreon-collect/22.04.1/bbdo/tag.pb.h: In member function ‘void com::centreon::broker::Tag::set_name(const char*, size_t)’:
/root/centreon-collect/22.04.1/bbdo/tag.pb.h:618:12: error: no matching function for call to ‘google::protobuf::internal::ArenaStringPtr::Set(const string*, std::string, google::protobuf::Arena*)’
  618 |   name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(
      |   ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  619 |       reinterpret_cast<const char*>(value), size), GetArena());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /root/centreon-collect/22.04.1/bbdo/tag.pb.h:25,
                 from /root/centreon-collect/22.04.1/bbdo/tag.pb.cc:4:
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:273:8: note: candidate: ‘template<class RefWrappedType> void google::protobuf::internal::ArenaStringPtr::Set(std::reference_wrapper<_Tp>, google::protobuf::Arena*)’
  273 |   void Set(std::reference_wrapper<RefWrappedType> const_string_ref,
      |        ^~~
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:273:8: note:   template argument deduction/substitution failed:
In file included from /root/centreon-collect/22.04.1/bbdo/tag.pb.cc:4:
/root/centreon-collect/22.04.1/bbdo/tag.pb.h:618:12: note:   mismatched types ‘std::reference_wrapper<_Tp>’ and ‘const string*’ {aka ‘const std::__cxx11::basic_string<char>*’}
  618 |   name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(
      |   ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  619 |       reinterpret_cast<const char*>(value), size), GetArena());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /root/centreon-collect/22.04.1/bbdo/tag.pb.h:25,
                 from /root/centreon-collect/22.04.1/bbdo/tag.pb.cc:4:
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:262:8: note: candidate: ‘void google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::ConstStringParam, google::protobuf::Arena*)’
  262 |   void Set(ConstStringParam value, Arena* arena);
      |        ^~~
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:262:8: note:   candidate expects 2 arguments, 3 provided
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:263:8: note: candidate: ‘void google::protobuf::internal::ArenaStringPtr::Set(std::string&&, google::protobuf::Arena*)’
  263 |   void Set(std::string&& value, Arena* arena);
      |        ^~~
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:263:8: note:   candidate expects 2 arguments, 3 provided
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:408:13: note: candidate: ‘void google::protobuf::internal::ArenaStringPtr::Set(const char*, google::protobuf::Arena*)’
  408 | inline void ArenaStringPtr::Set(const char* s, Arena* arena) {
      |             ^~~~~~~~~~~~~~
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:408:13: note:   candidate expects 2 arguments, 3 provided
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:412:13: note: candidate: ‘void google::protobuf::internal::ArenaStringPtr::Set(const char*, size_t, google::protobuf::Arena*)’
  412 | inline void ArenaStringPtr::Set(const char* s, size_t n, Arena* arena) {
      |             ^~~~~~~~~~~~~~
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:412:45: note:   no known conversion for argument 1 from ‘const string*’ {aka ‘const std::__cxx11::basic_string<char>*’} to ‘const char*’
  412 | inline void ArenaStringPtr::Set(const char* s, size_t n, Arena* arena) {
      |                                 ~~~~~~~~~~~~^
In file included from /root/centreon-collect/22.04.1/bbdo/tag.pb.cc:4:
/root/centreon-collect/22.04.1/bbdo/tag.pb.h: In member function ‘std::string* com::centreon::broker::Tag::_internal_mutable_name()’:
/root/centreon-collect/22.04.1/bbdo/tag.pb.h:624:23: error: no matching function for call to ‘google::protobuf::internal::ArenaStringPtr::Mutable(const string*, google::protobuf::Arena*)’
  624 |   return name_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
      |          ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /root/centreon-collect/22.04.1/bbdo/tag.pb.h:25,
                 from /root/centreon-collect/22.04.1/bbdo/tag.pb.cc:4:
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:282:16: note: candidate: ‘std::string* google::protobuf::internal::ArenaStringPtr::Mutable(google::protobuf::Arena*)’
  282 |   std::string* Mutable(Arena* arena);
      |                ^~~~~~~
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:282:16: note:   candidate expects 1 argument, 2 provided
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:283:16: note: candidate: ‘std::string* google::protobuf::internal::ArenaStringPtr::Mutable(const google::protobuf::internal::LazyString&, google::protobuf::Arena*)’
  283 |   std::string* Mutable(const LazyString& default_value, Arena* arena);
      |                ^~~~~~~
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:283:42: note:   no known conversion for argument 1 from ‘const string*’ {aka ‘const std::__cxx11::basic_string<char>*’} to ‘const google::protobuf::internal::LazyString&’
  283 |   std::string* Mutable(const LazyString& default_value, Arena* arena);
      |                        ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
In file included from /root/centreon-collect/22.04.1/bbdo/tag.pb.cc:4:
/root/centreon-collect/22.04.1/bbdo/tag.pb.h: In member function ‘std::string* com::centreon::broker::Tag::release_name()’:
/root/centreon-collect/22.04.1/bbdo/tag.pb.h:628:23: error: no matching function for call to ‘google::protobuf::internal::ArenaStringPtr::Release(const string*, google::protobuf::Arena*)’
  628 |   return name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
      |          ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /root/centreon-collect/22.04.1/bbdo/tag.pb.h:25,
                 from /root/centreon-collect/22.04.1/bbdo/tag.pb.cc:4:
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:311:35: note: candidate: ‘std::string* google::protobuf::internal::ArenaStringPtr::Release()’
  311 |   PROTOBUF_NODISCARD std::string* Release();
      |                                   ^~~~~~~
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:311:35: note:   candidate expects 0 arguments, 2 provided
In file included from /root/centreon-collect/22.04.1/bbdo/tag.pb.cc:4:
/root/centreon-collect/22.04.1/bbdo/tag.pb.h: In member function ‘void com::centreon::broker::Tag::set_allocated_name(std::string*)’:
/root/centreon-collect/22.04.1/bbdo/tag.pb.h:636:21: error: no matching function for call to ‘google::protobuf::internal::ArenaStringPtr::SetAllocated(const string*, std::string*&, google::protobuf::Arena*)’
  636 |   name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name,
      |   ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  637 |       GetArena());
      |       ~~~~~~~~~~~
In file included from /root/centreon-collect/22.04.1/bbdo/tag.pb.h:25,
                 from /root/centreon-collect/22.04.1/bbdo/tag.pb.cc:4:
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:316:8: note: candidate: ‘void google::protobuf::internal::ArenaStringPtr::SetAllocated(std::string*, google::protobuf::Arena*)’
  316 |   void SetAllocated(std::string* value, Arena* arena);
      |        ^~~~~~~~~~~~
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:316:8: note:   candidate expects 2 arguments, 3 provided
In file included from /root/centreon-collect/22.04.1/bbdo/tag.pb.cc:4:
/root/centreon-collect/22.04.1/bbdo/tag.pb.h: In member function ‘std::string* com::centreon::broker::Tag::unsafe_arena_release_name()’:
/root/centreon-collect/22.04.1/bbdo/tag.pb.h:644:16: error: ‘struct google::protobuf::internal::ArenaStringPtr’ has no member named ‘UnsafeArenaRelease’
  644 |   return name_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      |                ^~~~~~~~~~~~~~~~~~
/root/centreon-collect/22.04.1/bbdo/tag.pb.h: In member function ‘void com::centreon::broker::Tag::unsafe_arena_set_allocated_name(std::string*)’:
/root/centreon-collect/22.04.1/bbdo/tag.pb.h:655:9: error: ‘struct google::protobuf::internal::ArenaStringPtr’ has no member named ‘UnsafeArenaSetAllocated’
  655 |   name_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
      |         ^~~~~~~~~~~~~~~~~~~~~~~
/root/centreon-collect/22.04.1/bbdo/tag.pb.h: In member function ‘void com::centreon::broker::Tag::clear_poller_id()’:
/root/centreon-collect/22.04.1/bbdo/tag.pb.h:662:16: error: ‘PROTOBUF_LONGLONG’ was not declared in this scope
  662 |   poller_id_ = PROTOBUF_LONGLONG(0);
      |                ^~~~~~~~~~~~~~~~~
/root/centreon-collect/22.04.1/bbdo/tag.pb.h: In member function ‘void com::centreon::broker::TagInfo::clear_id()’:
/root/centreon-collect/22.04.1/bbdo/tag.pb.h:686:9: error: ‘PROTOBUF_ULONGLONG’ was not declared in this scope
  686 |   id_ = PROTOBUF_ULONGLONG(0);
      |         ^~~~~~~~~~~~~~~~~~
/root/centreon-collect/22.04.1/bbdo/tag.pb.cc: At global scope:
/root/centreon-collect/22.04.1/bbdo/tag.pb.cc:42:36: error: ‘SCCInfo’ in namespace ‘google::protobuf::internal’ does not name a template type
   42 | ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Tag_tag_2eproto =
      |                                    ^~~~~~~
/root/centreon-collect/22.04.1/bbdo/tag.pb.cc:56:36: error: ‘SCCInfo’ in namespace ‘google::protobuf::internal’ does not name a template type
   56 | ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_TagInfo_tag_2eproto =
      |                                    ^~~~~~~
/root/centreon-collect/22.04.1/bbdo/tag.pb.cc:85:1: warning: missing initializer for member ‘google::protobuf::internal::MigrationSchema::object_size’ [-Wmissing-field-initializers]
   85 | };
      | ^
/root/centreon-collect/22.04.1/bbdo/tag.pb.cc:85:1: warning: missing initializer for member ‘google::protobuf::internal::MigrationSchema::object_size’ [-Wmissing-field-initializers]
/root/centreon-collect/22.04.1/bbdo/tag.pb.cc:106:43: error: ‘SCCInfoBase’ in namespace ‘google::protobuf::internal’ does not name a type
  106 | static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_tag_2eproto_sccs[2] = {
      |                                           ^~~~~~~~~~~
/root/centreon-collect/22.04.1/bbdo/tag.pb.cc:113:39: error: ‘descriptor_table_tag_2eproto_sccs’ was not declared in this scope; did you mean ‘descriptor_table_tag_2eproto_once’?
  113 |   &descriptor_table_tag_2eproto_once, descriptor_table_tag_2eproto_sccs, descriptor_table_tag_2eproto_deps, 2, 0,
      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                       descriptor_table_tag_2eproto_once
/root/centreon-collect/22.04.1/bbdo/tag.pb.cc:119:100: error: ‘AddDescriptors’ is not a member of ‘google::protobuf::internal’
  119 | static bool dynamic_init_dummy_tag_2eproto = (static_cast<void>(::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_tag_2eproto)), true);
      |                                                                                                    ^~~~~~~~~~~~~~
/root/centreon-collect/22.04.1/bbdo/tag.pb.cc: In copy constructor ‘com::centreon::broker::Tag::Tag(const com::centreon::broker::Tag&)’:
/root/centreon-collect/22.04.1/bbdo/tag.pb.cc:180:9: error: ‘struct google::protobuf::internal::ArenaStringPtr’ has no member named ‘UnsafeSetDefault’
  180 |   name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
      |         ^~~~~~~~~~~~~~~~
/root/centreon-collect/22.04.1/bbdo/tag.pb.cc:182:14: error: no matching function for call to ‘google::protobuf::internal::ArenaStringPtr::Set(const string*, const string&, google::protobuf::Arena*)’
  182 |     name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_name(),
      |     ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  183 |       GetArena());
      |       ~~~~~~~~~~~
In file included from /root/centreon-collect/22.04.1/bbdo/tag.pb.h:25,
                 from /root/centreon-collect/22.04.1/bbdo/tag.pb.cc:4:
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:273:8: note: candidate: ‘template<class RefWrappedType> void google::protobuf::internal::ArenaStringPtr::Set(std::reference_wrapper<_Tp>, google::protobuf::Arena*)’
  273 |   void Set(std::reference_wrapper<RefWrappedType> const_string_ref,
      |        ^~~
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:273:8: note:   template argument deduction/substitution failed:
/root/centreon-collect/22.04.1/bbdo/tag.pb.cc:182:14: note:   mismatched types ‘std::reference_wrapper<_Tp>’ and ‘const string*’ {aka ‘const std::__cxx11::basic_string<char>*’}
  182 |     name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_name(),
      |     ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  183 |       GetArena());
      |       ~~~~~~~~~~~
In file included from /root/centreon-collect/22.04.1/bbdo/tag.pb.h:25,
                 from /root/centreon-collect/22.04.1/bbdo/tag.pb.cc:4:
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:262:8: note: candidate: ‘void google::protobuf::internal::ArenaStringPtr::Set(google::protobuf::ConstStringParam, google::protobuf::Arena*)’
  262 |   void Set(ConstStringParam value, Arena* arena);
      |        ^~~
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:262:8: note:   candidate expects 2 arguments, 3 provided
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:263:8: note: candidate: ‘void google::protobuf::internal::ArenaStringPtr::Set(std::string&&, google::protobuf::Arena*)’
  263 |   void Set(std::string&& value, Arena* arena);
      |        ^~~
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:263:8: note:   candidate expects 2 arguments, 3 provided
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:408:13: note: candidate: ‘void google::protobuf::internal::ArenaStringPtr::Set(const char*, google::protobuf::Arena*)’
  408 | inline void ArenaStringPtr::Set(const char* s, Arena* arena) {
      |             ^~~~~~~~~~~~~~
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:408:13: note:   candidate expects 2 arguments, 3 provided
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:412:13: note: candidate: ‘void google::protobuf::internal::ArenaStringPtr::Set(const char*, size_t, google::protobuf::Arena*)’
  412 | inline void ArenaStringPtr::Set(const char* s, size_t n, Arena* arena) {
      |             ^~~~~~~~~~~~~~
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:412:45: note:   no known conversion for argument 1 from ‘const string*’ {aka ‘const std::__cxx11::basic_string<char>*’} to ‘const char*’
  412 | inline void ArenaStringPtr::Set(const char* s, size_t n, Arena* arena) {
      |                                 ~~~~~~~~~~~~^
/root/centreon-collect/22.04.1/bbdo/tag.pb.cc: In member function ‘void com::centreon::broker::Tag::SharedCtor()’:
/root/centreon-collect/22.04.1/bbdo/tag.pb.cc:192:38: error: ‘InitSCC’ is not a member of ‘google::protobuf::internal’
  192 |   ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Tag_tag_2eproto.base);
      |                                      ^~~~~~~
/root/centreon-collect/22.04.1/bbdo/tag.pb.cc:192:47: error: ‘scc_info_Tag_tag_2eproto’ was not declared in this scope
  192 |   ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Tag_tag_2eproto.base);
      |                                               ^~~~~~~~~~~~~~~~~~~~~~~~
/root/centreon-collect/22.04.1/bbdo/tag.pb.cc:193:9: error: ‘struct google::protobuf::internal::ArenaStringPtr’ has no member named ‘UnsafeSetDefault’
  193 |   name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
      |         ^~~~~~~~~~~~~~~~
/root/centreon-collect/22.04.1/bbdo/tag.pb.cc: In member function ‘void com::centreon::broker::Tag::SharedDtor()’:
/root/centreon-collect/22.04.1/bbdo/tag.pb.cc:207:9: error: ‘struct google::protobuf::internal::ArenaStringPtr’ has no member named ‘DestroyNoArena’
  207 |   name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
      |         ^~~~~~~~~~~~~~
/root/centreon-collect/22.04.1/bbdo/tag.pb.cc: In static member function ‘static const com::centreon::broker::Tag& com::centreon::broker::Tag::default_instance()’:
/root/centreon-collect/22.04.1/bbdo/tag.pb.cc:220:38: error: ‘InitSCC’ is not a member of ‘google::protobuf::internal’
  220 |   ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Tag_tag_2eproto.base);
      |                                      ^~~~~~~
/root/centreon-collect/22.04.1/bbdo/tag.pb.cc:220:49: error: ‘::scc_info_Tag_tag_2eproto’ has not been declared
  220 |   ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Tag_tag_2eproto.base);
      |                                                 ^~~~~~~~~~~~~~~~~~~~~~~~
/root/centreon-collect/22.04.1/bbdo/tag.pb.cc: In member function ‘virtual void com::centreon::broker::Tag::Clear()’:
/root/centreon-collect/22.04.1/bbdo/tag.pb.cc:231:21: error: no matching function for call to ‘google::protobuf::internal::ArenaStringPtr::ClearToEmpty(const string*, google::protobuf::Arena*)’
  231 |   name_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
      |   ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /root/centreon-collect/22.04.1/bbdo/tag.pb.h:25,
                 from /root/centreon-collect/22.04.1/bbdo/tag.pb.cc:4:
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:325:8: note: candidate: ‘void google::protobuf::internal::ArenaStringPtr::ClearToEmpty()’
  325 |   void ClearToEmpty();
      |        ^~~~~~~~~~~~
/root/.conan/data/protobuf/3.21.4/_/_/package/caad570777f8bfa7873d307fb34fea9bdb600901/include/google/protobuf/arenastring.h:325:8: note:   candidate expects 0 arguments, 2 provided
/root/centreon-collect/22.04.1/bbdo/tag.pb.cc: In member function ‘void com::centreon::broker::Tag::InternalSwap(com::centreon::broker::Tag*)’:
/root/centreon-collect/22.04.1/bbdo/tag.pb.cc:467:9: error: ‘struct google::protobuf::internal::ArenaStringPtr’ has no member named ‘Swap’
  467 |   name_.Swap(&other->name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
      |         ^~~~
/root/centreon-collect/22.04.1/bbdo/tag.pb.cc: In static member function ‘static const com::centreon::broker::TagInfo& com::centreon::broker::TagInfo::default_instance()’:
/root/centreon-collect/22.04.1/bbdo/tag.pb.cc:530:38: error: ‘InitSCC’ is not a member of ‘google::protobuf::internal’
  530 |   ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_TagInfo_tag_2eproto.base);
      |                                      ^~~~~~~
/root/centreon-collect/22.04.1/bbdo/tag.pb.cc:530:49: error: ‘::scc_info_TagInfo_tag_2eproto’ has not been declared; did you mean ‘InitDefaultsscc_info_TagInfo_tag_2eproto’?
  530 |   ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_TagInfo_tag_2eproto.base);
      |                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                 InitDefaultsscc_info_TagInfo_tag_2eproto
/root/centreon-collect/22.04.1/bbdo/tag.pb.cc: At global scope:
/root/centreon-collect/22.04.1/bbdo/tag.pb.cc:119:13: warning: ‘dynamic_init_dummy_tag_2eproto’ defined but not used [-Wunused-variable]
  119 | static bool dynamic_init_dummy_tag_2eproto = (static_cast<void>(::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_tag_2eproto)), true);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/root/centreon-collect/22.04.1/bbdo/tag.pb.cc:45:13: warning: ‘void InitDefaultsscc_info_TagInfo_tag_2eproto()’ defined but not used [-Wunused-function]
   45 | static void InitDefaultsscc_info_TagInfo_tag_2eproto() {
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/root/centreon-collect/22.04.1/bbdo/tag.pb.cc:31:13: warning: ‘void InitDefaultsscc_info_Tag_tag_2eproto()’ defined but not used [-Wunused-function]
   31 | static void InitDefaultsscc_info_Tag_tag_2eproto() {
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [bbdo/CMakeFiles/pb_tag_lib.dir/build.make:83: bbdo/CMakeFiles/pb_tag_lib.dir/tag.pb.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1448: bbdo/CMakeFiles/pb_tag_lib.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
Shadok commented 1 year ago

The only thing i'm installing you didn't is protobuf-compiler, otherwise it complains it can't find protoc. Regarding "This file was generated by an older version of protoc", how did you install protoc ?

I had this during cmake.sh, not sure if relevant : Protobuf compiler version 3.12.4 doesn't match library version 3.21.4

Shadok commented 1 year ago

At least, it's consistent into annoying me ...

...
-- Configuring done
-- Generating done
-- Build files have been written to: /root/centreon-collect/22.04.1/build
root@84caf8f1e4cf:~/centreon-collect/22.04.1# cd build
root@84caf8f1e4cf:~/centreon-collect/22.04.1/build# make
[  0%] Generating interface files of the bbdo file host.proto
/bin/sh: 1: --cpp_out=/root/centreon-collect/22.04.1/bbdo: not found
make[2]: *** [bbdo/CMakeFiles/target_host.dir/build.make:74: ../bbdo/host.pb.cc] Error 127
make[1]: *** [CMakeFiles/Makefile2:1291: bbdo/CMakeFiles/target_host.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

The destination exists :

root@84caf8f1e4cf:~/centreon-collect/22.04.1/bbdo# ll
total 72
drwxrwxr-x+  6 1000 1000 4096 Aug 30 13:32 ./
drwxrwsr-x+ 15 root 5313 4096 Jan 23 13:57 ../
-rw-rw-r--+  1 1000 1000 4922 Aug 30 13:32 CMakeLists.txt
drwxrwxr-x+  2 1000 1000 4096 Aug 30 13:32 bam/
drwxrwxr-x+  2 1000 1000 4096 Aug 30 13:32 bbdo/
-rw-rw-r--+  1 1000 1000 4004 Aug 30 13:32 events.hh
-rwxrwxr-x+  1 1000 1000 2844 Aug 30 13:32 generate-accessor.py*
-rw-rw-r--+  1 1000 1000 5377 Aug 30 13:32 host.proto
drwxrwxr-x+  2 1000 1000 4096 Aug 30 13:32 precomp_inc/
-rw-rw-r--+  1 1000 1000  494 Aug 30 13:32 rebuild_message.proto
-rw-rw-r--+  1 1000 1000  148 Aug 30 13:32 remove_graph_message.proto
-rw-rw-r--+  1 1000 1000 6188 Aug 30 13:32 service.proto
-rw-rw-r--+  1 1000 1000 1790 Aug 30 13:32 severity.proto
drwxrwxr-x+  2 1000 1000 4096 Aug 30 13:32 storage/
-rw-rw-r--+  1 1000 1000 1757 Aug 30 13:32 tag.proto
Shadok commented 1 year ago

22.10 doesn't compile either, with make, since "This file was generated by an older version of protoc which is incompatible with your Protocol Buffer headers".

Having a section is the documentation which shows your official compilation infrastructure details would be useful.

rdot-ch commented 1 year ago

I confirm, 22.10.0 does not compile either and there is no information about their compilation environment.

As far as protoc is concerned, check the version of protobuf installed by conan in the .conan/ directories. Fetch the source of this version of protoc on github. Remove any previous installation of protoc from your system, and reinstall it from source. It should solve the "#error This file was generated by an older version of protoc which is.." issue at 1%, then the make command will break again around 12% because of some missing functions in classes...

You may have more chance compiling a newer version. Until it breaks again, who knows.

Shadok commented 1 year ago

Thanks, we set that project aside for now. We still hope to be able to make it works on Ubuntu one day or another, as we did with previous Centreon releases.

We could use the RPM packages but the php 8.1 requirement with an external repository we would need to sync (servers don't have internet access) is a limitation. I don't understand why even RHEL 9 isn't using PHP 8.1 but there is nothing we can do about that.

jean-christophe81 commented 1 year ago

Hi @Shadok When you have this type of problem, you have a mismatch between protoc and protobuf library. First I advise you to uninstall protoc compiler in order to force compilation to use the conan one. Then delete all .pb.h and .pb.cc and retry to compile

Shadok commented 1 year ago

Thanks @jean-christophe81, but now, U22 is using conan 2.x, so i have a lot of other issues before even being able to try to compile.

kor-vox commented 1 year ago

Hi @Shadok, Let's talk about the compilation of 22.10.0 on CentOs7 here. The source code, as provided and with the information provided, cannot be built.

The Readme suggest to:

This does not work out of the box due to several reasons:

To compile 22.10.0 on CentOs7, I had to:

Basically, I patched 22.10.0 with elements they added in 22.10.1. And by manually dealing with all these bugs with installations of new packages on the system. However, note that even in 22.10.1, they still fail to manage the versions of dependencies automatically installed by conan. Because of this, each time you run this .cmake.sh, you may end up with a different set of conan packages, depending on conan updates. And among these unmanaged dependencies, there is protobuf.... the source of so many bugs if its version is not the right one. Last month, with 22.10.0, conan 1.57.0 was installing protobuf 3.21.4, now it installs 3.21.9 (compilation tested with the later.) In other words, even if you succeed to compile the project today, it may fail again in the future. I think this is one of the biggest problem with their source: the lack of a formal procedure and the fact that nobody, nowhere, list the exact version of all the conan packages needed (dependencies not listed in the conanfile).


If you are forced to use 22.04, I would suggest you to go through the same comparison work with 22.10.1. If you can use a newer version of centreon-collect, I would suggest you to use 22.10.1, which is easier to compile on CentOs8 than CentOs7.

That's it. Hopefully it can help somebody get out of this compilation nightmare.

Shadok commented 1 year ago

Thanks a lot @kor-vox, awesome job :) I'm not forced to use 22.04, but since i failed compiling it, i tried 22.10 and 22.04.

I'll try again with U22 and 22.10.1 by forcing conan and the others packages versions.

omercier commented 1 year ago

Hi @Shadok, I'm closing the issue, feel free to reopen it if you think something's still wrong with the last versions.