Bug #86905 IN-SOURCE BUILD INSTALLS CMAKE FILES TO TARGET IN MYSQL-TEST/
Submitted: 3 Jul 2017 13:20 Modified: 28 Jul 2017 1:54
Reporter: Terje Røsten Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.7.19 OS:Any
Assigned to: CPU Architecture:Any

[3 Jul 2017 13:20] Terje Røsten
Description:
When building in-source (cmake .) "make install" puts cmake artifacts into target:

 CTestTestfile.cmake
 Makefile
 cmake_install.cmake

How to repeat:
$ cmake .

Full build is not needed, just do:

$ cd mysql-test
$ make install DESTDIR=/tmp/testinstall

$ ls -l /tmp/testinstall/usr/local/mysql/mysql-test/{CTestTestfile.cmake,Makefile,cmake_install.cmake}
-rw-rw-r-- 1 user user  277 Jul  3 15:11 /tmp/testinstall/usr/local/mysql/mysql-test/CTestTestfile.cmake
-rw-rw-r-- 1 user user 7743 Jul  3 15:11 /tmp/testinstall/usr/local/mysql/mysql-test/Makefile
-rw-rw-r-- 1 user user 1786 Jul  3 15:11 /tmp/testinstall/usr/local/mysql/mysql-test/cmake_install.cmake

Suggested fix:
Skip mysql-test/{CTestTestfile.cmake,Makefile,cmake_install.cmake} during "make install" step in mysql-test.

When change is implemented, remove this lines in deb packaging, like this patch:

iff --git a/packaging/deb-in/rules.in b/packaging/deb-in/rules.in
index e87dc42..9ffd22d 100644
--- a/packaging/deb-in/rules.in
+++ b/packaging/deb-in/rules.in
@@ -64,10 +64,6 @@ override_dh_auto_install:
        @echo "RULES.$@"
        # complete install first
        $(MAKE) install DESTDIR=debian/tmp
-       # remove all redundant files
-       rm debian/tmp/usr/lib/mysql-test/cmake_install.cmake
-       rm debian/tmp/usr/lib/mysql-test/CTestTestfile.cmake
-       rm debian/tmp/usr/lib/mysql-test/Makefile
        # add missing man pages
        install -g root -o root -m 0644 debian/extra/mysql_embedded.1 debian/tmp/usr/share/man/man1
        # add MySQL Server debug binary and library to package
[28 Jul 2017 1:54] Paul DuBois
Posted by developer:
 
Fixed in 8.0.3.

When building MySQL within the source tree, make install installed
some CMake files into the mysql-test directory within the tree.