Building pkgconf/1.7.3 on CentOS 7 fails with the following error:
ERROR: Could not detect Ninja v1.7 or newer
This error seems to come from the meson/0.55.1 package on which pkgconf has a build-time dependency. If I understand correctly, the pre-built version of Ninja on which meson/0.55.1 depends (ninja/1.10.1) is not compatible with CentOS 7. To test this, I modified my PATH variable to point to the package where Ninja is, then tried to load it from a Python interpreter:
[root@f6eed63ec198 test]# PATH="/root/.conan/data/meson/0.55.1/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/bin:/root/.conan/data/ninja/1.10.1/_/_/package/24647d9fe8ec489125dfbae4b3ebefaf7581674c/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" /usr/bin/python3
Python 3.6.8 (default, Apr 2 2020, 13:34:55)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import subprocess
>>> subprocess.Popen('ninja')
<subprocess.Popen object at 0x7fb9cf836f60>
ninja: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by ninja)
Adding --build ninja when building pkgconf solves the issue.
conan profile show default or conan profile show <profile> if custom profile is in use)[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=4.8
compiler.libcxx=libstdc++
build_type=Release
[options]
[build_requires]
[env]
Create a Dockerfile with the following contents, then run docker build .
FROM centos:7
RUN yum update -y \
&& yum groupinstall -y 'Development Tools' \
&& yum install -y \
bash \
git \
libstdc++-static \
python3-devel \
python3-pip \
wget \
which \
&& pip3 install --upgrade pip
RUN pip install conan==1.30.2
RUN conan install pkgconf/1.7.3@ --build missing
Click to expand log
$ docker build .
Sending build context to Docker daemon 2.048kB
Step 1/4 : FROM centos:7
---> b5b4d78bc90c
Step 2/4 : RUN yum update -y && yum groupinstall -y 'Development Tools' && yum install -y bash git libstdc++-static python3-devel python3-pip wget which && pip3 install --upgrade pip
---> Using cache
---> c3b8f71d0271
Step 3/4 : RUN pip install conan==1.30.2
---> Using cache
---> ddd21e57c74f
Step 4/4 : RUN conan install pkgconf/1.7.3@ --build missing
---> Running in fca759b72d91
Auto detecting your dev setup to initialize the default profile (/root/.conan/profiles/default)
Found gcc 4.8
Default settings
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=4.8
compiler.libcxx=libstdc++
build_type=Release
*** You can change them in /root/.conan/profiles/default ***
*** Or override with -s compiler='other' -s ...s***
Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=gcc
compiler.libcxx=libstdc++
compiler.version=4.8
os=Linux
os_build=Linux
[options]
[build_requires]
[env]
pkgconf/1.7.3: Not found in local cache, looking in remotes...
pkgconf/1.7.3: Trying with 'conan-center'...
Downloading conanmanifest.txt
Downloading conanfile.py
Downloading conan_export.tgz
pkgconf/1.7.3: Downloaded recipe revision 0
meson/0.55.1: Not found in local cache, looking in remotes...
meson/0.55.1: Trying with 'conan-center'...
Downloading conanmanifest.txt
Downloading conanfile.py
Downloading conan_export.tgz
meson/0.55.1: Downloaded recipe revision 0
ninja/1.10.1: Not found in local cache, looking in remotes...
ninja/1.10.1: Trying with 'conan-center'...
Downloading conanmanifest.txt
Downloading conanfile.py
Downloading conan_export.tgz
ninja/1.10.1: Downloaded recipe revision 0
Installing package: pkgconf/1.7.3
Requirements
pkgconf/1.7.3 from 'conan-center' - Downloaded
Packages
pkgconf/1.7.3:3a5f72c8cd50641b8efa6ed13e6914c6ced2747c - Build
Build requirements
meson/0.55.1 from 'conan-center' - Downloaded
ninja/1.10.1 from 'conan-center' - Downloaded
Build requirements packages
meson/0.55.1:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Download
ninja/1.10.1:24647d9fe8ec489125dfbae4b3ebefaf7581674c - Download
Installing (downloading, building) binaries...
ninja/1.10.1: Retrieving package 24647d9fe8ec489125dfbae4b3ebefaf7581674c from remote 'conan-center'
Downloading conanmanifest.txt
Downloading conaninfo.txt
Downloading conan_package.tgz
ninja/1.10.1: Package installed 24647d9fe8ec489125dfbae4b3ebefaf7581674c
ninja/1.10.1: Downloaded package revision 0
meson/0.55.1: Retrieving package 5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 from remote 'conan-center'
Downloading conanmanifest.txt
Downloading conaninfo.txt
Downloading conan_package.tgz
meson/0.55.1: Package installed 5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9
meson/0.55.1: Downloaded package revision 0
meson/0.55.1: Appending PATH environment variable: /root/.conan/data/meson/0.55.1/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/bin
pkgconf/1.7.3: Applying build-requirement: meson/0.55.1
pkgconf/1.7.3: Applying build-requirement: ninja/1.10.1
Downloading conan_sources.tgz
pkgconf/1.7.3: Configuring sources in /root/.conan/data/pkgconf/1.7.3/_/_/source
pkgconf/1.7.3: Copying sources to build folder
pkgconf/1.7.3: Building your package in /root/.conan/data/pkgconf/1.7.3/_/_/build/3a5f72c8cd50641b8efa6ed13e6914c6ced2747c
pkgconf/1.7.3: Generator txt created conanbuildinfo.txt
pkgconf/1.7.3: Calling build()
The Meson build system
Version: 0.55.1
Source dir: /root/.conan/data/pkgconf/1.7.3/_/_/build/3a5f72c8cd50641b8efa6ed13e6914c6ced2747c/source_subfolder
Build dir: /root/.conan/data/pkgconf/1.7.3/_/_/build/3a5f72c8cd50641b8efa6ed13e6914c6ced2747c/build_subfolder
Build type: native build
Using 'PKG_CONFIG_PATH' from environment with value: '/root/.conan/data/pkgconf/1.7.3/_/_/build/3a5f72c8cd50641b8efa6ed13e6914c6ced2747c'
Using 'PKG_CONFIG_PATH' from environment with value: '/root/.conan/data/pkgconf/1.7.3/_/_/build/3a5f72c8cd50641b8efa6ed13e6914c6ced2747c'
Project name: pkgconf
Project version: 1.7.3
Using 'CFLAGS' from environment with value: '-m64 -O3 -s -fPIC'
Using 'LDFLAGS' from environment with value: '-m64'
Using 'CPPFLAGS' from environment with value: '-DNDEBUG'
Using 'CFLAGS' from environment with value: '-m64 -O3 -s -fPIC'
Using 'LDFLAGS' from environment with value: '-m64'
Using 'CPPFLAGS' from environment with value: '-DNDEBUG'
C compiler for the host machine: cc (gcc 4.8.5 "cc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39)")
C linker for the host machine: cc ld.bfd 2.27-43
Host machine cpu family: x86_64
Host machine cpu: x86_64
Has header "dlfcn.h" : YES
Has header "inttypes.h" : YES
Has header "memory.h" : YES
Has header "stdint.h" : YES
Has header "stdlib.h" : YES
Has header "strings.h" : YES
Has header "string.h" : YES
Has header "sys/stat.h" : YES
Has header "sys/types.h" : YES
Has header "unistd.h" : YES
Checking for function "cygwin_conv_path" : NO
Checking for function "strlcat" : NO
Checking for function "strlcpy" : NO
Checking for function "strndup" : YES
Header <string.h> has symbol "strndup" : YES
Configuring config.h using configuration
Build targets in project: 2
ERROR: Could not detect Ninja v1.7 or newer
A full log can be found at /root/.conan/data/pkgconf/1.7.3/_/_/build/3a5f72c8cd50641b8efa6ed13e6914c6ced2747c/build_subfolder/meson-logs/meson-log.txt
pkgconf/1.7.3:
WARN: Remotes registry file missing, creating default one in /root/.conan/remotes.json
pkgconf/1.7.3: ERROR: Package '3a5f72c8cd50641b8efa6ed13e6914c6ced2747c' build failed
pkgconf/1.7.3: WARN: Build folder /root/.conan/data/pkgconf/1.7.3/_/_/build/3a5f72c8cd50641b8efa6ed13e6914c6ced2747c
ERROR: pkgconf/1.7.3: Error in build() method, line 76
meson = self._configure_meson()
while calling '_configure_meson', line 61
self._meson.configure(source_folder=self._source_subfolder, build_folder=self._build_subfolder)
ConanException: Error 1 while executing meson "/root/.conan/data/pkgconf/1.7.3/_/_/build/3a5f72c8cd50641b8efa6ed13e6914c6ced2747c/source_subfolder" "/root/.conan/data/pkgconf/1.7.3/_/_/build/3a5f72c8cd50641b8efa6ed13e6914c6ced2747c/build_subfolder" --backend=ninja -Dprefix="/root/.conan/data/pkgconf/1.7.3/_/_/package/3a5f72c8cd50641b8efa6ed13e6914c6ced2747c" -Dlibdir="lib" -Dbindir="bin" -Dsbindir="bin" -Dlibexecdir="bin" -Dincludedir="include" -Ddefault_library="static" -Db_staticpic="true" -Dtests="False" -Dsharedstatedir="/root/.conan/data/pkgconf/1.7.3/_/_/package/3a5f72c8cd50641b8efa6ed13e6914c6ced2747c/bin/share" --buildtype=release
The command '/bin/sh -c conan install pkgconf/1.7.3@ --build missing' returned a non-zero code: 1
I suppose you have not rebuilt ninja locally?
It looks like the ninja package, built by c3i, uses a newer GLIBC version then the one you have installed.
I think you must rebuild ninja.
This problem will come back for other packages, which you should also rebuild.
You might want to look into https://www.softwarecollections.org/en/scls/rhscl/devtoolset-7/
I always build from source on Linux, to avoid GLIBC version issues. Others recipes are affected.
@rdeterre
I think this issue can be closed?
The issue is your toolchain is too old.
Rebuilding ninja locally solves the issue, so we can close this, yes. If I understand correctly, this ties into modeling the glibc version in conan like discussed here: conan-io/conan#3972
Indeed, conan has yet to find a suitable solution for this problem.
Most helpful comment
@rdeterre
I think this issue can be closed?
The issue is your toolchain is too old.