[Buildroot] [PATCH 1/1] Config.in: add option to only use ccache for BR

Thomas Petazzoni thomas.petazzoni at bootlin.com
Wed Jul 27 18:37:44 UTC 2022


Hello Paul,

On Thu, 13 Jan 2022 21:04:31 +0000
Paul Cercueil <paul at crapouillou.net> wrote:

> Add an option, disabled by default, to only use ccache for Buildroot
> packages.
> 
> When enabled, ccache will be used when building Buildroot itself, but
> the toolchain exported as SDK will not make use of ccache to build
> external programs, unless the "BR_USE_CCACHE" environment variable is
> set.
> 
> The motivation behind this change is to be able to speed up iterative
> building of a Buildroot based distribution, without forcing the users of
> the SDK to use ccache, which has the problem of clobbering the
> filesystem in a hidden directory if the cache directory is left as
> default, or trying to access a cache folder that existed on the machine
> that built the SDK but which may not exist on the machine on which it
> was later installed.
> 
> Signed-off-by: Paul Cercueil <paul at crapouillou.net>
> ---
>  Config.in                      | 9 +++++++++
>  linux/linux.mk                 | 4 ++++
>  package/Makefile.in            | 4 ++++
>  toolchain/toolchain-wrapper.c  | 5 +++++
>  toolchain/toolchain-wrapper.mk | 4 ++++
>  5 files changed, 26 insertions(+)

We have applied your patch, but with some significant change.

We have dropped the Config.in option, as we believe the SDK should not
use ccache in general. We have introduce a BR2_USE_CCACHE variable (not
a Config.in option!) which when set to 1 tells the wrapper to use
ccache. Buildroot defines/exports this variable globally in its
Makefile, so that during the Buildroot build ccache is used (if
enabled, of course). ccache is not used in the SDK situation, unless
explicitly overridden with BR2_USE_CCACHE=1.

Thanks to that, we could also remove the BR_NO_CCACHE variable, so that
we don't have two confusing variables doing almost the same thing.

See
https://git.buildroot.org/buildroot/commit/?id=d5c0eaef1f7c3b705cc1cf3087bd83ad9098aa2f
for the final implementation.

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



More information about the buildroot mailing list