Bug #92927 compilation with ccache isn't possible
Submitted: 24 Oct 2018 12:45 Modified: 9 Mar 2019 18:31
Reporter: Steven Van Ingelgem Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:8.0.13 OS:Debian (stretch)
Assigned to: CPU Architecture:x86 (x86_64)
Tags: ccache

[24 Oct 2018 12:45] Steven Van Ingelgem
Description:
when you exposes ccache like this:

export PATH=/usr/lib/ccache:$PATH

The compilation fails with the following error:
/usr/bin/ccache: invalid option -- 'D'

This is the entry:
[..]/invoke-with-relative-paths.pl /usr/lib/ccache/cc  -DHAVE_CONFIG_H  [..]

Which is converted into
/usr/bin/ccache -DHAVE_CONFIG_H

This is because cc is defined as this:
/usr/lib/ccache/cc -> ../../bin/ccache

Cwd::abs_path will convert the cc-link to the ccache binary, in effect loosing required information for ccache.

How to repeat:
export PATH=/usr/lib/ccache:$PATH
cmake <options>
make

It will fail immediately with the first entry that uses "mysql/scripts/invoke-with-relative-paths.pl" to relativize paths.

Suggested fix:
Don't make the first parameter relative?
[24 Oct 2018 12:48] Steven Van Ingelgem
This change makes it work fine for me, but I don't know what the impact is to other people:

Index: ../mysql/scripts/invoke-with-relative-paths.pl
===================================================================
--- ../mysql/scripts/invoke-with-relative-paths.pl      (revision 4777)
+++ ../mysql/scripts/invoke-with-relative-paths.pl      (working copy)
@@ -41,8 +41,8 @@

 my $cwd = getcwd();

-my @newarg = ();
-for my $i (0..$#ARGV) {
+my @newarg = ($ARGV[0]);
+for my $i (1..$#ARGV) {
        my $arg = $ARGV[$i];
        if ($arg =~ /-I(.+)$/) {
                $arg = '-I' . relativize($1, $cwd);
[25 Oct 2018 9:07] Terje Røsten
Hi!

Thanks for your report!
[18 Jan 2019 18:29] Paul Dubois
Posted by developer:
 
Fixed in 8.0.16.

Commands for invoking ccache during MySQL builds were generated
incorrectly.
[21 Jan 2019 19:04] Paul Dubois
Posted by developer:
 
Fixed in 8.0.15, not 8.0.16.
[9 Mar 2019 9:12] Steven Van Ingelgem
Hello,

I just downloaded the 8.0.15-boost sources and compared them to the 8.0.14 sources, but not much has changed in there?
The change I proposed is not taken into account, and I don't see any changes to CMake files as well. So actually nothing in the build process is changed?

The only files I see that have changed are:
- sql\sql_yacc.h
- sql\sql_yacc.cc
- sql\sql_hints.yy.h
- sql\sql_hints.yy.cc
- plugin\group_replication\libmysqlgcs\src\bindings\xcom\xcom\xcom_base.c
- plugin\group_replication\libmysqlgcs\src\bindings\xcom\xcom\task.h
- plugin\group_replication\libmysqlgcs\src\bindings\xcom\xcom\task.c
- mysql-test\collections\default.release.done
- Docs\INFO_SRC
- VERSION

Furthermore, I do see that in the mysql-8.0.15 (without boost) there is an additional ndb storage, which is not present in the boost export. Is this intended?
[9 Mar 2019 18:14] Terje Røsten
Must be some confusion here, MySQL 8.0.15 contains one bug fix only:

 https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-15.html

I think issue here will be fixed in 8.0.16.
[9 Mar 2019 18:31] Steven Van Ingelgem
Thanks for the update! I'll wait a bit then :-)