Bug #113112 External dependency ext::zlib leads to -lzlib, but shall lead to -lz
Submitted: 16 Nov 2023 18:50 Modified: 17 Nov 2023 12:30
Reporter: Dilyan Palauzov Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:8.0.35 OS:Linux
Assigned to: CPU Architecture:Any

[16 Nov 2023 18:50] Dilyan Palauzov
Description:
When I run cmake in scripts/CMakeLists.txt, macro EXTRACT_LINK_LIBRARIES, the variable TARGET_LIB_DEPENDS contains “ext::zlib;ext::zstd;/usr/local/lib64/libssl.so;/usr/local/lib64/libcrypto.so;/usr/lib64/libresolv.so;m;/usr/local/lib64/libssl.so;/usr/local/lib64/libcrypto.so”.  In EXTRACT_LINK_LIBRARIES ext::zlib is converted to -lzlib .  The correct dependency is -lz .  Eventually the incorrect dependency appears as  mysqlclient.pc:Libs.private: -lzlib and in mysql_config .

How to repeat:
• When ZLIB is an external dependency, in mysqlclient.pc:Libs.private and mysql_config it shall appear as -lz .  Currently this dependency appears as -lzlib.

Suggested fix:
Manually edit mysqlclient.pc and mysql_config, after cmake has completed, and fix the dependency.
[17 Nov 2023 11:48] MySQL Verification Team
Hi Mr. Palauzov,

Thank you for your bug report.

However, this is a forum for the bugs with the repeatable test cases.

Hence, we need your cmake command with all your options , the errors that you get there and / or errors that you get during the build.

We also do not see what Linux are you using.

We do have a similar bug in Solaris, but we have not received a single report about problems on Linux.

Waiting on your feedback.
[17 Nov 2023 12:11] MySQL Verification Team
Hi Mr. Palauzov,

We have searched and discovered that your bug is a duplicate of the following one:

https://bugs.mysql.com/bug.php?id=112886

That bug will be addressed in one of the next releases.

Duplicate.
[17 Nov 2023 12:30] Dilyan Palauzov
I have no access to https://bugs.mysql.com/bug.php?id=112886 , so I cannot verify that it is indeed a duplicate of this one.  I configure the build process by using CCMAKE .  This is a graphical tool.  I do not know how to submit here all non-default options I set in CCMAKE.

cmake -DWITH_ZLIB=SYSTEM

shall be sufficient to reproduce the problem.

There are no errors during the build or duricng cmake-configuration.  The error is that the produced mysqlclient.pc is defect, as it cannot be used to extract the dependencies.

The used Linux shall be irrelevant here.  You have not received similar reports under Linux most likely because nobody compiles Myslq 8 with system-provided zlib.

For a person understanding how linking, .pc, and cmake function under Linux, the initial problem description contains enough information how to reproduce the error.
[17 Nov 2023 13:00] MySQL Verification Team
Hi Mr. Plauzov,

We are sure that your bug is a duplicate of the bug that we mentioned.

The reporter has set it to "Private", since they did not want that entire public read about their problems.

We are assuring you that steps for the reproduction are the same as in your case, starting with:

cmake -DWITH_ZLIB=SYSTEM

onwards.

Duplicate.
[17 Nov 2023 13:01] MySQL Verification Team
We would also like to add that we do not verify two bug reports with  the same problem and same steps for reproduction.

Also, we shall let you know when the original bug is fixed and in what release.