[ODBC-311] Connector/ODBC libraries go to the wrong directories and it breaks packaging Created: 2021-04-18  Updated: 2021-06-11  Resolved: 2021-06-11

Status: Closed
Project: MariaDB Connector/ODBC
Component/s: General
Affects Version/s: None
Fix Version/s: 3.1.14

Type: Bug Priority: Critical
Reporter: Timofey Turenko Assignee: Alexey Bychko (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Attachments: HTML File stdio_cpp     HTML File stdio_odbc    
Issue Links:
Blocks

 Description   

The connector/C build process does not take into account the difference in the directory structure for RPM and DEB-based distributions.
It breaks Debian packaging of Cpp and ODBCI connectors (see attached files for full logs):

dpkg-shlibdeps: error: cannot find library libmariadb.so.3 needed by ./usr/lib64/mariadb/libmariadbcpp.so (ELF format: 'elf64-x86-64' abi: '0201003e00000000'; RPATH: '')
dpkg-shlibdeps: error: cannot continue due to the error above
Note: libraries are not searched in other binary packages that do not have any shlibs or symbols file.
To help dpkg-shlibdeps find private libraries, you might need to use -l.
CMake Error at /usr/share/cmake-3.16/Modules/Internal/CPack/CPackDeb.cmake:317 (message):
  CPackDeb: dpkg-shlibdeps: 'dpkg-shlibdeps: error: cannot find library
  libmariadb.so.3 needed by ./usr/lib64/mariadb/libmariadbcpp.so (ELF format:
  'elf64-x86-64' abi: '0201003e00000000'; RPATH: '')
  dpkg-shlibdeps: error: cannot continue due to the error above

dpkg-shlibdeps tries to find libmariadb.so.3 in the default directory for Debians - /usr/lib/x86_64-linux-gnu/

Dirs are hardcoded here:
https://github.com/mariadb-corporation/mariadb-connector-c/blob/3.1/cmake/install.cmake#L78



 Comments   
Comment by Alexey Bychko (Inactive) [ 2021-04-19 ]

./_CPack_Packages/Linux/DEB/mariadb-connector-odbc-3.1.12-linux-x86_64/shared/usr/lib64/mariadb/libmariadb.so.3
./_CPack_Packages/Linux/DEB/mariadb-connector-odbc-3.1.12-linux-x86_64/shared/usr/lib64/mariadb/libmariadb.so

Comment by Alexey Bychko (Inactive) [ 2021-04-19 ]

fixed in https://github.com/abychko/mariadb-connector-odbc/commit/6dd5056aafb97eed95a682de829da9ebcd4ec9af

Comment by Alexey Bychko (Inactive) [ 2021-04-19 ]

PR created https://github.com/mariadb-corporation/mariadb-connector-odbc/pull/44

Comment by Alexey Bychko (Inactive) [ 2021-04-20 ]

Travis is OK for PR, AppVeyor failed with

  Building Custom Rule C:/maodbc/CMakeLists.txt
appveyor-download.bat
appveyor-download.bat' is not recognized as an internal or external command,
operable program or batch file.
Command exited with code 1

seems it fails for long time already

Comment by Alexey Bychko (Inactive) [ 2021-04-20 ]

install layout is OK now for DEFAULT, RPM, DEB. but we need to check the changes

Comment by Alexey Bychko (Inactive) [ 2021-05-13 ]

started reworking it. CMAKE_LIBRARY_ARCHITECTURE is empty on Gentoo, do we really need to build packages on it?

seems there is no reason to add existing multiarch tuples to cmake file - the list is huge https://wiki.debian.org/Multiarch/Tuples
serg otto ^^^^

Comment by Alexey Bychko (Inactive) [ 2021-05-13 ]

serg could you please take a look at https://github.com/mariadb-corporation/mariadb-connector-odbc/pull/46?

Comment by Alexey Bychko (Inactive) [ 2021-05-14 ]

updated my latest PR and left comments

Comment by Otto Kekäläinen [ 2021-05-14 ]

seems there is no reason to add existing multiarch tuples to cmake file - the list is huge https://wiki.debian.org/Multiarch/Tuples
Sergei Golubchik Otto Kekäläinen ^^^^

As said, this is already packaged in Debian. See sources at https://salsa.debian.org/mariadb-team/mariadb-connector-odbc/-/tree/master/debian

Bernhard has done a good job, the package is fully Lintian clean (https://salsa.debian.org/mariadb-team/mariadb-connector-odbc/-/pipelines/254388) and almost passes all QA systems on Debian (https://tracker.debian.org/pkg/mariadb-connector-odbc).

Just package it in the same way and you will be fine. If you need consultation, reach out to Bernhard who did the packaging for Debian.

cannot find library libmariadb.so.3

The original issue in this MDEV can easily be solved on Debian with simply running `apt install libmariadb` before the build. The ODBC connector depends on the MariaDB Client. It is enough to build it using the libmariadb-dev package, you don't need the full sources.

Comment by Alexey Bychko (Inactive) [ 2021-05-14 ]

otto this ticket is not about packaging. packaging one is TODO-2311.
I can add debian directory for project, it's not a problem since cpack deb creation is still not implemented properly

Comment by Otto Kekäläinen [ 2021-05-14 ]

Seems to me this issue is related to what has already been solved in
https://salsa.debian.org/mariadb-team/mariadb-connector-odbc/-/blob/master/debian/rules

Please read "prior art" to avoid duplicate work.

Comment by Otto Kekäläinen [ 2021-05-14 ]

The point is not about copying the debian directory. The point is
about you reading and studying existing work to avoid wasting time
on figuring out something that has already been solved.

You can do the packaging in CPack if you want, there can be some
benefits in having both RPM and DEB generated via CMake.

Comment by Alexey Bychko (Inactive) [ 2021-05-17 ]

serg PR was fixed one more time according to comments

Comment by Sergei Golubchik [ 2021-05-21 ]

b99c520df0704a1ed4630582eba0c2d371875822 looks good as far as path are concerned. One comment there.

Comment by Lawrin Novitsky [ 2021-06-11 ]

The related PR has been merged

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