Bug #57273 Different "make install" file system layout when building with Cmake ...
Submitted: 6 Oct 2010 7:11 Modified: 16 Nov 2010 19:57
Reporter: Hartmut Holzgraefe Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.5.6-rc OS:Linux
Assigned to: CPU Architecture:Any

[6 Oct 2010 7:11] Hartmut Holzgraefe
Description:
When compiling from source and doing "make install" the resulting installation directories layout looks quite different depending on whether Cmake (requires both Cmake and Perl to be installed) or the classic autotools build mechanism (in absence of either Cmake or Perl) was used (which still seems to be mostly using the same layout as in 5.1):

Cmake based installation differs from the 'classic' layout in that it:

* puts mysql_install_db into $prefix/scripts, not $prefix/bin 
* does not have 'mysql' sub directories under $prefix/include, $prefix/lib and $prefix/share, puts files directly into these directories instead (ok if using a private prefix like /usr/local/mysql, but creating a mess if $prefix is set to /usr or the default /usr/local
* does not install sql-bench/Comments (no idea whether that is of any importance)
* puts several files that used to be in $prefix/share/mysql into $prefix/support-files instead
* puts the mysql.info file into $prefix/docs instead of $prefix/share/mysql/info
* does not install mysql.m4 at all anymore
* installs COPYING, EXCEPTIONS-CLIENT,INSTALL-BINARY and README directly under $prefix (autotools doesn't install them at all), instead of using $prefix/share/doc or $prefix/share/mysql/doc
* default data dir name is $prefix/data, not $prefix/var
* puts mysqld into $prefix/bin instead of $prefix/libexec (should be $prefix/sbin if moved at all?)

Some of these changes make sense (or at least make self compiled installations a bit more similar to the binary tarball releases), others don't, the main problems tough are:

* none of these changes seem to be documented 
* some of them break things for people who use to compile themselves for sure, like the changed locations of mysql_install_db and mysqld
* *if* we change installation layout the changes need to be applied to the autotools based fallback build mechanism, too
* some of the changes don't make sense for the default /usr/local installation prefix

PS: when using BUILD/compile-pentium-debug-max my installations also differ in that the autotools one includes ndbcluster stuff while the cmake one doesn't

How to repeat:
Build and install 5.5 from freshly unpacked source with and without Cmake installed, compare the contents and layout of the $prefix directory you specified after installation, see that several files and directories end up in different locations and that some files are even only present in one installation and missing from the other

Suggested fix:
* make sure that the installation directory layout is the same for Cmake and autotools builds
* document any changes in the layout compared to the 5.1 one
* revert some (IMHO most) of the changes as they either don't make sense (non-standard locations for documentation files), clutter the default /usr/local installation prefix with files that should be in mysql specific subdirs, and break existing scripts for people who've always installed from source
[11 Oct 2010 15:57] Peter Gulutzan
See also
Bug#56461 CMake with build scripts puts files in wrong places
[8 Nov 2010 9:26] Hartmut Holzgraefe
Just found a small mistake in my original description:

* puts the mysql.info file into $prefix/docs instead of $prefix/share/mysql/info

should read "... instead of $prefix/share/info" without the extra "/mysql" in there
[9 Nov 2010 17:09] Daniel Fischer
If there is a bug, it is that the autotools based build process doesn't produce the layout we use for packages.

If autotools is deprecated, this is not a bug.
[16 Nov 2010 19:57] Peter Gulutzan
Although autotools is not deprecated,
it will be unsupported.
Although this is not an autotools bug,
it's decided that behaviour is okay.
Not a bug.