Bug #50841 make clean does not remove sql_yacc.cc and sql_yacc.hh
Submitted: 2 Feb 2010 15:30 Modified: 3 Feb 2010 8:17
Reporter: Bernt Marius Johnsen Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.0+ OS:Any
Assigned to: CPU Architecture:Any

[2 Feb 2010 15:30] Bernt Marius Johnsen
Description:
make clean does not remove sql_yacc.cc and sql_yacc.hh

Causes compilation errors when reconfiguring for another platform with incompatible bison versions

How to repeat:
Start from newly branched/checked out branch

configure.....
$ find . -name "*yacc*" -print
./libmysqld/.deps/sql_yacc.Po
./sql/sql_yacc.yy
./sql/.deps/sql_yacc.Po
make.....
make clean....
$ find . -name "*yacc*" -print
./libmysqld/.deps/sql_yacc.Po
./sql/sql_yacc.yy
./sql/.deps/sql_yacc.Po
./sql/sql_yacc.cc
./sql/sql_yacc.h

Suggested fix:
Fix make clean
[2 Feb 2010 15:35] Valeriy Kravchuk
Thank you for the problem report. Verified just as described.
[2 Feb 2010 15:56] Daniel Fischer
This is working as intended because these files are part of our source distribution and the Makefile can't really tell where exactly they came from.

Please specify what kind of error this causes, as pretty much all of our builds use sql_yacc.{cc,hh} generated somewhere else than the build host.

Is it possible that the problem lies with some other file left over from the previous configure run? Do  the compile problems go away when you run "make distclean" instead of "make clean"?
[2 Feb 2010 16:01] Marc ALFF
This is not a bug, make clean should *not* remove these files.

The proper command to use is make maintainer-clean
[3 Feb 2010 7:39] Bernt Marius Johnsen
Marc: Thanks,

Daniel: 
"./lex.h", line 199: Error: ERROR_SYM is not defined.
"./lex.h", line 234: Error: GENERAL is not defined.
"./lex.h", line 443: Error: RELAY is not defined.
"./lex.h", line 499: Error: SLOW is not defined.
"sql_lex.cc", line 844: Error: WITH_CUBE_SYM is not defined.
"sql_lex.cc", line 846: Error: WITH_ROLLUP_SYM is not defined.
6 Error(s) and 5 Warning(s) detected.
[3 Feb 2010 7:55] Valeriy Kravchuk
Bernt,

So, does make maintainer-clean work for your case or not?
[3 Feb 2010 8:02] Bernt Marius Johnsen
Well, it at least deletes the offending files so that they are generated during make
[3 Feb 2010 8:05] Daniel Fischer
These symbols were introduced as part of WL#5142, which was merged from mysql-5.1-rpl-merge on January 18th. My guess is that you tried to build after pulling a local branch that had previously been built in the same directory, instead of using a new clean branch. Please confirm.

Note that make clean (or other cleanup targets) will never be able to guarantee a sane state after a pull. There are a number of changes that will leave undesired files in place, e.g. renaming or removal of files with according adjustment of Makefiles. It may be a good idea to run "bzr clean-tree --unknown --ignored" after a pull into a branch that has previously been built. This will get rid of pretty much everything bzr doesn't know about.
[3 Feb 2010 8:08] Bernt Marius Johnsen
Daniel: Ack.
[3 Feb 2010 8:17] Daniel Fischer
Thanks. Closing as no bug.