[MDEV-13836] mariadb_config & mysql_config output differ Created: 2017-09-18 Updated: 2020-05-11 Resolved: 2017-10-29 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Server |
| Affects Version/s: | 10.2.8 |
| Fix Version/s: | 10.2.10 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Michal Schorm | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Fedora - all |
||
| Sprint: | 10.2.10 |
| Description |
|
Hello, My goal is to build mariadb-server without C-library part and build CONC/C, which has all the same files. Because, mariadb_config is in both - server and CONC/C - I left it only in CONC/C package. However, the "mysql_config" present in mariadb-server has different output than "mariadb_config".
— Now:
I guess, you meant to use mariadb_config for client stuff and mysql_config for server stuff. But that doesn't work at all, because all project out there look directly for "mysql_config" and the patches are often non-trivial. |
| Comments |
| Comment by Elena Stepanova [ 2017-09-18 ] | |||||||||||||||||||||||||||||||||||||
|
There were fixes in 10.2.7/10.2.8, but apparently partial ones, concerning libraries: serg, I don't see if anything has been done about socket, port etc – has it? | |||||||||||||||||||||||||||||||||||||
| Comment by Georg Richter [ 2017-10-05 ] | |||||||||||||||||||||||||||||||||||||
|
Please use the following cmake parameters for Connector/C
| |||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2017-10-05 ] | |||||||||||||||||||||||||||||||||||||
|
The server has (used to have for ages) some magic around the port number. If it's 0, the default port value will use getservbyname("mysql", "tcp"), that is, whatever is written in /etc/services. If it's a positive number, say, 3306, it will be 3306, no matter what /etc/services say. I don't know if that behavior makes much sense, /etc/services wasn't supposed to be a system configuration file. | |||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2017-10-05 ] | |||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||
| Comment by Michal Schorm [ 2017-10-05 ] | |||||||||||||||||||||||||||||||||||||
|
See it my way: I have many projects in Fedora using mysql. Historically, they all were using MariaDB under the hood.
I also made a change in Fedora, where I dropped client library part from 'mariadb' package and started to provide it by 'mariadb-connector-c' package. Which lead me to face different challenges:
I'm looking for a "mysql_config" in CONC/C, that could be used for server building too. ---------------------- I know, that may not be easy. | |||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2017-10-05 ] | |||||||||||||||||||||||||||||||||||||
|
Yes, I understand. And — make no mistake — we totally want MariaDB to be as easy to use and create as little problems for distributions as possible. But what does it mean in a context of this bug report? Support -DMYSQL_UNIX_ADDR=xxx ? I think we can do that easily. Implement magic port=0 behavior as in the server? Doable too. Server headers — I don't like the current situation and I'd be happy to change it, just don't know how. libmysqld? I don't think C/C can do anything about it, but given that MySQL removed embedded library completely, --libmysqld-libs cannot be a compatibility issue, can it? | |||||||||||||||||||||||||||||||||||||
| Comment by Michal Schorm [ 2017-10-05 ] | |||||||||||||||||||||||||||||||||||||
|
This bug report is meant to handle only the 'mariadb_config' binary. As I told, I'm tricked into delivering the binary 'mariadb_config' from CONC/C, while hiding behind symlink 'mysql_config'. (I can't ship the 'mysql_config' from server, since there is already so called symlink) The issue is - I believe - that because of different output of 'mariadb_config' in CONC/C and 'mysql_config' in server, there can rise issues, when someone would like to build with server. In simple words - ideally, to 'mariadb_config' from CONC/C to cover all parts, including server and embedded server. — I see following simple solutions: — Unfortunatelly, I don't know, which options are commonly used by other projects ... some are, some are not. However, all the information should be available at one place. That's what I'm looking for. To learn developers use such a config binary properly ... is second thing. | |||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2017-10-08 ] | |||||||||||||||||||||||||||||||||||||
|
What about this approach: https://github.com/MariaDB/server/commit/8fbb50861291f It'll guarantee that mysql_config always returns same values as mariadb_config This assumes you don't symlink mariadb_config to mysql_config, but keep both side by side. mariadb_config will return client (libmariadb) config, while mysql_config will return both client config and embedded server (libmysqld) config. | |||||||||||||||||||||||||||||||||||||
| Comment by Michal Schorm [ 2017-10-08 ] | |||||||||||||||||||||||||||||||||||||
|
In general, this is a good idea, how to solve it. However, it won't help me. — 1) 2) — So I would need 1) OR 2) | |||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2017-10-09 ] | |||||||||||||||||||||||||||||||||||||
|
1) but that wouldn't work, because you symlink mariadb_config to mysql_config? so it'll just be calling itself in a infinite loop. but anyway, the problem both with 1) and 2) is that Connector/C is a separate project, a client library, and you build it without the server. It cannot possibly know anything about the server or even if the server exists at all, much less about how it was configured and built. When Connector/C is built from inside the server we have some pass-through's to let C/C see server configuration. But it cannot work when C/C is configured outside of the server. I can, perhaps, make C/C to install a compatibility symlink mariadb_config->mysql_config. But it won't help you, because it won't have libmysqld-libs option. And it cannot, because only server knows how it was configured. I'd think the easiest (long-term) approach for you would be to use mariadb-shared packages as compiled from mariadb server source tarball. as a bonus you'll get regular connector/c bugfixes with every server release. But if you cannot do that anymore, you could remove the symlink and install the small mysql_config shell script instead. Something like that
| |||||||||||||||||||||||||||||||||||||
| Comment by Michal Schorm [ 2017-10-11 ] | |||||||||||||||||||||||||||||||||||||
|
OK, back to base issue. 'mysql_config' and 'mariadb_config' output differ. Port number:
Include dir: (clfags etc.)
Libraries:
Plugins:
Socket:
— 1) How to set all this up? 2) Can you make this consistent between server & CONC/C? (returning the same values, when set up the same)
— That could solve it whole, right? | |||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2017-10-11 ] | |||||||||||||||||||||||||||||||||||||
how to set this up. Server: -DRPM=yes (this should set all paths in "rpm-style") This worked in my tests | |||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2017-10-12 ] | |||||||||||||||||||||||||||||||||||||
|
georg could you please review this commit: https://github.com/MariaDB/mariadb-connector-c/commit/7cfe708e282ca1ef4f7e26f240422f7c3761a26f wlad could you please review these two commits: https://github.com/MariaDB/server/commit/5cbbed6e859477a27d4da3cfd8fcb5c335d6b854 and https://github.com/MariaDB/server/commit/c2a3613162d9ce4af74b15507c212f63e1d05fa6 | |||||||||||||||||||||||||||||||||||||
| Comment by Michal Schorm [ 2017-10-12 ] | |||||||||||||||||||||||||||||||||||||
|
I need to use some Fedora RPM build macros. In latest version with the cmake options you wrote, it looks like this:
That moves everything to correct destination. However it returns those 2 options obviously wrong:
The include directory tree:
— In this comment I talk only about CONC/C and its last release on https://downloads.mariadb.org/. | |||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2017-10-26 ] | |||||||||||||||||||||||||||||||||||||
|
mariadb_config treats INSTALL_INCLUDEDIR as relative to basedir (/usr). I'd agree that it should support absolute paths too, but we probably won't be able to fix it in time for 10.2.10. Could you specify -DINSTALL_INCLUDEDIR=include/mysql ? | |||||||||||||||||||||||||||||||||||||
| Comment by Michal Schorm [ 2017-10-26 ] | |||||||||||||||||||||||||||||||||||||
|
The option to specify absolute path would be highly welcomed. I'm currently investigating another issue (this time only on Fedora side) where I hit this "-I/usr//usr/include/mysql/mysql" hard, so I actually patched it for my purposes (but most likely it cannot be used for everyone):
While having following CMAKE options:
The " -DCMAKE_INSTALL_PREFIX", if used, breaks other stuff for me (moving files to wrong locations), so I'm ommiting it. | |||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2017-10-29 ] | |||||||||||||||||||||||||||||||||||||
|
INCLUDE_DIR issue is reported as CONC-291 |