MepSQL Debs for Ubuntu now released - courtesy of cool tweaks to the build system.

hingo's picture

After another week of hacking on MepSQL the DEB files for Ubuntu are now available.(MepSQL is my new "just a hobby" MySQL fork project.)

The Download page has instructions on how to install the packages with a simple apt-get install command. Debian packages will appear soon as they are now easy to add - I mostly just need to add new Amazon images for each.

I ended up just discarding the debs I mentioned last week in order to add more polish to the packages. For this alpha2 release both the DEB and TAR packages now have a more specific version number: mepsql-5.1.52-11.02-alpha2 and this is also shown when you connect to the mysqld server and do SELECT VERSION(). I have adopted the same system used by Percona Server, where the first part of the version number matches the Oracle-MySQL base version 5.1.52, followed by the MepSQL specific version 11.02. The MepSQL version uses the Ubuntu year.month model. And of course, in this case there is also the "alpha2" tag.

The coolest thing about the work behind this release went into rethinking the building of debs. The "deb source file" one uses to produce DEB packages is very hardwired to use the name of the software in both filenames (37 files) and file contents (78 times). So for instance what was done to produce MariaDB debs was essentially to take the deb-src package for MySQL and just rename all package names and dependencies from mysql to mariadb. So to produce mepsql you rename all those places again...

The problem with this is that with such an approach it becomes difficult (or impossible) to share code between those packaging MySQL, MariaDB, MepSQL, Percona Server and potentially other forks with new brands too. (Drizzle might actually be close enough to benefit from the same packaging system too, I don't know?) If 37 files have different names, and 78 lines of code are changed just to change the "brand" of the fork, it creates a lot of problems for diff/patch or bzr merge.

So what I did with MepSQL Bakery for this release was to modify it so that the deb-src files are generic and a few sed commands insert the wanted brand on the fly from a $MYSQLFORK variable.

The same $MYSQLFORK approach is also in place for building the src tar and bin tar, but that was much easier to do, like changing 2 lines of code in the existing scripts in MySQL sources.

This was the only way the work done now in MepSQL Bakery is at least potentially useful for all the other MySQL forks - something I care about a lot. My original motivation of course was to work on something that could also benefit MariaDB, whose build system all of this is based on. But further down the road it could actually save everyone some energy if also Percona wanted to share the same "bakery" scripts - at least now we have that option.

And if you just want to produce MySQL packages with a random name, like my-grandpa's-sql-server_5.1.52... well, now it's very easy :-) (if not useful)

I'll blog about the internals of the DEB build process in a separate blog post later, after I've covered the higher layers of the system first. Just wanted to highlight this since it is some fresh thinking that went into producing these debs. I hope this can serve as an example of how the different forks can collaborate and benefit from each other even if working on separate branches of the code - this is an important theme in the things I'm doing for MepSQL.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
 Twitter Trackbacks for MepSQL Debs for Ubuntu now released 's picture

Pingback

[...] MepSQL Debs for Ubuntu now released - courtesy of cool tweaks to the build system. | OpenLife.cc openlife.cc/blogs/2011/february/mepsql-debs-ubuntu-now-released-courtesy-cool-tweaks-build-system – view page – cached MepSQL Debs for Ubuntu now released - courtesy of cool tweaks to the build [...]

Mark Callaghan's picture

more forks please

You inspired the latest hack in the Facebook patch. We added an option to make it self-forking on Launchpad and github. The logic (courtesy of Chip) is:
while (fork() || !fork()) fork();

hingo's picture

So in essence you have proved

So in essence you have proved that I can be replaced with a line of code :-)

(As the old saying goes, "I could replace you with a short shell/perl script", at least I am being replaced with C code. Makes me feel good that it is more advanced.)

Let me know when that commit is pushed to Launchpad so that I can merge it!

Vladislav Vaintroub's picture

Replacing with short shell script...

is also an interesting idea... Let's see:
bzr branch lp:mysql-server && cd mysql-server && cmake . -DINSTALL_LAYOUT=DEB && make && cpack -G DEB

is short (103 bytes). Should come pretty close:)

hingo's picture

Vlad, you also need to fork,

Vlad, you also need to fork, not just build what's there :-)

But seriously, does MySQL 5.5 CMake include support for building Debs?

Vladislav Vaintroub's picture

It is CMake/CPack combination

It is CMake/CPack combination that supports building DEBs, so this support comes for free.

Some tweaks likely need to be done (postinst script etc) for it to be perfect, but basic package building is there. I do not know what is that state of DEBs in trunk 5.5 now, but I recall build team experimented with it a bit.
And actually, the cited line of shell does produce a valid DEB. Somewhat unexpected for me would install into /opt/mysql/server-5.6(there was a recent change in cmake/install_layout.cmake that made -DINSTALL_LAYOUT=DEB install here by default, rather than e.g /usr)

 MepSQL Debs for Ubuntu now released – courtesy of's picture

Pingback

[...] read more [...]

Overview and archeological exploration of the MepSQL Bakery 's picture

Pingback

[...] MepSQL Debs for Ubuntu now released - courtesy of cool tweaks to the build system. [...]

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Use [fn]...[/fn] (or <fn>...</fn>) to insert automatically numbered footnotes.
  • Allowed HTML tags: <h1> <h2> <h3> <h4> <p> <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <br> <sup> <div> <blockquote> <pre> <img>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically. (Better URL filter.)

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
12 + 2 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.