Bug 149829

Summary: RFE: build MySQL with embedded server
Product: [Fedora] Fedora Reporter: Nathan Fredrickson <nathan>
Component: mysqlAssignee: Tom Lane <tgl>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: hhorak, kevin, poelstra, rdieter, sdeasey
Target Milestone: ---Keywords: FutureFeature, Patch
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: mysql-5.0.67-2.fc10 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-10-02 15:24:02 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 438944, 465019    
Attachments:
Description Flags
Change mysql.spec to build the embedded server.
none
--with-embedded-server none

Description Nathan Fredrickson 2005-02-28 03:23:17 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050224 Firefox/1.0.1 Fedora/1.0.1-1.3.1

Description of problem:
This is a request to build MySQL with the embedded server, libmysqld.a.  This will allow for developement of progams that use an embedded MySQL server.  It can be accomplished by adding a single configure option: --with-embedded-server

The resulting libmysqld.a archive will be included in the -devel package by the exisitng %{_libdir}/mysql/*.a rule.



Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. rpm -ql mysql-devel | grep libmysqld  

Actual Results:  no output

Expected Results:  /usr/lib/mysql/libmysqld.a

Additional info:

Comment 1 Nathan Fredrickson 2005-02-28 19:14:07 UTC
Created attachment 111492 [details]
Change mysql.spec to build the embedded server.

In addition to adding the --with-embedded-server configure option, this also
includes libgcc.a in the package as mysql/libmygcc.a.  Apparently libmygcc.a is
needed when linking the C++ embedded sever (libmysqld.a) into a C program.  The
upstream MySQL packages include libmygcc.a the same way (see MySQL bug #4921).

Comment 2 Tom Lane 2005-03-12 06:58:10 UTC
This would make for a rather large increase in the size of the mysql-devel package, no?

Comment 3 Nathan Fredrickson 2005-03-12 07:22:39 UTC
Yes, the devel package would increase in size from 566K to 4.7M.  But
that's why devel is a separate package, right?  It's only needed by
developers and downloading a 4 meg devel package is alot easier than
having to build mysql from source or find up-to-date and trusted
3rd-party RPMs.

Comment 4 Stephen 2007-11-21 21:43:32 UTC
*** Bug 355891 has been marked as a duplicate of this bug. ***

Comment 5 Stephen 2007-11-21 21:53:51 UTC
Any chance this is going to happen?

If package size is a concern, how about creating mysql-server-devel?


Comment 6 Rex Dieter 2008-09-30 15:32:38 UTC
Add another interested consumer in mysql-embedded.  Turns out amarok2 will need this, and if remotely possible, we'd would like to ship it with F-10.  

Tom?  Need help packaging/spec wise?

Comment 7 Kevin Kofler 2008-09-30 15:48:17 UTC
Why is a libmygcc.a needed at all? Can't we just symlink this to the system version? Or even better, patch it to use the shared libgcc?

Comment 8 Kevin Kofler 2008-09-30 15:57:43 UTC
Setting F10Target on this, as it blocks upgrades of Amarok 2 beyond the beta we currently have.

Comment 9 Rex Dieter 2008-09-30 18:56:36 UTC
Created attachment 318106 [details]
--with-embedded-server

Can't comment on the libgcc thing.  From reading the upstream bug, it's unclear (to me) whether that's still required or not.

Comment 10 Rex Dieter 2008-09-30 20:51:52 UTC
Looks like building libmysql.a with -fPIC is required for amarok2 as well (I'm testing taking out the conditional %ifarch alpha)

Comment 11 Tom Lane 2008-10-01 03:27:02 UTC
You just now decided that this is a "must have" for F-10?  Seems a tad late in the cycle.

Comment 12 Kevin Kofler 2008-10-01 07:17:18 UTC
We have been tracking Amarok 2 development, we're currently at Beta 1, and it so happens that Amarok upstream decided to switch from SQLite to MySQL Embedded starting from Beta 2 (ignoring their own feature freeze). :-(

Comment 13 Rex Dieter 2008-10-01 13:35:07 UTC
Fwiw, amarok-1.9.92 (2 beta2) builds/runs fine(*) against patched mysql per comment #9 and comment #10 .

(*) In my own limited testing

Comment 14 Tom Lane 2008-10-01 14:42:36 UTC
From my perspective, two non-negotiable requirements for this would be

(a) we ship a .so library, not .a.

(b) it goes into a separate subpackage, perhaps mysql-embedded.

Is this workable for amarok?

Comment 15 Rex Dieter 2008-10-01 14:51:08 UTC
Should be fabulous, many thanks.

Comment 16 Kevin Kofler 2008-10-01 16:36:41 UTC
> (a) we ship a .so library, not .a.
> (b) it goes into a separate subpackage, perhaps mysql-embedded.
> Is this workable for amarok?

Yes, this is definitely workable.

The only problem I see is that (a) has to be implemented somehow. Upstream MySQL builds all the embedded libs as static. :-( Do you want us to come up with a patch for that?

For (b), do you mean there will also be a separate mysql-embedded-devel? (Just asking - we can just BR the package however it is called.)

Comment 17 Tom Lane 2008-10-01 20:56:15 UTC
I'm fooling with the .so issue right now.  I found a thread about how to do it here:
http://lists.mysql.com/internals/35949
so assuming that that recipe works, we can go with it for now, and hope that upstream provides a
cleaner solution later.

I had just come to the conclusion that a mysql-embedded-devel package would be a good idea.
It's a place to put the .so symlink, plus the other test files that only a developer would have use for,
and it also makes the package dependencies more manageable.  AFAICS mysql-embedded shouldn't depend on any of the other mysql packages; but mysql-embedded-devel can have a versioned dependency on mysql-devel, which will prevent people from building with the wrong header files.

Comment 18 Kevin Kofler 2008-10-01 21:26:01 UTC
That sounds good.

Comment 19 Tom Lane 2008-10-02 04:32:38 UTC
Well ... that recipe didn't actually work ...

mysql-5.0.67-2.fc10, in rawhide, contains a libmysqld.so that might or might not work;
I don't have any easy means to test it myself.  Anyone want to try it?

Comment 20 Rex Dieter 2008-10-02 14:48:56 UTC
amarok built/runs fine.  So far so good.  Looks like we have a winner.

Comment 21 Tom Lane 2008-10-02 15:24:02 UTC
Okay, I'm going to mark this CLOSED.  Feel free to reopen or file a new bug if something turns out to be wrong with the .so library.