Bug #58272 -DBUILD_CONFIG=mysql_release is broken with cmake 2.8.3
Submitted: 17 Nov 2010 20:54 Modified: 6 Jan 2011 1:01
Reporter: Vladislav Vaintroub Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S2 (Serious)
Version:5.5 OS:Any
Assigned to: Vladislav Vaintroub CPU Architecture:Any

[17 Nov 2010 20:54] Vladislav Vaintroub
Description:
BUILD_CONFIG parameter which is used by the build team to set the correct flags
does not work in CMake 2.8.3 . Jonathan and Daniel there  also report that it does not work with cmake 2.6.0 (on Debian 5)

On Linux, it will report after some time:

"No current working directory
Aborted"

I filed a CMake bug about it here:
http://public.kitware.com/Bug/view.php?id=11469  

How to repeat:
cmake .. -DBUILD_CONFIG=mysql_release
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Looking for sys/types.h
No current working directory
Aborted

Suggested fix:
Brad King from Kitware suggests not to use 
CMAKE_USER_MAKE_RULES_OVERRIDE (whcih we use with -DBUILD_CONFIG)

here http://public.kitware.com/Bug/view.php?id=11469 
"
Instead, just add your own release flags script inclusion:
 
cmake_minimum_required(VERSION ...)
 project(MySQL ...)
 if(MySQL_RELEASE_RULES)
 include("${MySQL_RELEASE_RULES}")
 endif() 
"

This  sounds like painless fix, however the compile flags won't be cached, so it could break some build automation, but having CMAKE_USER_MAKE_RULES_OVERRIDE just for the sake of having flags in the cache does not sound like a very good reason either.
[17 Nov 2010 21:06] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/124202

3127 Vladislav Vaintroub	2010-11-17
      Bug#58272:  -DBUILD_CONFIG=mysql_release is broken with cmake 2.8.3
      
      The reason  for the bug is that :
      -  we use system checks in cmake/os/mysql_release.cmake 
      -  we include cmake/os/mysql_release.cmake using CMAKE_USER_MAKE_RULES_OVERRIDE 
      -  this  (having system checks based on TRY_COMPILE inside file pointed by 
         CMAKE_USER_MAKE_RULES_OVERRIDE  does not work with cmake 2.8.3,
         and  according to Kitware was never meant to work, it just happened to work by accident
         until 2.8.2 release (though, it seems not to work wiith 2.6.0 either)
      
      Related CMake bug discussing the situation:
      http://public.kitware.com/Bug/view.php?id=11469  
      
      The fix is to use INCLUDE instead of CMAKE_USER_MAKE_RULES_OVERRIDE as suggested
      by Kitware. The downside is that compile flags are not in cache, but this is  pure cosmetics.
      The functionality is the same,  flags are used for compiling are correct using INCLUDE.
[19 Nov 2010 10:01] Daniel Fischer
I think this might work.
[19 Nov 2010 10:02] Jonathan Perkin
Confirmed fixed on Debian 5 using CMake 2.6.0, also a full release build appears to be using identical compiler flags, so the file is being parsed correctly.
[19 Nov 2010 10:03] Jonathan Perkin
silly bugs system..
[5 Dec 2010 12:39] Bugs System
Pushed into mysql-trunk 5.6.1 (revid:alexander.nozdrin@oracle.com-20101205122447-6x94l4fmslpbttxj) (version source revid:alexander.nozdrin@oracle.com-20101205122447-6x94l4fmslpbttxj) (merge vers: 5.6.1) (pib:23)
[16 Dec 2010 22:28] Bugs System
Pushed into mysql-5.5 5.5.9 (revid:jonathan.perkin@oracle.com-20101216101358-fyzr1epq95a3yett) (version source revid:jonathan.perkin@oracle.com-20101216101358-fyzr1epq95a3yett) (merge vers: 5.5.9) (pib:24)
[6 Jan 2011 1:01] Paul DuBois
Noted in 5.5.8 changelog.

With CMake 2.8.3, the -DBUILD_CONFIG=mysql_release option did not
work.