[Qbs] Qbs and ccache (and QtC)

Christian Kandeler christian.kandeler at qt.io
Thu Nov 23 10:52:58 CET 2017

On Thu, 23 Nov 2017 15:34:14 +1300
Christian Gagneraud <chgans at gmail.com> wrote:

> I just tried to enable ccache in QtCreator, and qbs failed complaining 
> it cannot find 'ar' and co.

This should be fixed for 1.10. Earlier versions assumed the binutils to be at the same location as the compiler, so you have to manually set cpp.archiverPath there (also stripPath, objcopyPath and nmPath).

> When i want to enable ccache, i use the export 
> PATH=/usr/lib/ccache:$PATH trick (which is IMHO the "proper" way to deal 
> with this on Linux).
> When i run QtC within this env, I can see new C/C++ compilers, eg. "GCC 
> (C++, x86 32bit in /usr/lib/ccache)" along "GCC (C++, x86 32bit in 
> /usr/bin)" - actually i'm not sure if they are auto-detected or if i set 
> that up myself some time ago.
> I then clone my Qt profile, change the C/C++ compilers to use the 
> ccache'd ones), and then simply rename the profile to "Qt X.Y (ccache)"
> When I select this Qt ccache'd profile, qbs complains that 
> /usr/lib/ccache/ar doesn't exists.
> The problem seems to stem from Qbs trying to infer the path to 'ar' 
> based on the path to gcc.
> Is this the right way to deal with ccache and QtC+Qbs?
> Should I open a bug report? On Qtc, Qbs or both?

Please double-check with an up to date version the tools.
Note that an alternative way to use ccache with qbs is to use the real gcc and set cpp.compilerWrapper to ccache.


More information about the Qbs mailing list