[ODBC-254] FTBFS: Cmake libdir misconfiguration Created: 2019-06-04  Updated: 2019-06-14  Resolved: 2019-06-12

Status: Closed
Project: MariaDB Connector/ODBC
Component/s: General
Affects Version/s: 3.1.1
Fix Version/s: 3.1.2

Type: Bug Priority: Blocker
Reporter: Michal Schorm Assignee: Lawrin Novitsky
Resolution: Fixed Votes: 0
Labels: None
Environment:

Fedora



 Description   

That looks like a clear copy-paste error.

However it leads to FTBFS on Fedora all 64-bit architectures.

Here's the patch:

@@ -0,0 +1,11 @@ 
--- mariadb-connector-odbc-3.1.1-ga-src/CMakeLists.txt	2019-05-02 14:41:44.000000000 +0200
+++ mariadb-connector-odbc-3.1.1-ga-src/CMakeLists.txt_patched	2019-06-04 13:45:49.603601852 +0200
@@ -324,7 +324,7 @@ ELSE()
   IF(NOT DEFINED INSTALL_LIB_SUFFIX)
     SET(INSTALL_LIB_SUFFIX "lib")
     IF("${CMAKE_SIZEOF_VOID_P}" EQUAL "8" AND EXISTS "/usr/lib64/")
-      SET(INSTALL_LIB_SUFFIX "lib")
+      SET(INSTALL_LIB_SUFFIX "lib64")
     ENDIF()
   ENDIF()
 

I use this patch downstream, in Fedora, now: commit



 Comments   
Comment by Lawrin Novitsky [ 2019-06-04 ]

I am afraid that wasn't a copy-paste error, and was done in ODBC-189
I wasn't sure this is the right thing back then, though. But that was kinda the agreement between c/odbc and c/c

Now I will use this your report to re-iterate the problem with C/C maintainer

Comment by Michal Schorm [ 2019-06-05 ]

So, the Idea was to have "libdir" configurable.

I use following CMake arguments in Fedora:

  %cmake -DMARIADB_LINK_DYNAMIC="%{_libdir}/libmariadb.so" \
         -DBUILD_SHARED_LIBS="ON" \
         -DCMAKE_BUILD_TYPE="RelWithDebInfo" \
         -DCMAKE_INSTALL_PREFIX="%{_usr}" \
         -DINCLUDE_INSTALL_DIR="%{_includedir}" \
         -DLIB_INSTALL_DIR="%{_libdir}" \
         -DSHARE_INSTALL_PREFIX="%{_datadir}" \
         -DSYSCONF_INSTALL_DIR="%{_sysconfdir}" \
         .

The problem seems to be the

         -DLIB_INSTALL_DIR="%{_libdir}"

which should be

         -DINSTALL_LIB_SUFFIX="%{_lib}"

So that's an error on my side. Sorry.
Dropping that patch from Fedora now.


However, two question remains:

1) why this "INSTALL_LIB_SUFFIX" option does not show in "cmake -LA" ?
That's where I look when I'm searching for some option.

2) I see the code ill in general now.
"IF something; ELSE the_same_something" is just not right IMHO.
And also
"IF system has 'lib64'; set 'lib' " just doesn't look right to me.

Comment by Lawrin Novitsky [ 2019-06-12 ]

I've made INSTALL_LIB_SUFFIX cache variable, so now it should appear in the cmake -LA output. The "ill" code was left in place to make it easier to return it back.
That I actually have done in the commit. I can't promise it will stay like this, though. I will think about that some more. But for now it's "lib64" again

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