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:
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
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>

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

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
[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

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

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:


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 :-)