Bug #56461 CMake with build scripts puts files in wrong places
Submitted: 1 Sep 2010 16:37 Modified: 16 Nov 2010 19:56
Reporter: Peter Gulutzan Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.6.1-m4 OS:Linux (SUSE 64-bit)
Assigned to: CPU Architecture:Any

[1 Sep 2010 16:37] Peter Gulutzan
Description:
BUILD with autotools puts mysqld in libexec subdirectory.
BUILD with CMake puts mysqld in bin subdirectory.

Meanwhile mysql_install_db has gone to ./scripts instead of /bin.

Full compatibility to old build system should be retained,
as promised.

How to repeat:
In the following, change "/home/pgulutzan/..."
to whatever path you prefer.

Before each build, erase everything and download
again to evade Bug#55921.

/* With autotools */
/* Erase everything and download again */
export HAVE_CMAKE=no
rm /home/pgulutzan/data1/mysql-trunk/libexec/mysqld
BUILD/compile-pentium-max --prefix=/home/pgulutzan/data1/mysql-trunk
make install
ls -l /home/pgulutzan/data1/mysql-trunk/libexec/mysqld
ls -l /home/pgulutzan/data1/mysql-trunk/bin/mysqld

/* With CMake */
/* Erase everything and download again */
export HAVE_CMAKE=yes
rm /home/pgulutzan/data1/mysql-trunk/libexec/mysqld
BUILD/compile-pentium-max --prefix=/home/pgulutzan/data1/mysql-trunk
make install
ls -l /home/pgulutzan/data1/mysql-trunk/libexec/mysqld
ls -l /home/pgulutzan/data1/mysql-trunk/bin/mysqld

Notice that 'ls -l' shows the files are in different places.
I've noticed the difference for mysqld and mysql_install_db,
and I'll guess that other files are also in different places.
[1 Sep 2010 17:06] Vladislav Vaintroub
Full compatibility means autotools will run for some time.
I hope I never said that CMake buid will be exactly as broken as autotools:)

libexec vs bin  vs sbin was discussed with build team, and bin won. libexec is not used by our supported OSes to install executables.

However , cmake . -DINSTALL_BINDIR=libexec will install binaries into libexec.
[1 Sep 2010 17:10] Paul DuBois
This problem is not limited to the BUILD scripts.

I do not use the BUILD scripts, but I have noticed this same thing. I had to add -DINSTALL_SBINDIR=libexec to my cmake command line to get mysqld to install in the same location as before, and -DINSTALL_SCRIPTDIR=bin to get mysql_install_db to install in the same location as before.

It would be good if the defaults for cmake were the same as for autotools.
[1 Sep 2010 17:14] Paul DuBois
If the cmake defaults won't change, let me ask something else, because we'll need an update to the manual.

http://dev.mysql.com/doc/refman/5.5/en/installation-layouts.html describes layouts as have been used with the autotools.

Aside from the differences noted in this bug report, are there others that also need to be accounted for in the documentation?
[1 Sep 2010 18:03] MySQL Verification Team
Thank you for the bug report.
[1 Sep 2010 18:34] Vladislav Vaintroub
The layout is the same as tar distribution

Directory          Contents of Directory 

bin                Client programs and scripts 
scripts            mysql_install_db
include            Include (header) files 
docs               no idea, typically not produced, if produced, bteam knows how
man                Man pages ?
lib                Libraries 
bin                The mysqld server 
share/mysql        Error message files 
sql-bench          Benchmarks and crash-me test 
data               Databases and log files
[1 Sep 2010 18:36] Vladislav Vaintroub
the above is for the self-compiled server and tar distribution.
Otherwise layout should not have changed
[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:56] Peter Gulutzan
Although autotools is not deprecated,
it will be unsupported.
Although this is about CMake not autools,
it's decided that behaviour is okay.
Not a bug.