Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MDEV-23538: Rename mariadb.pc to mariadb-embedded-server.pc to avoid confusion #1800

Open
wants to merge 1 commit into
base: 11.4
Choose a base branch
from

Conversation

ottok
Copy link
Contributor

@ottok ottok commented Apr 4, 2021

https://jira.mariadb.org/browse/MDEV-23538

Change so that the client library config can be accessed using the name
libmariadb.pc or mariadb.pc. Rename old mariadb.pc to mariadbd.pc to better
indicate that the config is for the daemon build, not client.

In downstream Debian we already ship the libmariadb.pc as mariadb.pc:
https://salsa.debian.org/mariadb-team/mariadb-10.5/-/commit/2f183af990fbe1cfa8c343998c7640f45f45368b

@ottok ottok requested review from grooverdan and 9EOR9 April 4, 2021 17:23
@cvicentiu
Copy link
Member

Hi @ottok !

Is this still WIP, or ready for review?

@cvicentiu cvicentiu self-assigned this Jun 18, 2021
@ottok
Copy link
Contributor Author

ottok commented Jun 19, 2021

Thanks for taking a look! Serg suggested removing the libmariadb symlink in https://jira.mariadb.org/browse/MDEV-23538. The PR is technically done, we just need to get a technical decision on the naming, see Jira.

My suggestion is this PR.

@ottok
Copy link
Contributor Author

ottok commented Jun 19, 2021

And yeah, the debian/rules would be better done in CMake. I can close this PR if you want to take a shot at putting the files with correct names in correct places directly in CMake code.

@illuusio
Copy link
Contributor

illuusio commented Mar 3, 2022

And yeah, the debian/rules would be better done in CMake. I can close this PR if you want to take a shot at putting the files with correct names in correct places directly in CMake code.

This should be done in CMakeFiles so it would be benefiting RPM also.

@ottok
Copy link
Contributor Author

ottok commented Mar 21, 2022

@illuusio If you make a CMake level implementation and post the PR url here, I will close this PR in favor of yours.

@ottok ottok changed the base branch from 10.6 to 10.9 May 5, 2022 04:47
@ottok ottok force-pushed the ok-10.6-mariadbd-pc branch 2 times, most recently from 692bb20 to b18f981 Compare May 5, 2022 05:13
@ottok
Copy link
Contributor Author

ottok commented May 5, 2022

@illuusio If you make a CMake level implementation and post the PR url here, I will close this PR in favor of yours.

Ideally this would be fixed on the CMake level. Never the less, I also now rebased this on latest 10.9.

Also, due to @vuvova comment in https://jira.mariadb.org/browse/MDEV-23538 I changed the new name from mariadbd.pc to libmariadbd.pc.

@ottok ottok changed the title WIP: MDEV-23538: Rename mariadb.pc to mariadbd.pc to avoid confusion MDEV-23538: Rename mariadb.pc to libmariadbd.pc to avoid confusion May 5, 2022
@ottok ottok changed the base branch from 10.9 to 11.0 March 18, 2023 22:55
@ottok ottok force-pushed the ok-10.6-mariadbd-pc branch 2 times, most recently from 624e256 to cdf6b32 Compare March 19, 2023 03:15
@ottok
Copy link
Contributor Author

ottok commented Mar 19, 2023

Rebased on 11.0 now. It was already fine to merge in 10.9, hopefully it will get merged now.

@ottok ottok requested a review from vuvova March 19, 2023 07:42
@illuusio
Copy link
Contributor

There is problem that most of the code does not compile on Debian withouth patching and compiles on other distros fine or am I missing something?

@ottok
Copy link
Contributor Author

ottok commented Mar 24, 2023

There is problem that most of the code does not compile on Debian withouth patching and compiles on other distros fine or am I missing something?

CI currently failing on test innodb_zip.cmp_drop_table and build error on columnstore.dir/ha_mcs_dml.cpp.o] Error 1. I do not see how they can be caused by the changes in this PR - seems more likely that the CI on branch 11.0 is unstable.

@ottok ottok force-pushed the ok-10.6-mariadbd-pc branch 2 times, most recently from b5895ab to 42093ed Compare April 2, 2023 04:06
Copy link
Member

@vuvova vuvova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ottok, I don't understand. You rename support-files/mariadb.pc to be installed as libmariadbd.pc ?
But its content is

$ grep Libs support-files/mariadb.pc
Libs: -L${libdir} -lmariadb -ldl -lm -lssl -lcrypto -lz

it's for a client library, not for embedded server. It might make sense to remove it completely. But to install it as libmariadbd.pc looks totally wrong to me.

@ottok
Copy link
Contributor Author

ottok commented Apr 2, 2023

@vuvova There is https://github.com/mariadb-corporation/mariadb-connector-c/blob/3.3/mariadb_config/libmariadb.pc.in for the client, and this file is being built and shipped as libmariadb.pc. There is also this server file you referenced that comes from https://github.com/MariaDB/server/blob/11.1/support-files/mariadb.pc.in. MariaDB should not have two *mariadb.pc. The other one should be '*mariadbd.pc`, or if you think nobody ever used it for building the embedded server then the solution would be just to delete the file as a duplicate?

For additional context, the contents of the files:

