[MXS-128] cyclic dependency utils -> log_manager -> utils Created: 2015-05-09  Updated: 2015-05-13  Resolved: 2015-05-09

Status: Closed
Project: MariaDB MaxScale
Component/s: None
Affects Version/s: None
Fix Version/s: 1.2.0

Type: Bug Priority: Major
Reporter: Yuval Hager Assignee: markus makela
Resolution: Fixed Votes: 0
Labels: None


 Description   

$ cmake -DEMBEDDED_LIB=/usr/local/mysql/lib/ -DERRMSG=/usr/local/mysql/share/english/errmsg.sys -DWITH_SCRIPTS=false -DMYSQL_DIR=/usr/local/mysql/include -DSTATIC_EMBEDDED=false ..
-- CMake version: 3.2.2
-- Using MySQL headers found at: /usr/local/mysql/include/mysql
-- Using custom errmsg.sys found at: /usr/local/mysql/share/english/errmsg.sys
-- Valgrind found: /usr/bin/valgrind
-- Found dynamic MySQL client library: /usr/lib64/libmysqlclient.so
-- Static MySQL client library not found.
-- Found mysql_version.h: /usr/local/mysql/include/mysql/mysql_version.h
-- MySQL version: 10.0.17
-- MySQL provider: MariaDB
-- PCRE libs: /usr/lib64/libpcre.so
-- PCRE include directory: /usr/include
-- Embedded mysqld does not have pcre_stack_guard, linking with system pcre.
-- Using embedded library: /usr/local/mysql/lib/libmysqld.so
-- Pandoc not found.
-- Found libtcmalloc: /usr/lib64/libtcmalloc.so
-- Found libjemalloc: /usr/lib64/libjemalloc.so
-- C Compiler supports: -Werror=format-security
-- C Compiler supports: -Wno-unused-but-set-variable
-- Building MaxAdmin with editline: /usr/lib64/libedit.so
-- Installing MaxScale to: /usr/local/mariadb-maxscale/
-- Configuring done
CMake Error: The inter-target dependency graph contains the following strongly connected component (cycle):
  "utils" of type STATIC_LIBRARY
    depends on "log_manager" (weak)
    depends on "log_manager" (strong)
  "log_manager" of type SHARED_LIBRARY
    depends on "utils" (weak)
At least one of these targets is not a STATIC_LIBRARY.  Cyclic dependencies are allowed only among static libraries.



 Comments   
Comment by Yuval Hager [ 2015-05-09 ]

I fixed this locally by adding a static library called logmanager, and making utils depend on it instead of the shared one, but I'm not sure if this is the correct fix.

diff --git a/log_manager/CMakeLists.txt b/log_manager/CMakeLists.txt
index 3a2aad5..102da45 100644
--- a/log_manager/CMakeLists.txt
+++ b/log_manager/CMakeLists.txt
@@ -3,6 +3,8 @@ if(LOG_DEBUG)
 endif()
 add_library(log_manager SHARED log_manager.cc)
 target_link_libraries(log_manager pthread aio stdc++ utils)
+add_library(logmanager STATIC log_manager.cc)
+target_link_libraries(logmanager pthread aio stdc++ utils)
 install(TARGETS log_manager DESTINATION lib)
 if(BUILD_TESTS)
   add_subdirectory(test)
diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt
index 32e6802..f6ba9f3 100644
--- a/utils/CMakeLists.txt
+++ b/utils/CMakeLists.txt
@@ -1,3 +1,3 @@
 add_library(utils skygw_utils.cc)
-add_dependencies(utils log_manager)
-target_link_libraries(utils stdc++ log_manager)
+add_dependencies(utils logmanager)
+target_link_libraries(utils stdc++ logmanager)

Comment by markus makela [ 2015-05-09 ]

Removed utils dependency on log_manager as this was not needed.

Comment by Timofey Turenko [ 2015-05-13 ]

build is ok now for all distors. closing.

Generated at Thu Feb 08 03:56:59 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.