Bug #51511 MTRv1 unable to find mysqld binary in out-of-source cmake builds
Submitted: 25 Feb 2010 15:53 Modified: 10 Mar 2010 18:35
Reporter: John Embretsen Email Updates:
Status: Closed Impact on me:
None 
Category:Tools: MTR / mysql-test-run Severity:S7 (Test Cases)
Version:next-mr OS:Any
Assigned to: Bjørn Munch CPU Architecture:Any

[25 Feb 2010 15:53] John Embretsen
Description:
With WL#5161 (cmake build system) in place in the code (in mysql-next-mr and mysql-6.0-codebase and friends since 2010-02-22), it is possible (and recommended) to build MySQL out-of-source when using the cmake build system. cmake is the default if available on the build host.

In an out-of-source build, a wrapper for mysql-test-run.pl is created in the build location, which calls the original mysql-test-run.pl in the source location.

This wrapper tells mysql-test-run.pl where to find the binaries by setting the environment variable MTR_BINDIR. However, this does not seem to have any effect when MTRv1 is used:

$ MTR_VERSION=1 perl ./mtr analyze
=======================================================
  WARNING: Using mysql-test-run.pl version 1!
=======================================================
Logging: lib/v1/mysql-test-run.pl analyze
mysql-test-run: *** ERROR: Could not find any of mysql-next-mr-bugfixing/sql/release/mysqld mysql-next-mr-bugfixing/sql/relwithdebinfo/mysqld mysql-next-mr-bugfixing/sql/debug/mysqld mysql-next-mr-bugfixing/sql/release/mysqld-debug mysql-next-mr-bugfixing/sql/relwithdebinfo/mysqld-debug mysql-next-mr-bugfixing/sql/debug/mysqld-debug mysql-next-mr-bugfixing/sql/mysqld mysql-next-mr-bugfixing/client/mysqld-max-nt mysql-next-mr-bugfixing/client/mysqld-max mysql-next-mr-bugfixing/client/mysqld-nt mysql-next-mr-bugfixing/client/mysqld mysql-next-mr-bugfixing/client/mysqld-debug mysql-next-mr-bugfixing/client/mysqld-max mysql-next-mr-bugfixing/libexec/mysqld mysql-next-mr-bugfixing/bin/mysqld mysql-next-mr-bugfixing/sbin/mysqld

How to repeat:
Get source code for mysql-next-mr or a related branch with WL#5161.

Build out-of source:

mkdir mybuild
cd mybuild
cmake ..

Try to run MTRv1:

cd mysql-test
MTR_VERSION=1 perl ./mysql-test-run.pl analyze

NOTE: Normal MTR (v2) seems to work fine.

Suggested fix:
Have MTRv1 honor MTR_BINDIR in the same way as MTRv2.
[1 Mar 2010 15:30] 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/101901

2941 Bjorn Munch	2010-03-01
      Bug #51511 MTRv1 unable to find mysqld binary in out-of-source cmake builds
      Set $glob_bindir, like $bindir in v2
      Removed some obsolete IM code rather than changing it
[3 Mar 2010 9:21] John Embretsen
Thank you for working on this, Bjørn!

I have tried out the patch against current mysql-next-mr-bugfixing and it seems to work fine. With it, I am able to run MTR tests and use --start-and-exit (and hence the Random Query Generator) from out-of-source cmake builds. Tested on Red Hat Linux and Solaris 10 sparc.
[6 Mar 2010 19:13] 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/102499

3116 Bjorn Munch	2010-03-06
      Bug #51511 MTRv1 unable to find mysqld binary in out-of-source cmake builds
      Set $glob_bindir, like $bindir in v2
      Removed some obsolete IM code rather than changing it
[6 Mar 2010 19:22] 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/102500

3116 Bjorn Munch	2010-03-06
      Bug #51511 MTRv1 unable to find mysqld binary in out-of-source cmake builds
      Set $glob_bindir, like $bindir in v2
      Removed some obsolete IM code rather than changing it
[6 Mar 2010 19:47] Bjørn Munch
Pushed to next-mr-bugfixing, 6.0-codebase-bugfixing
[10 Mar 2010 13:38] Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20100310133305-0jdlngbtrkoqzckh) (version source revid:alik@sun.com-20100310132404-uqarl0o0vlra2kjx) (merge vers: 6.0.14-alpha) (pib:16)
[10 Mar 2010 13:38] Bugs System
Pushed into 5.5.3-m3 (revid:alik@sun.com-20100310132634-zpyjzn346sgrm59u) (version source revid:alik@sun.com-20100310132634-zpyjzn346sgrm59u) (merge vers: 5.5.3-m3) (pib:16)
[10 Mar 2010 13:39] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100310132718-l0tegumhbg8umgjd) (version source revid:alik@sun.com-20100310132252-kpi29r22kjtl493x) (pib:16)
[10 Mar 2010 18:35] Paul DuBois
Changes to test suite. No changelog entry needed.