The bug was updated successfully. The following people were notified: the MySQL developers, the bug reporter, the assigned developer, interested observers, and nobody else.
Bug #107040 Can't build the libmysqlclient C API
Submitted: 15 Apr 2022 17:46 Modified: 20 Jun 2022 1:40
Reporter: Igor Korot Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: C API (client library) Severity:S1 (Critical)
Version:8.x OS:Windows
Assigned to: CPU Architecture:x86

[15 Apr 2022 17:46] Igor Korot
Description:
Hi,

This bug is a descendant of the https://bugs.mysql.com/bug.php?id=107038&thanks=2&notify=3 and https://bugs.mysql.com/bug.php?id=107013.

Unfortunately it looks like people who reply on those 2 bugs do not read the description of them. They see that the problem is with the outdated and unsupported software, then close it without the possibility of re-opening.

However, the bug I'm trying to report is very real and unfortunately prevents people to build the product in question.

Moreover, the page where the documentation should be - https://dev.mysql.com/doc/refman/8.0/en/c-api.html, gives 404 ("Page not found").

So, now to the point.

As explained in the second report, all I'm looking for is to build libmysqlclient C API. You can call it Connector/C (as it is apparently still called here), libmysqlclient C API (a new official name for that) or mySQL client librry written in C, or anything else.

There is no clear and concise documentation anywhere on the Web on how to do just that.

Now, I don't care about building the whole server. I don't want that and I don't need that. All I need is to build and run the client library, just as I build the old version of Connector/C.

But it seems that this is very hard to do because nobody knows how to do that. Even people in mySQL who should.

How to repeat:
Page on the site gives 404 and so there is no instructions on how to build the library.

Page needs to either be restored or clear and consise instruction given on how to build ONLY the client library for mySQL.
[15 Apr 2022 18:00] Igor Korot
Moreover - I understand that the product (Connector/C is outdated and unsupported, But you gave no other choice by selecting it into Category.

And now I'm (and all others) are stuck with it, reporting bugs on the outdated software.

Then - what's the point?
[18 Apr 2022 5:25] Igor Korot
Also this ticket is related: https://bugs.mysql.com/bug.php?id=107041 (proof that luck of documentation produces bad result).

Thank you.
[20 Apr 2022 13:47] Igor Korot
Just curios - how long do you need to investigate a missing page on the documentation web site...
[23 Apr 2022 15:41] Igor Korot
There is also a side effect of me trying to build the library and failing (explanation is in the 2 comments above):

From time to time the mySQL installer is popping up but since there is nothing to install it just dies.

Thank you.
[29 Apr 2022 12:40] MySQL Verification Team
Hello Igor Korot,

Thank you for the bug report and feedback.
Please go through the reference manual available at https://dev.mysql.com/doc/c-api/8.0/en/ 

Regards,
Ashwini Patil
[15 May 2022 1:37] Igor Korot
Mr./Mrs. Ashwini,
> Hello Igor Korot,
>
> Thank you for the bug report and feedback.
> Please go through the reference manual available at https://dev.mysql.com/doc/c-api/8.0/en/ 
> 
> Regards,
> Ashwini Patil

I'm sorry for the delay. For some reason I wasn't notified about your post/

Now in regards to this response - what I'm looking for and what this bug is about is a documentation on how to build this on Windows and OSX myself.

If you look at the documentation of the old version, there is a dedicated page explaining how to build the library on Windows/Linux/OSX.
You point me to the documentation on how to build client code and the library API.

Let me Let me explain it as if you are a baby

I'm looking for a page like http://download.nust.na/pub6/mysql/doc/refman/5.1/en/connector-c-building.html, but for the current version. Please look at this page, try to understand the difference and get back to me.

I hope you see the difference.

You can reach out to me directly if this is still not clear. You have my e-mail address.

Hoping to hear from you soon.
[23 May 2022 18:01] Philip Olson
Hello Igor,

Thanks for the information, we're working on this but in the meantime there's this FAQ:

https://dev.mysql.com/doc/refman/8.0/en/faqs-c-api.html#faq-mysql-c-api-compile

Hopefully that information can get you started. 

This bug report also reveals that the WITHOUT_SERVER CMake option is not documented[1], so we'll add that too. 

[1] https://dev.mysql.com/doc/refman/8.0/en/source-configuration-options.html
[24 May 2022 0:14] Igor Korot
H, Philip,

> [23 May 18:01] Philip Olson

> Hello Igor,

Finally someone who looked at it seriously after 2 closed reports. ;-)

> Thanks for the information, we're working on this but in the meantime there's this FAQ:

> https://dev.mysql.com/doc/refman/8.0/en/faqs-c-api.html#faq-mysql-c-api-compile

I will look at that, thx.

Do you think you team could also update a bug submission form to use the new name for the library? The first bug I filed about this was closed precisely because of the wrong name...

> Hopefully that information can get you started. 

Let's hope so.

> This bug report also reveals that the WITHOUT_SERVER CMake option is not documented[1], so we'll add that too. 

[1] https://dev.mysql.com/doc/refman/8.0/en/source-configuration-options.html

Good.

Now as mentioned somewhere (either in one of the previous submissions or in this one) - trying to build the library and then cancelling it will automatically start the server installation everyday around 12AM every day.

Do you know how to cancel it?
[24 May 2022 0:26] Igor Korot
OK, I tried to go and look at the link to the FAQ.

Unfortunately it doesn't really help me as the instructions there are for *nix-based OS, while I'm looking for MSW/OS X build of the library.

Also, I don't want t pollute my development box and prefer install only minimum required software. And it looks like that instruction uses something called "Ninja" (I don't know what it is - I use MSVC and Xcode). So it doesn't really help me with the build.
[24 May 2022 4:12] Philip Olson
Agreed it's odd to see Ninja there as it's used nowhere else, so I'll ask why we used it and likely remove the Ninja references.

