Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] ccache dependency issues
Date: Thu, 1 Aug 2013 11:35:14 +0200	[thread overview]
Message-ID: <20130801113514.495c3b0d@skate> (raw)
In-Reply-To: <CAAXf6LWo29hYTDoGfmoQRV4krkhy_vCy7-irvB1qas6RuGbJsw@mail.gmail.com>

Dear Thomas De Schampheleire,

On Thu, 1 Aug 2013 11:26:33 +0200, Thomas De Schampheleire wrote:

> I have tested following patch successfully:
> > http://patchwork.ozlabs.org/patch/256744 tar: avoid ccache chicken and egg problem when bootstrapping tar
> 
> This patch changes package/tar/tar.mk to set the host compiler to
> HOSTCC_NOCCACHE. Thinking further however, I think there could be a
> better solution.
> 
> host-ccache is built is part of BASE_PKGS, which comes after the

I guess you meant BASE_TARGETS.

> 'dependencies' target. This means that when the dependencies are
> built, there will never be a ccache yet. Hence, a more global solution
> looks to be:
> 
> diff --git a/support/dependencies/dependencies.mk
> b/support/dependencies/dependencies.mk
> index a2d229c..6fd1df1 100644
> --- a/support/dependencies/dependencies.mk
> +++ b/support/dependencies/dependencies.mk
> @@ -25,6 +25,7 @@ core-dependencies:
>                 DL_TOOLS="$(sort $(DL_TOOLS_DEPENDENCIES))" \
>                 $(TOPDIR)/support/dependencies/dependencies.sh
> 
> +dependencies: HOSTCC=$(HOSTCC_NOCCACHE) HOSTCXX=$(HOSTCXX_NOCCACHE)
>  dependencies: core-dependencies $(DEPENDENCIES_HOST_PREREQ)
> 
>  dependencies-source:
> 
> Here we force HOSTCC and HOSTCXX to the no-ccache version, only during
> the dependencies step. This also fixes the host-tar/ccache chicken-egg
> problem (tested), and will also help with other dependencies (for
> example I assume that the host-xzcat will suffer from the same issue
> when ccache is enabled).
> 
> What do you think of this solution?

This indeed looks like a much better solution. I think it would be even
better if host-ccache was moved from BASE_TARGETS to
DEPENDENCIES_HOST_PREREQ. I.e, the main Makefile chunk

ifeq ($(BR2_CCACHE),y)
BASE_TARGETS += host-ccache
endif

would be moved to support/dependencies/dependencies.mk as:

ifeq ($(BR2_CCACHE),y)
DEPENDENCIES_HOST_PREREQ += host-ccache
endif

and then we can also remove the usage of HOSTCC_NOCCACHE from
package/ccache/ccache.mk.

This way, all the package that should not rely on ccache availability
are built as part of the 'dependencies' target, and as soon as we enter
$(BASE_TARGETS), we now that we have ccache available.

> Loosely related to this: it seems there also is a HOSTCPP variable,
> but it is never changed in the context of ccache settings (see e.g.
> Makefile), while it is passed to configure scripts of autotools
> packages. Shouldn't there be a HOSTCPP_NOCCACHE as well, to be
> correct?

Does executing cpp through ccache makes sense? For now, HOSTCPP is
always 'cpp', regardless of whether ccache is enabled or not, so there
should not be any problem.

Best regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

  reply	other threads:[~2013-08-01  9:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-01  9:26 [Buildroot] ccache dependency issues Thomas De Schampheleire
2013-08-01  9:35 ` Thomas Petazzoni [this message]
2013-08-01 10:08   ` Thomas De Schampheleire
2013-08-01 11:57     ` Thomas Petazzoni
2013-08-01 12:03       ` Thomas De Schampheleire
2013-08-01 12:07         ` Thomas Petazzoni
2013-08-01 12:51           ` Thomas De Schampheleire
2013-08-01 12:54             ` Thomas Petazzoni
2013-08-01 21:29               ` Thomas De Schampheleire

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130801113514.495c3b0d@skate \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox