Jira (FACT-1967) Unable to compile libwhereami 0.2.2 on latest Archlinux

0 views
Skip to first unread message

Tim Meusel (JIRA)

unread,
Jul 28, 2019, 10:21:03 AM7/28/19
to puppe...@googlegroups.com
Tim Meusel created an issue
 
Facter / Bug FACT-1967
Unable to compile libwhereami 0.2.2 on latest Archlinux
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2019/07/28 7:20 AM
Priority: Normal Normal
Reporter: Tim Meusel

Hi,
I tried to compile the 0.2.2 release and experienced some issues. My output from

cmake ..

-- The C compiler identification is GNU 9.1.0
-- The CXX compiler identification is GNU 9.1.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Defaulting to a release build.
-- Found Boost: /usr/include (found suitable version "1.69.0", minimum required is "1.54")  
-- Found Boost: /usr/include (found suitable version "1.69.0", minimum required is "1.54") found components:  date_time chrono system 
-- Found Boost: /usr/include (found suitable version "1.69.0", minimum required is "1.54") found components:  locale system 
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found Boost: /usr/include (found suitable version "1.69.0", minimum required is "1.54") found components:  log log_setup thread date_time filesystem system chrono regex atomic 
-- Found Boost: /usr/include (found suitable version "1.69.0", minimum required is "1.54") found components:  regex 
-- Found Boost: /usr/include (found suitable version "1.69.0", minimum required is "1.54") found components:  regex filesystem system 
-- Found Boost: /usr/include (found suitable version "1.69.0", minimum required is "1.54") found components:  regex system filesystem 
-- Found CURL: /usr/lib/libcurl.so (found version "7.65.3")  
-- Found Boost: /usr/include (found suitable version "1.69.0", minimum required is "1.54") found components:  regex system 
-- Found Boost: /usr/include (found suitable version "1.69.0", minimum required is "1.54") found components:  regex filesystem system 
-- Looking for closefrom in c
-- Looking for closefrom in c - not found
-- Found Boost: /usr/include (found suitable version "1.69.0", minimum required is "1.54") found components:  locale filesystem regex system thread chrono date_time atomic 
-- The following OPTIONAL packages have been found:
 
 * Threads
 
-- The following REQUIRED packages have been found:
 
 * CURL
 * Leatherman
 * Boost (required version >= 1.54)
 
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Failed
-- Performing Test COMPILER_HAS_DEPRECATED
-- Performing Test COMPILER_HAS_DEPRECATED - Failed
-- Found PythonInterp: /usr/bin/python (found version "3.7.3") 
-- Configuring done
-- Generating done
-- Build files have been written to: /build/libwhereami/src/libwhereami-0.2.2/build-release

This looks fine to me except for those four lines:

-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Failed
-- Performing Test COMPILER_HAS_DEPRECATED
-- Performing Test COMPILER_HAS_DEPRECATED - Failed

I'm not 100% what they mean, but something failed.

and the output from

make libwhereami_test

Scanning dependencies of target libprojectsrc
[  6%] Building CXX object lib/CMakeFiles/libprojectsrc.dir/src/whereami.cc.o
[  6%] Building CXX object lib/CMakeFiles/libprojectsrc.dir/src/detectors/hyperv_detector.cc.o
[  6%] Building CXX object lib/CMakeFiles/libprojectsrc.dir/src/detectors/kvm_detector.cc.o
[  8%] Building CXX object lib/CMakeFiles/libprojectsrc.dir/src/detectors/openvz_detector.cc.o
[ 10%] Building CXX object lib/CMakeFiles/libprojectsrc.dir/src/detectors/docker_detector.cc.o
[ 12%] Building CXX object lib/CMakeFiles/libprojectsrc.dir/src/detectors/ldom_detector.cc.o
[ 14%] Building CXX object lib/CMakeFiles/libprojectsrc.dir/src/detectors/lpar_detector.cc.o
[ 16%] Building CXX object lib/CMakeFiles/libprojectsrc.dir/src/detectors/lxc_detector.cc.o
[ 18%] Building CXX object lib/CMakeFiles/libprojectsrc.dir/src/detectors/nspawn_detector.cc.o
[ 20%] Building CXX object lib/CMakeFiles/libprojectsrc.dir/src/detectors/virtualbox_detector.cc.o
[ 22%] Building CXX object lib/CMakeFiles/libprojectsrc.dir/src/detectors/vmware_detector.cc.o
[ 25%] Building CXX object lib/CMakeFiles/libprojectsrc.dir/src/detectors/wpar_detector.cc.o
[ 27%] Building CXX object lib/CMakeFiles/libprojectsrc.dir/src/detectors/xen_detector.cc.o
[ 29%] Building CXX object lib/CMakeFiles/libprojectsrc.dir/src/detectors/zone_detector.cc.o
[ 31%] Building CXX object lib/CMakeFiles/libprojectsrc.dir/src/metadata.cc.o
[ 33%] Building CXX object lib/CMakeFiles/libprojectsrc.dir/src/result.cc.o
[ 35%] Building CXX object lib/CMakeFiles/libprojectsrc.dir/src/sources/cgroup_source.cc.o
[ 37%] Building CXX object lib/CMakeFiles/libprojectsrc.dir/src/sources/cpuid_source.cc.o
[ 39%] Building CXX object lib/CMakeFiles/libprojectsrc.dir/src/sources/dmi_source.cc.o
[ 41%] Building CXX object lib/CMakeFiles/libprojectsrc.dir/src/sources/lparstat_source.cc.o
[ 43%] Building CXX object lib/CMakeFiles/libprojectsrc.dir/src/sources/smbios_base.cc.o
[ 45%] Building CXX object lib/CMakeFiles/libprojectsrc.dir/src/sources/system_profiler_source.cc.o
[ 45%] Built target libprojectsrc
Scanning dependencies of target libwhereami_test
[ 47%] Building CXX object lib/tests/CMakeFiles/libwhereami_test.dir/detectors/docker_detector.cc.o
[ 52%] Building CXX object lib/tests/CMakeFiles/libwhereami_test.dir/whereami.cc.o
[ 52%] Building CXX object lib/tests/CMakeFiles/libwhereami_test.dir/detectors/openvz_detector.cc.o
[ 54%] Building CXX object lib/tests/CMakeFiles/libwhereami_test.dir/detectors/hyperv_detector.cc.o
[ 56%] Building CXX object lib/tests/CMakeFiles/libwhereami_test.dir/detectors/kvm_detector.cc.o
[ 58%] Building CXX object lib/tests/CMakeFiles/libwhereami_test.dir/detectors/ldom_detector.cc.o
[ 60%] Building CXX object lib/tests/CMakeFiles/libwhereami_test.dir/detectors/lpar_detector.cc.o
[ 62%] Building CXX object lib/tests/CMakeFiles/libwhereami_test.dir/detectors/lxc_detector.cc.o
[ 64%] Building CXX object lib/tests/CMakeFiles/libwhereami_test.dir/detectors/nspawn_detector.cc.o
[ 66%] Building CXX object lib/tests/CMakeFiles/libwhereami_test.dir/detectors/virtualbox_detector.cc.o
[ 68%] Building CXX object lib/tests/CMakeFiles/libwhereami_test.dir/detectors/vmware_detector.cc.o
[ 70%] Building CXX object lib/tests/CMakeFiles/libwhereami_test.dir/detectors/wpar_detector.cc.o
[ 72%] Building CXX object lib/tests/CMakeFiles/libwhereami_test.dir/detectors/xen_detector.cc.o
[ 75%] Building CXX object lib/tests/CMakeFiles/libwhereami_test.dir/detectors/zone_detector.cc.o
[ 77%] Building CXX object lib/tests/CMakeFiles/libwhereami_test.dir/fixtures.cc.o
[ 79%] Building CXX object lib/tests/CMakeFiles/libwhereami_test.dir/fixtures/cpuid_fixtures.cc.o
[ 81%] Building CXX object lib/tests/CMakeFiles/libwhereami_test.dir/fixtures/dmi_fixtures.cc.o
[ 83%] Building CXX object lib/tests/CMakeFiles/libwhereami_test.dir/metadata.cc.o
[ 85%] Building CXX object lib/tests/CMakeFiles/libwhereami_test.dir/result.cc.o
[ 87%] Building CXX object lib/tests/CMakeFiles/libwhereami_test.dir/sources/cgroup_source.cc.o
[ 89%] Building CXX object lib/tests/CMakeFiles/libwhereami_test.dir/sources/cpuid_source.cc.o
In file included from /build/libwhereami/src/libwhereami-0.2.2/lib/tests/metadata.cc:1:
/build/libwhereami/src/libwhereami-0.2.2/lib/tests/metadata.cc: In function ‘void ____C_A_T_C_H____T_E_S_T____0()’:
/build/libwhereami/src/libwhereami-0.2.2/lib/tests/metadata.cc:15:61: error: catching polymorphic type ‘class boost::bad_get’ by value [-Werror=catch-value=]
   15 |             REQUIRE_THROWS_AS(data.get<bool>("foo"), boost::bad_get);
      |                                                             ^~~~~~~
/build/libwhereami/src/libwhereami-0.2.2/lib/tests/metadata.cc:27:61: error: catching polymorphic type ‘class boost::bad_get’ by value [-Werror=catch-value=]
   27 |             REQUIRE_THROWS_AS(data.get<bool>("foo"), boost::bad_get);
      |                                                             ^~~~~~~
/build/libwhereami/src/libwhereami-0.2.2/lib/tests/metadata.cc:38:63: error: catching polymorphic type ‘class boost::bad_get’ by value [-Werror=catch-value=]
   38 |             REQUIRE_THROWS_AS(data.get<string>("foo"), boost::bad_get);
      |                                                               ^~~~~~~
/build/libwhereami/src/libwhereami-0.2.2/lib/tests/metadata.cc:49:61: error: catching polymorphic type ‘class boost::bad_get’ by value [-Werror=catch-value=]
   49 |             REQUIRE_THROWS_AS(data.get<bool>("foo"), boost::bad_get);
      |                                                             ^~~~~~~
[ 91%] Building CXX object lib/tests/CMakeFiles/libwhereami_test.dir/sources/dmi_source.cc.o
[ 93%] Building CXX object lib/tests/CMakeFiles/libwhereami_test.dir/sources/lparstat_source.cc.o
cc1plus: all warnings being treated as errors
make[3]: *** [lib/tests/CMakeFiles/libwhereami_test.dir/build.make:284: lib/tests/CMakeFiles/libwhereami_test.dir/metadata.cc.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [CMakeFiles/Makefile2:229: lib/tests/CMakeFiles/libwhereami_test.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:236: lib/tests/CMakeFiles/libwhereami_test.dir/rule] Error 2
make: *** [Makefile:227: libwhereami_test] Error 2

Can you please have a look and give me some advice? Let me know if you need more debug output or anything else.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Mihai Buzgau (JIRA)

unread,
Jul 30, 2019, 9:40:04 AM7/30/19
to puppe...@googlegroups.com

Mihai Buzgau (JIRA)

unread,
Jul 30, 2019, 9:40:04 AM7/30/19
to puppe...@googlegroups.com

Mihai Buzgau (JIRA)

unread,
Aug 7, 2019, 5:32:02 AM8/7/19
to puppe...@googlegroups.com

Mihai Buzgau (JIRA)

unread,
Aug 7, 2019, 5:32:03 AM8/7/19
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Sprint: PR NW - Triage 2019-08-21

Gabriel Nagy (JIRA)

unread,
Aug 7, 2019, 5:58:03 AM8/7/19
to puppe...@googlegroups.com

Gabriel Nagy (JIRA)

unread,
Aug 7, 2019, 6:07:02 AM8/7/19
to puppe...@googlegroups.com
Gabriel Nagy commented on Bug FACT-1967
 
Re: Unable to compile libwhereami 0.2.2 on latest Archlinux

Hi Tim Meusel,

Those are just some new warnings that came with GCC 8.0. You can bypass them by passing the ENABLE_CXX_WERROR=OFF parameter to CMake, like this:

cmake .. -DENABLE_CXX_WERROR=OFF.

I'll fix the warnings in libwhereami, but in the meantime you can get it compiled by using that parameter.

Tim Meusel (JIRA)

unread,
Aug 7, 2019, 8:21:03 AM8/7/19
to puppe...@googlegroups.com
Tim Meusel commented on Bug FACT-1967

Hi. Thanks for the hint. I'm now using those commands (base directory is the extracted release from github.com):

mkdir build-release
cd build-release
cmake .. -DENABLE_CXX_WERROR=OFF -DCMAKE_INSTALL_PREFIX:PATH=/usr
make libwhereami_test
make
make install

This looks good in a clean container environment. This is used as a base to create a package for Archlinux

Tim Meusel (JIRA)

unread,
Aug 9, 2019, 10:39:03 AM8/9/19
to puppe...@googlegroups.com
Tim Meusel commented on Bug FACT-1967

I actually discovered something which needs clarification. The lib is built static. This is a bit problematic because it's hard to determine which runtime dependencies exist and a security update for a dependency forces us to recompile libwhereami. On Archlinux, we modified the built config to link it dynamically:

sed 's|add_library(lib${PROJECT_NAME}|add_library(lib${PROJECT_NAME} SHARED|' -i lib/CMakeLists.txt

Is libwhereami static on purpose? Otherwise I could provide a PR to link it dynamically.

Gabriel Nagy (JIRA)

unread,
Aug 9, 2019, 10:49:04 AM8/9/19
to puppe...@googlegroups.com
Gabriel Nagy commented on Bug FACT-1967

> Is libwhereami static on purpose?

I'm not sure about that... Michael Smith, do you have any idea?

Michael Smith (JIRA)

unread,
Aug 9, 2019, 12:31:03 PM8/9/19
to puppe...@googlegroups.com

I don't know, Casey Williams or Branan Riley would have historical context.

It can easily be switched to a dynamic library with the CMake -DBUILD_SHARED_LIBS=ON flag.

Branan Riley (JIRA)

unread,
Aug 9, 2019, 12:44:03 PM8/9/19
to puppe...@googlegroups.com
Branan Riley commented on Bug FACT-1967

It's static so that it gets inlined into facter.so, since that's its only consumer. There's no reason not to build it shared, especially if you're packaging it for a distro

Mihai Buzgau (JIRA)

unread,
Aug 21, 2019, 5:17:09 AM8/21/19
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Sprint: NW - 2019-08-21 , NW - 2019-09-03
Reply all
Reply to author
Forward
0 new messages