The key points are:

(a) It's built from the MySQL Server source itself (sounds like you knew this), so generic MySQL Server build docs apply
(b) That "-DWITHOUT_SERVER=ON" says to not build MySQL Server, so faster compile time since you don't need it

While life would be nicer if we could -DONLY_BUILD_LIBMYSQLCLIENT_PLEASE, it doesn't appear possible. There might be additional options (I'm not an expert here) to further optimize build time but hopefully -DWITHOUT_SERVER=ON meets your needs. I just now built it on macOS by removing the Ninja parts and using 'make' to build and it worked.

Also, agreed about the bug category issue; I'll notify the appropriate person.
[24 May 2022 15:38] Igor Korot
Hi, Philip,

> Agreed it's odd to see Ninja there as it's used nowhere else, so I'll ask why
> we used it and likely remove the Ninja references.

OK, good.

> The key points are:

> (a) It's built from the MySQL Server source itself (sounds like you knew 
> this), so generic MySQL Server build docs apply

Had no idea.
All my knowledge comes from building the previous version where the source was an independent tarball from the actual server.
Are you saying that right now the MySQL-Connector/C, or its successor (whatever the name is) is now part of the mySQL source tarball?
And you are following the same pattern as PostgreSQL, who used to have it independently but now integrate it inside?

> (b) That "-DWITHOUT_SERVER=ON" says to not build MySQL Server, so faster 
> compile time since you don't need it

It's not about compile time at all. Its about what belong to where.

While I understand that the API and function calls are coupled with the server, especially since we are talking about C library, you used to supply 2 different source archives.

> While life would be nicer if we could -DONLY_BUILD_LIBMYSQLCLIENT_PLEASE, it 
> doesn't appear possible. There might be additional options (I'm not an expert 
> here) to further optimize build time but hopefully -DWITHOUT_SERVER=ON meets 
> your needs. I just now built it on macOS by removing the Ninja parts and using 
> 'make' to build and it worked.

Life would actually be amazing if I can download and build the library only, because for some unknown reason, when I tried that on Windows, the server installer keeps running.

I don't even know who starts it and what, but every day at midnight it tries to install mySQL Server on my Windows box.

> Also, agreed about the bug category issue; I'll notify the appropriate person.

Good.

Now, if this person or someone could check why am I not being notified about the updates posted on this ticket - it would be even better.

Thank you.
[24 May 2022 20:22] Philip Olson
Yes, building MySQL Server also builds it so that's the most important point that needs to be clarified in the documentation (and will). MySQL Router is another example; building MySQL Server also builds MySQL Router by default. Same for other things, like mysqldump.

As for the installer, maybe you have 'MySQL Installer' installed; I'm not that familiar with Windows but know it does manage installations/updates. Maybe it relates to its automatic catalog updates and such, I don't know.

https://dev.mysql.com/doc/refman/8.0/en/mysql-installer-catalog-dashboard.html
[25 May 2022 1:35] Igor Korot
Hi, Philip,
> Yes, building MySQL Server also builds it so that's the most important point 
> that needs to be clarified in the documentation (and will). MySQL Router is 
> another example; building MySQL Server also builds MySQL Router by default. Same 
> for other things, like mysqldump.

OK, but the question is can I download and build just the library (without the server).

> As for the installer, maybe you have 'MySQL Installer' installed; I'm not
> that familiar with Windows but know it does manage installations/updates. 
> Maybe it relates to its automatic catalog updates and such, I don't know.

No I don't have it installed.

My procedure was as follows
Since I already installed it on my Linux box I copied the archive to my Windows box, unpack it and tried to build with CMake GUI, but since I didn't have the docs and didn't want to screw everything up, I didn't build it.
IIRC, it gave me an error when I tried.

So I exited the CMake GUI and immediately the installer tried to run, but failed.
And now it keeps trying.

Thank you.

https://dev.mysql.com/doc/refman/8.0/en/mysql-installer-catalog-dashboard.html
[25 May 2022 1:36] Igor Korot
BTW, do you have an E-mail address?
I don't think ticket is appropriate for such a big discussion...
[25 May 2022 2:16] Philip Olson
You must download the MySQL Server source and compile it to build libmysqlclient. Passing in -DWITHOUT_SERVER=ON is optional. This is the only way.

Please use the forum for non-bug related questions, and good luck :)

I'll close this bug after updating the documentation sometime in the future.
[25 May 2022 14:48] Igor Korot
Hi, Philip,
That sucks.
I was really hoping to download the library code only. ;-)

I tried the forum as well as ML. Nice and quiet. ;-)

Oh, and please don't just close it - put the link to the new page.

Even though I will not be notified about the post it will be just one click.

TIA!!
[26 May 2022 14:41] Igor Korot
Philip,
Can you answer my other question - why am I not being notified of the changes to this ticket?
Upon submission I do see a text that the submitter is notified, but no e-mail is coming.
I did check the Spam folder in my gmail acct.

Thank you.
[31 May 2022 10:00] MySQL Verification Team
Bug #107041 marked as duplicate of this one.
[13 Jun 2022 14:13] Philip Olson
I don't know about notifications, but this bug is now closed and the original 404 link now points to the docs. Thanks Igor for reporting the bug, and have fun compiling all the things :)
[20 Jun 2022 1:40] Igor Korot
Hi, Philip,
Can yo drop the link to the docs here?

Thx.
[12 Jul 2022 15:45] Frederic Descamps
To compile MySQL C API "only" you can follow the process explained on https://lefred.be/content/how-to-build-mysql-8-0-c-api-libmysqlclient/