Bug #89251 Fix patterns in main.file_contents
Submitted: 15 Jan 2018 16:23 Modified: 29 May 2018 8:44
Reporter: Alexey Kopytov Email Updates:
Status: Closed Impact on me:
None 
Category:Tools: MTR / mysql-test-run Severity:S3 (Non-critical)
Version:5.7, 8.0 OS:Any
Assigned to: CPU Architecture:Any

[15 Jan 2018 16:23] Alexey Kopytov
Description:
The main.file_contents MTR test uses some heuristic to find INFO_SRC and
INFO_BIN files. If $MYSQL_BINDIR (e.g. installation root) contains
"/usr/", then the installation is assumed to be an RPM package, if it
ends with "/usr", it is considered to be an RPM build during
development, otherwise it is considered to be a "tar.gz package,
Windows, or developer work (in git)".

I'm building an RPM package with "/build/usr/src/debug" as 'builddir'
root (the fact that "/usr/src/debug" is there is a workaround for
another problem). Which means the release build happens in under
/build/usr/src/debug/mysql-5.7.20/release. When MTR tests are started in
that directory as a part of RPM build check, main.file_contents fails,
because it looks for INFO_SRC and INFO_BIN under
/build/usr/src/debug/mysql-5.7.20/release/share/mysql/docs assuming it
is running from and RPM installation, which is wrong. It is in fact
running from a source directory, so those files are found under
/build/usr/src/debug/mysql-5.7.20/release/Docs.

This is a request to make those patterns in main.file_contents more
specific, i.e. "^/usr/" and "^/usr$", so that paths like
"/build/usr/src/debug/mysql-5.7.20/release" fall into the third
".tar.gz, Windows, developer work" case. 

How to repeat:
Try something like the following on a MySQL src.rpm:

rpmbuild \
  --define '_topdir /build' \
  --define '_sourcedir /build' \
  --define '_specdir /build' \
  --define '_srcrpmdir /build' \
  --define '_builddir /build/usr/src/debug' \
  --define 'runselftest 1' \
  --rebuild

Suggested fix:
See above.
[17 Jan 2018 7:48] MySQL Verification Team
Hello Alexey,

Thank you for the report.
Verifying as a request to make those patterns in main.file_contents more
specific, i.e. "^/usr/" and "^/usr$

Thanks,
Umesh
[28 May 2018 21:20] Alexey Kopytov
This has been fixed in 8.0 with the following commit:

commit 1de595eae9d8eb9310130bb3fba54aa5a5ce7047
Author: Terje Rosten <terje.rosten@oracle.com>
Date:   Mon Feb 12 12:08:55 2018 +0100

    Bug#26990531 SUPPORT FOR VERSION NUMBER IN SHARE DIRECTORY
    
    For various reasons some install layouts might want to set
    -DINSTALL_MYSQLSHAREDIR=share/mysql-8.0,
    
    Switch RPM to use such layout by default.
    Adjust MTR to work with this choice too.
[29 May 2018 8:44] Terje Røsten
Thanks for heads up, change is unlikely to go to 5.7 for now, closing report.