Building MySQL from source

So others know how I check out a fresh tree, here are instructions to building MySQL from mysql.bkbits.net, using the free bkf tool.

  • in ~/code, do bkf clone bk://mysql.bkbits.net/mysql-5.0-community mysql-5.0-community to clone to community tree down to your disk
  • wait patiently, while bitkeeper attempts to suck some of your bandwidth
  • now, do BUILD/compile-dist, and wait while MySQL builds
  • you might find it handy to now get the test suite on your build, via make test
  • run make dist, and you’ll have nice dandy source tarballs to go with your build for easy installation/distribution/etc.
  • if you encounter problems, say with ndb (and you’re not testing against it), you can run make dist --ignore ndb for instance

If for some reason you don’t want the latest development tree, and say, are more interested in a tag, all you need to do is find the appropriate tree under the Repository section on bkbits, click on it, head over to tags, find an appropriate tag, and execute a bkf clone -rTAG bk://mysql.bkbits.net/mysql-5.0-community mysql-5.0-community-TAG. You now have a mysql version that matches a certain tag. Build as per above.

To keep up-to-date, just run bkf pull.

If you actually need to install supporting packages (or bkf itself!), etc. on say Ubuntu or Fedora, read Installing from the Development Source Tree, part of the excellent MySQL manual. Also, executing bkf --help is pretty easy. The tool itself is pretty brain-dead, quite unlike its older (commercial) brother, BitKeeper (bk).

Update: I should clarify that make dist alone, only gives you a pristine source tarball for distribution, etc. What I normally do is hook it into the package management system of the platform of my choice (usually RPM or DEB), and build binaries that way. However, if you want a binary tarball, there’s an additional step in that you need to run scripts/make_binary_distribution (generally, after running tests!). This will be a tarball that contains a binary for distribution. Heads up to Giuseppe for dropping me a line.

Technorati Tags: , , , ,


i