$ find /usr/lib/*/pkgconfig/m*.pc -ls
/usr/lib/x86_64-linux-gnu/pkgconfig/mariadb.pc
/usr/lib/x86_64-linux-gnu/pkgconfig/mysqlclient.pc -> mariadb.pc

$ cat /usr/lib/x86_64-linux-gnu/pkgconfig/mariadb.pc
# these four variables are present in almost every .pc file
prefix=/usr
exec_prefix=${prefix}
libdir=${prefix}/lib/x86_64-linux-gnu
includedir=${prefix}/include/mariadb
# its common to want to know where to install it.
plugindir=${prefix}/lib/x86_64-linux-gnu/mariadb19/plugin
# Below are rarely present or not at all, but we export them regardless
bindir=${prefix}/bin
sbindir=${prefix}/sbin
scriptdir=${prefix}/bin
docdir=${prefix}/share/doc
mandir=${prefix}/share/man
sharedir=${prefix}/share
mysqlsharedir=${prefix}/share/mysql
mysqltestdir=${prefix}/share/mysql/mysql-test
socket=/var/run/mysqld/mysqld.sock

Name: MariaDB
Description: MariaDB: a very fast and robust SQL database server
URL: http:https://mariadb.org
Version: 10.3.38
Libs: -L${libdir} -lmariadb -pthread -ldl -lm -lpthread -lgnutls -lz
Cflags: -I${includedir} 
$ find /usr/lib/*/pkgconfig/libm*.pc -ls
/usr/lib/x86_64-linux-gnu/pkgconfig/libmariadb.pc

$ cat /usr/lib/x86_64-linux-gnu/pkgconfig/libmariadb.pc
# 
#  pkg_config.pc.in
#
#  pkg_config configuration file 
#  For a detailed description of options, please visit
#  Dan Nicholson’s Guide to pkg-config (http:https://www.freedesktop.org/wiki/Software/pkg-config/)
#

prefix=/usr
includedir=${prefix}/include/mariadb/
libdir=${prefix}/lib/x86_64-linux-gnu/

Name: libmariadb
Version: 3.1.18
Description: MariaDB Connector/C dynamic library
Cflags: -I${includedir}
Libs: -L${libdir} -lmariadb
Libs.private: -ldl -lm -lpthread -lgnutls

Copy link
Contributor

@LinuxJedi LinuxJedi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a quick scan of other pkgconfig files installed in distros and came to a similar conclusion to Sergei in the Jira ticket.

If this is to be renamed I recommend using mariadbd.pc or something more verbose such as mariadb-embedded-server.pc. Very likely (at least initially) a symlink would be needed too, so that compatibility isn't broken. This is probably something to be discussed in the Jira ticket though.

@ottok ottok changed the title MDEV-23538: Rename mariadb.pc to libmariadbd.pc to avoid confusion MDEV-23538: Rename mariadb.pc to mariadb-embedded-server.pc to avoid confusion Jun 3, 2023
@ottok ottok changed the base branch from 11.0 to 11.2 June 3, 2023 22:58
@ottok
Copy link
Contributor Author

ottok commented Jun 4, 2023

Rebased on latest 11.2 and also changed to use name mariadb-embedded-server.pc.

@LinuxJedi
Copy link
Contributor

I think this looks OK now, but I defer to @vuvova's opinion here.

@ottok ottok changed the base branch from 11.2 to 11.3 September 15, 2023 05:00
@ottok ottok force-pushed the ok-10.6-mariadbd-pc branch 2 times, most recently from a9b8bed to 619f94d Compare September 15, 2023 05:03
@ottok
Copy link
Contributor Author

ottok commented Sep 16, 2023

Rebased on latest 11.3 but CI seems to fail on tests main.analyze_stmt_slow_query_log and perfschema.events_waits_current_MDEV-29091. I have not checked if these tests were already broken before the changes. Most of the commits on https://github.com/MariaDB/server/commits/11.3 are currently not passing CI (I see a lot of red crosses attached to them).

Copy link
Member

@vuvova vuvova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To my inexperienced eye it looks fine. I'm slightly concerned that out of 671 *.pc files on my laptop, not a single one is a symlink to a name with (or without) lib prefix, so this is really unconventional.

Still, there are three symlinks there:

$ find  /usr/share/pkgconfig/ /usr/lib/pkgconfig/ /usr/lib64/pkgconfig/ -type l -ls
8673227  0 lrwxrwxrwx  1 root  root  12 May  4 16:49 /usr/lib64/pkgconfig/libcrypt.pc -> libxcrypt.pc
8671475  0 lrwxrwxrwx  1 root  root  11 Sep  2 15:19 /usr/lib64/pkgconfig/babl.pc -> babl-0.1.pc
8791259  0 lrwxrwxrwx  1 root  root  11 Sep  2 15:00 /usr/lib64/pkgconfig/libpng.pc -> libpng16.pc

so at least it's possible and pkg-config won't crash on that.

@ottok
Copy link
Contributor Author

ottok commented Oct 8, 2023

Rebased on latest 11.3.

@LinuxJedi LinuxJedi changed the base branch from 11.3 to 11.4 February 13, 2024 15:40
Copy link
Contributor

@LinuxJedi LinuxJedi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ottok I don't appear to have permissions to rebase this for some reason, and there is a minor typo, if you could fix it, we should be good to go.

debian/rules Outdated Show resolved Hide resolved
@ottok ottok force-pushed the ok-10.6-mariadbd-pc branch 2 times, most recently from 08e361e to f893be5 Compare May 5, 2024 03:51
…confusion

Change so that the client library config can be accessed using the name
mariadb.pc (or libmariadb.pc).

Rename old mariadb.pc to mariadb-embedded-server.pc to better indicate
that the config is for the daemon build, not client.

Also keep/include names with 'lib' as symlinks, as it aligns with how most
of *.pc files are named in general.

In downstream Debian we already ship the libmariadb.pc as mariadb.pc:
https://salsa.debian.org/mariadb-team/mariadb-10.5/-/commit/2f183af990fbe1cfa8c343998c7640f45f45368b

After this change we would have for the files:
- mariadb.pc for client (with libmariadb.pc as symlink)
- mariadb-embedded-sever.pc for server (with libmariadbd.pc as symlink)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants