AdaCore / gprbuild

GPRbuild is an advanced build system designed to help automate the construction of multi-language systems.
Other
65 stars 21 forks source link

gprbuild and ccache #75

Closed maxime-esa closed 4 years ago

maxime-esa commented 4 years ago

On my system I am using ccache (https://ccache.dev) to speed-up the recompilation of files.

This seems not compatible with gprbuild. Using strace on the invocation of gprbuild shows that ccache is called but it does not find any cached files:

 execve("/usr/lib/ccache/gcc", ["/usr/lib/ccache/gcc", "-c", "-x", "c", "-g", "-DTARGET=native", "-DPOSIX", "-D_POSIX_SOURCE", "-D_GNU_SOURCE", "-Wall", "-Wextra", "-fdiagnostics-show-option", "-Wcast-align", "-Wswitch", "-DSTATIC=", "-MMD", "-MF", "obsw_demonstrator_polyorb_interf"..., "-specs=/tmp/GNAT-TEMP-000010.TMP", "/home/taste/tool-src/kazoo/test/"...], 0x1e24620 /* 37 vars */ <unfinished ...>

I am suspecting the the issue comes from the "-specs=/tmp/GNAT-TEMP-random-number.TMP' since it is different at each call. As I understand it, ccache works by caching the complete command line to gcc - if there is a difference it will recompile the file.

Is there any way to avoid the -specs options and have all options in the command line? ..Alternatively to use a deterministic specs file name that would be the same whenever compiling the same file?

Thanks

t-14 commented 4 years ago

Is there any way to avoid the -specs options and have all options in the command line?

Yes, you should be able to inhibit it by setting Compiler'Max_Command_Line_Length attribute to a generous value:

  package Compiler is
      for Max_Command_Line_Length use "131072";
   end Compiler;
maxime-esa commented 4 years ago

OK, thanks for the tip!