Bug #59476 Option -DWITH_COMMENT not working
Submitted: 13 Jan 2011 17:48 Modified: 16 Jan 2014 15:42
Reporter: Santo Leto Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.5.9-rev.3238-bzr OS:Any (Vista 32-bit, Linux)
Assigned to: CPU Architecture:Any
Tags: -DWITH_COMMENT, cmake, nmake

[13 Jan 2011 17:48] Santo Leto
Description:
CMake option -DWITH_COMMENT=string is used to add a descriptive comment about the compilation environment but it seems that it is not working correctly (at least on Windows): even if I add my own comment, the output of the command SHOW VARIABLES LIKE '%comment%'; is always "Source distribution".

How to repeat:
Using NMake for out-of-source builds.

* Test 1: -DWITH_COMMENT="rev.3238-debug"

cd ofs-nmake-5.5.9-rev-3238-commentTest1
cmake -DWITH_DEBUG=1 -DWITH_COMMENT="rev.3238-debug" -G "NMake Makefiles" ..\mysql-5.5
nmake package

SHOW VARIABLES LIKE '%comment%';

* Test 2: -DWITH_COMMENT='rev.3238-debug' (i.e. use ' instead of ")

cd ofs-nmake-5.5.9-rev-3238-commentTest2
cmake -DWITH_DEBUG=1 -DWITH_COMMENT='rev.3238-debug' -G "NMake Makefiles" ..\mysql-5.5
nmake package

SHOW VARIABLES LIKE '%comment%';

Output:

* Test 1:

mysql> SHOW VARIABLES LIKE '%comment%';
+-----------------+---------------------+
| Variable_name   | Value               |
+-----------------+---------------------+
| version_comment | Source distribution |
+-----------------+---------------------+
1 row in set (0.00 sec)

* Test 2:

mysql> SHOW VARIABLES LIKE '%comment%';
+-----------------+---------------------+
| Variable_name   | Value               |
+-----------------+---------------------+
| version_comment | Source distribution |
+-----------------+---------------------+
1 row in set (0.00 sec)

(i.e. test 1 and test 2 produce the same output and "rev.3238-debug" is not shown as value of the variable 'version_comment').
[13 Jan 2011 17:56] Davi Arnaut
WITH_COMMENT does not seem to exist, except for a usage in cmake/configure.pl, which will do nothing. Seems the name used was COMPILATION_COMMENT.
[13 Jan 2011 18:02] Davi Arnaut
We should either rename COMPILATION_COMMENT to WITH_COMMENT or replace the single occurrence of WITH_COMMENT in the server with COMPILATION_COMMENT.
[14 Jan 2011 8:34] Valeriy Kravchuk
Verified by code review:

openxs@ubuntu:/home2/openxs/bzr2/mysql-5.5$ grep -rn WITH_COMMENT *
cmake/configure.pl:190:    $cmakeargs = $cmakeargs." \"-DWITH_COMMENT=".substr($option,13)."\""; 
openxs@ubuntu:/home2/openxs/bzr2/mysql-5.5$ grep -rn COMPILATION_COMMENT *
...
BUILD/Makefile.in:115:COMPILATION_COMMENT = @COMPILATION_COMMENT@
client/Makefile.in:233:COMPILATION_COMMENT = @COMPILATION_COMMENT@
cmake/Makefile.in:98:COMPILATION_COMMENT = @COMPILATION_COMMENT@
cmake/mysql_version.cmake:84:IF(NOT COMPILATION_COMMENT)
cmake/mysql_version.cmake:85:  SET(COMPILATION_COMMENT "Source distribution")
cmake/build_configurations/mysql_release.cmake:99:IF(NOT COMPILATION_COMMENT)
cmake/build_configurations/mysql_release.cmake:100:  SET(COMPILATION_COMMENT "MySQL Community Server (GPL)")
cmd-line-utils/readline/Makefile.in:148:COMPILATION_COMMENT = @COMPILATION_COMMENT@
cmd-line-utils/Makefile.in:154:COMPILATION_COMMENT = @COMPILATION_COMMENT@
cmd-line-utils/libedit/Makefile.in:163:COMPILATION_COMMENT = @COMPILATION_COMMENT@
configure.am:888:COMPILATION_COMMENT
configure.am:22836:  COMPILATION_COMMENT=$with_comment
configure.am:22838:  COMPILATION_COMMENT="Source distribution"
dbug/Makefile.in:195:COMPILATION_COMMENT = @COMPILATION_COMMENT@
Docs/Makefile.in:113:COMPILATION_COMMENT = @COMPILATION_COMMENT@
extra/Makefile.in:261:COMPILATION_COMMENT = @COMPILATION_COMMENT@
extra/yassl/Makefile.in:139:COMPILATION_COMMENT = @COMPILATION_COMMENT@
...
[16 Jan 2014 15:42] Jon Olav Hauglid
Closing as duplicate of Bug#65834