[MDEV-7359] Tests no longer run in a out of source build due to missing replace utiltiy Created: 2014-12-22  Updated: 2015-02-09  Resolved: 2015-02-09

Status: Closed
Project: MariaDB Server
Component/s: Tests
Affects Version/s: 5.5.41
Fix Version/s: 5.5.42

Type: Bug Priority: Major
Reporter: Brian Evans Assignee: Kristian Nielsen
Resolution: Fixed Votes: 1
Labels: None
Environment:

Gentoo


Issue Links:
Duplicate
is duplicated by MDEV-7388 Tests not working in Debian Closed

 Description   

When i run the tests from inside the cmake BUILD_DIR (out of source), mtr can no longer find the replace utility.

mysql-test-run: *** ERROR: Could not find any of /var/tmp/portage/dev-db/mariadb-5.5.41/work/mysql/extra/replace /var/tmp/portage/dev-db/mariadb-5.5.41/work/mariadb-5.5.41_build/client/replace

replace is built into ${BUILD_DIR}/extra, while mtr is searching in ${BUILD_DIR}/client (or ${S}/extra for in-source builds.. not default)

This seems to be a result of the merge upstream:
https://bazaar.launchpad.net/~maria-captains/maria/5.5/revision/4393/mysql-test/mysql-test-run.pl#mysql-test/mysql-test-run.pl

# ----------------------------------------------------
# replace
# ----------------------------------------------------
my $exe_replace= mtr_exe_exists(vs_config_dirs('extra', 'replace'),
                                 "$basedir/extra/replace",
                                 "$path_client_bindir/replace");
  $ENV{'REPLACE'}= native_path($exe_replace);



 Comments   
Comment by Elena Stepanova [ 2014-12-22 ]

It works in upstream MySQL, though.
The difference is in vs_config_dirs subroutine.

In MySQL, it returns 4 paths:

  return ("$bindir/$path_part/Release/$exe",
          "$bindir/$path_part/RelWithDebinfo/$exe",
          "$bindir/$path_part/Debug/$exe",
          "$bindir/$path_part/$exe");

in MariaDB, there are only 3:

  return ("$basedir/$path_part/release/$exe",
          "$basedir/$path_part/relwithdebinfo/$exe",
          "$basedir/$path_part/debug/$exe");

The last path in MySQL's version is where replace actually is.

Comment by Otto Kekäläinen [ 2014-12-28 ]

I bumped into the same issue when packaging an 5.5.40 -> 5.5.41 upgrade for Ubuntu, see log at http://paste.debian.net/138376/

I tried the fix above, using both $basedir and $bindir, but those didn't have any effect. So I ended up with this patch: https://github.com/ottok/mariadb-5.5/commit/e06840b

Now it works (or at least for me): http://labs.seravo.fi/~otto/mariadb-repo/mariadb-5.5-sid-amd64/mariadb-5.5_5.5.41-1_amd64.build-e06840b-pbuilder.log

Comment by Elena Stepanova [ 2014-12-28 ]

For clarification, my comment above was not a fix, it was an observation regarding why MySQL's version works, while MariaDB's fails. I chose not to fix it, because I didn't know (right away) what caused MySQL's version have $bindir there, while MariaDB's one has $basedir. I can dig into it, but I thought serg might know it already if the changes were his.

I did hope that the workaround with adding the extra line would work, though..

Comment by Elena Stepanova [ 2015-02-09 ]

The problem was fixed in this revision: http://bazaar.launchpad.net/~maria-captains/maria/5.5/revision/4399 (apparently as a side change)

=== modified file 'mysql-test/mysql-test-run.pl'
--- mysql-test/mysql-test-run.pl	2014-12-19 10:35:44 +0000
+++ mysql-test/mysql-test-run.pl	2015-01-06 15:32:41 +0000
@@ -2495,6 +2495,7 @@
   # ----------------------------------------------------
   my $exe_replace= mtr_exe_exists(vs_config_dirs('extra', 'replace'),
                                  "$basedir/extra/replace",
+                                 "$bindir/extra$opt_vs_config/replace",
                                  "$path_client_bindir/replace");
   $ENV{'REPLACE'}= native_path($exe_replace);

Generated at Thu Feb 08 07:18:59 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.