Bug #43312 VPATH build of mysql 5.1.31 deletes $(top_srcdir)/client/my_user.c
Submitted: 2 Mar 2009 20:33 Modified: 15 Oct 2012 14:10
Reporter: Simon Mudd (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.1.31 OS:Any
Assigned to: Kent Boortz CPU Architecture:Any

[2 Mar 2009 20:33] Simon Mudd
Description:
If you use the VPATH build procedure to keep the source and build directories separate the build completes but $(top_srcdir)/client/my_user.c gets deleted when IMO it should not be touched.

I use the VPATH build option as in theory it makes it easier to keep the source tree under version control (no object files in the tree) and also in theory the directory could be shared on various boxes read only. This is what is done for example with FreeBSD's build system.

How to repeat:
1. Checkout the 5.1.31 tar ball
2. check it into a version control system so you can check if any files change.
3. cd to a different build directory e.g. ../obj
4. run ../mysql-5.1.31/configure to prepare for the build
5. run make to build the source (this completes successfully)
6. cd back to the source tree and check if any files have changed.
   You see client/my_user.c has been removed.

Suggested fix:
IMO the source tree should if built using the VPATH option should be untouched and all changes should take place in the $(top_buildir) and below. Thus it should be possible to mount the source tree from a read only filesystem and build from that.

I'll add an example build showing the error when building under MacOSX but I don't believe the problem is specific to this OS.
[2 Mar 2009 20:34] Simon Mudd
Example build on a Mac showing that the file gets removed.

Attachment: vpath_build-5.1.31.txt.gz (application/x-gzip, text), 1.81 KiB.

[3 Mar 2009 9:17] Sveta Smirnova
Thank you for the report.

Verified as described on Linux using mysql-5.1.31.tar.gz source package.

Other files are not affected:

$diff -ur mysql-5.1.31 mysql-5.1.31-bug43312
Only in mysql-5.1.31/client: my_user.c

Probably problem is what development tree does not contain my_user.c at all, but my_user.gcda  my_user.gcno instead.
[29 Jul 2010 16:58] 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/114667

3093 MySQL Build Team	2010-07-29
      Remove soft links in the build directory, not the source directory (Bug#43312)
[29 Jul 2010 17:15] Jonathan Perkin
Looks fine.
[2 Aug 2010 18:25] 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/114869

3162 Kent Boortz	2010-08-02
      Remove soft links in the build directory, not the source directory (Bug#43312)
[15 Oct 2012 14:10] Erlend Dahl
Fixed in 5.1.58