You are not logged in.

#1 2019-10-07 21:35:24

riccardooo97
Member
Registered: 2019-08-26
Posts: 7

Anbox installation fail..

Hi. When I try to install the anbox-git aur package I get this error message.
What could I try to do?

...

[ 94%] Building CXX object src/CMakeFiles/anbox-core.dir/anbox/wm/window.cpp.o
[ 94%] Building CXX object src/CMakeFiles/anbox-core.dir/anbox/wm/window_state.cpp.o
[ 95%] Building CXX object src/CMakeFiles/anbox-core.dir/anbox/cli.cpp.o
[ 95%] Building CXX object src/CMakeFiles/anbox-core.dir/anbox/daemon.cpp.o
[ 96%] Building CXX object src/CMakeFiles/anbox-core.dir/anbox/logger.cpp.o
/home/riccardo/.cache/yay/anbox-git/src/anbox/src/anbox/logger.cpp:20: error: "BOOST_LOG_DYN_LINK" redefined [-Werror]
   20 | #define BOOST_LOG_DYN_LINK
      |
<command-line>: note: this is the location of the previous definition
cc1plus: all warnings being treated as errors
make[2]: *** [src/CMakeFiles/anbox-core.dir/build.make:1493: src/CMakeFiles/anbox-core.dir/anbox/logger.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1722: src/CMakeFiles/anbox-core.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...
Error making: anbox-git (anbox-modules-dkms-git)

Last edited by riccardooo97 (2019-10-07 21:35:43)

Offline

#2 2019-10-07 21:44:53

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 9,055
Website

Re: Anbox installation fail..

Mod note: moving to AUR Issues


Sakura:-
Mobo: MSI X299 TOMAHAWK ARCTIC // Processor: Intel Core i7-7820X 3.6GHz // GFX: nVidia GeForce GTX 970 // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 5x 1TB HDD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#3 2019-10-07 23:35:02

loqs
Member
Registered: 2014-03-06
Posts: 8,734

Re: Anbox installation fail..

if you add --trace to the cmake invocation you find

/usr/lib64/cmake/boost_log-1.71.0/libboost_log-variant-shared.cmake(75):  set_target_properties(Boost::log PROPERTIES INTERFACE_COMPILE_DEFINITIONS BOOST_LOG_DYN_LINK )

which causes

/home/riccardo/.cache/yay/anbox-git/src/anbox/src/anbox/logger.cpp:20: error: "BOOST_LOG_DYN_LINK" redefined [-Werror]
   20 | #define BOOST_LOG_DYN_LINK
      |
<command-line>: note: this is the location of the previous definition
cc1plus: all warnings being treated as errors

As anbox/src/anbox/logger.cpp does not check if the symbol is already defined before defining it and all warnings are treated as errors due to CMakeLists.txt containing

if ("${cmake_build_type_lower}" STREQUAL "release" OR "${cmake_build_type_lower}" STREQUAL "relwithdebinfo")
  option(Werror "Treat warnings as errors" ON)
else()
  option(Werror "Treat warnings as errors" OFF)
endif()

and the PKGBUILD setting -DCMAKE_BUILD_TYPE=Release

Online

#4 2019-10-08 04:45:29

riccardooo97
Member
Registered: 2019-08-26
Posts: 7

Re: Anbox installation fail..

So what exactly should I do?

Offline

#5 2019-10-08 08:51:24

loqs
Member
Registered: 2014-03-06
Posts: 8,734

Re: Anbox installation fail..

diff --git a/src/anbox/logger.cpp b/src/anbox/logger.cpp
index 93b7e10..a5397fe 100644
--- a/src/anbox/logger.cpp
+++ b/src/anbox/logger.cpp
@@ -17,7 +17,9 @@
 
 #include <thread>
 
+#ifndef BOOST_LOG_DYN_LINK
 #define BOOST_LOG_DYN_LINK
+#endif
 #include <boost/date_time.hpp>
 #include <boost/filesystem.hpp>
 #include <boost/log/expressions.hpp>

Apply the above patch to the PKGBUILD and report the issue to the upstream developers.

Online

#6 2019-10-08 12:40:19

riccardooo97
Member
Registered: 2019-08-26
Posts: 7

Re: Anbox installation fail..

Even if I modify that file, when I launch "makepkg -s" again, it come back to the original version and give the same error

Offline

#7 2019-10-08 12:46:28

a821
Member
From: My Location
Registered: 2012-10-31
Posts: 133

Re: Anbox installation fail..

You need to modify the PKGBUILD so the file is patched in `prepare`. If you cannot do that, run makepkg(8) with `--noextract` after you patch the file manually (assuming the sources are still in $srcdir)

Offline

Board footer

Powered by FluxBB