Bug #55842 CMake: bad dependencies on sql/lex_hash.h
Submitted: 9 Aug 2010 15:07 Modified: 20 Aug 2010 14:46
Reporter: Marc Alff Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S1 (Critical)
Version: OS:Any
Assigned to: Vladislav Vaintroub CPU Architecture:Any
Triage: Triaged: D1 (Critical)

[9 Aug 2010 15:07] Marc Alff
Description:
When using CMake, the build scripts should re-generate the file
sql/lex_hash.h whenever gen_lex_hash itself is recompiled.

The build scripts currently fail to do so, which leads to
a broken lex_hash.h that cause the server to fail.

This failure is not seen when building from a pristine tree,
but affects development a lot, when building from an existing tree.

make clean + make does *not* work as a work around,
because make clean does not seem to remove sql/lex_hash.h

How to repeat:
- Do a full build.
- touch sql/gen_lex_hash
- make

see that sql/lex_hash.h is not re generated, sql_lex.o is not recompiled,
and that the server binary is not re linked.

Suggested fix:
Add a sql/lex_hash.h : sql/gen_lex_hash dependency in the cmake build scripts
[9 Aug 2010 17:46] Miguel Solorzano
Thank you for the bug report.
[9 Aug 2010 19:47] 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/115362

3171 Vladislav Vaintroub	2010-08-09
      Bug #55842 CMake: bad dependencies on sql/lex_hash.h 
      
      Fix by adding "DEPENDS gen_lex_hash" to ADD_CUSTOM_COMMAND(),
      so it regenerates lex_hash.h whenever gen_lex_lash changes.
      
      Also, make sql dependent on GenServerSource to avoid concurrent 
      generation of lex_hash.h (once for sql , and in parallel for embedded)
[9 Aug 2010 20:14] Vladislav Vaintroub
queued to 5.5-bugfixing, trunk-bugfixing, next-mr-bugfixing
[16 Aug 2010 6:30] Bugs System
Pushed into mysql-trunk 5.6.1-m4 (revid:alik@sun.com-20100816062701-qo9dpnk5tkt1pksb) (version source revid:alik@sun.com-20100816062603-xc16eftmv7rmktyq) (merge vers: 5.6.1-m4) (pib:20)
[16 Aug 2010 6:41] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100816062819-bluwgdq8q4xysmlg) (version source revid:alik@sun.com-20100816062612-enatdwnv809iw3s9) (pib:20)
[17 Aug 2010 10:57] MC Brown
A note has been added to the 5.6.1 changelog: 

        CMake would produce bad dependencies for the <filename>sql/lex_hash.h</filename> file during configuration.
[20 Aug 2010 14:46] MC Brown
Added to the 5.5.6 changelog