All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v3 1/2] ccache: change default cache directory path to match config setting
@ 2014-05-01  2:05 Danomi Manchego
  2014-05-01  2:05 ` [Buildroot] [PATCH v3 2/2] ccache: provide capability to do initial ccache setup Danomi Manchego
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Danomi Manchego @ 2014-05-01  2:05 UTC (permalink / raw)
  To: buildroot

Commit 433290761fceb476b095548eec10adf72405e050 changed the hard-coded
ccache directory location to use BR_CACHE_DIR (then BUILDROOT_CACHE_DIR),
which is exported by Makefile based on the BR2_CCACHE_DIR config option.
This allowed the cache location to be changed on-the-fly by setting a
"make" command line variable, but left the default location of ccache's
normal default at "$HOME/.ccache".  Since this location does not match the
default for BR2_CCACHE_DIR, it is basically almost never correct, so
direct invocation of ccache outside of the buildroot Makefile, such as for
increasing the cache size, becomes cumbersome.

This patch changes the last-ditch cache location from "$HOME/.ccache" to
the BR_CCACHE_DIR value defined when host-ccache is configured.  Note that
the ability to later override the cache location by using a BR_CACHE_DIR
command line variable is left intact.

Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>

---

Changes v2 -> v3:
* n/a

Changes v1 -> v2:
* Refresh against latest, rather than building on top of unrelated WIP patch.
* Update patch commit log wording.
---
 package/ccache/ccache.mk |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/package/ccache/ccache.mk b/package/ccache/ccache.mk
index 650290d..df92c5e 100644
--- a/package/ccache/ccache.mk
+++ b/package/ccache/ccache.mk
@@ -30,9 +30,12 @@ HOST_CCACHE_CONF_OPT += ccache_cv_zlib_1_2_3=no
 #    the compiler, because in the context of Buildroot, that completely
 #    defeats the purpose of ccache. Of course, that leaves the user
 #    responsible for purging its cache when the compiler changes.
+#  - Change hard-coded last-ditch default to match path in .config, to avoid
+#    the need to specify BR_CACHE_DIR when invoking ccache directly.
 define HOST_CCACHE_PATCH_CONFIGURATION
 	sed -i 's,getenv("CCACHE_DIR"),getenv("BR_CACHE_DIR"),' $(@D)/ccache.c
 	sed -i 's,getenv("CCACHE_COMPILERCHECK"),"none",' $(@D)/ccache.c
+	sed -i 's,"%s/.ccache","$(BR_CACHE_DIR)",' $(@D)/ccache.c
 endef
 
 HOST_CCACHE_POST_CONFIGURE_HOOKS += \
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH v3 2/2] ccache: provide capability to do initial ccache setup
  2014-05-01  2:05 [Buildroot] [PATCH v3 1/2] ccache: change default cache directory path to match config setting Danomi Manchego
@ 2014-05-01  2:05 ` Danomi Manchego
  2014-05-02  8:29   ` Thomas De Schampheleire
  2014-06-14 18:01   ` Thomas Petazzoni
  2014-05-01  5:52 ` [Buildroot] [PATCH v3 1/2] ccache: change default cache directory path to match config setting Thomas De Schampheleire
  2014-06-14 17:58 ` Thomas Petazzoni
  2 siblings, 2 replies; 8+ messages in thread
From: Danomi Manchego @ 2014-05-01  2:05 UTC (permalink / raw)
  To: buildroot

For example, if your project is known to require more space than the
default max cache size, then you might want to increase the cache size
to a suitable amount using the -M (--max-size) option.

The string you specify here is passed verbatim to ccache.  Refer to
ccache documentation for more details.

These initial settings are applied after ccache has been compiled.

Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>

---

Changes v2 -> v3:
* Change based on suggestions from Thomas De Schampheleire
  * Config.in: use 'if BR2_CCACHE' around ccache options instead of individual 'depends on BR2_CCACHE' conditions
  * Config.in: reword description of new otption
  * ccache.mk: correct typo in variable name
  * ccache.mk: adjust message text

Changes v1 -> v2:
* Refresh against latest
* Also, remove needless line-breaks in existing hooks
---
 Config.in                |   21 +++++++++++++++++++--
 package/ccache/ccache.mk |   18 ++++++++++++++----
 2 files changed, 33 insertions(+), 6 deletions(-)

diff --git a/Config.in b/Config.in
index 5823274..d4ea100 100644
--- a/Config.in
+++ b/Config.in
@@ -256,7 +256,7 @@ config BR2_CCACHE
 	help
 	  This option will enable the use of ccache, a compiler
 	  cache. It will cache the result of previous builds to speed
-	  up future builds. The cache is stored in
+	  up future builds. By default, the cache is stored in
 	  $HOME/.buildroot-ccache.
 
 	  Note that Buildroot does not try to invalidate the cache
@@ -266,13 +266,30 @@ config BR2_CCACHE
 	  ccache cache by removing the $HOME/.buildroot-ccache
 	  directory.
 
+if BR2_CCACHE
+
 config BR2_CCACHE_DIR
 	string "Compiler cache location"
-	depends on BR2_CCACHE
 	default "$(HOME)/.buildroot-ccache"
 	help
 	  Where ccache should store cached files.
 
+config BR2_CCACHE_INITIAL_SETUP
+	string "Compiler cache initial setup"
+	help
+	  Initial ccache settings to apply, such as --max-files or --max-size.
+
+	  For example, if your project is known to require more space than the
+	  default max cache size, then you might want to increase the cache size
+	  to a suitable amount using the -M (--max-size) option.
+
+	  The string you specify here is passed verbatim to ccache.  Refer to
+	  ccache documentation for more details.
+
+	  These initial settings are applied after ccache has been compiled.
+
+endif
+
 config BR2_DEPRECATED
 	bool "Show packages that are deprecated or obsolete"
 	help
diff --git a/package/ccache/ccache.mk b/package/ccache/ccache.mk
index df92c5e..f1ec162 100644
--- a/package/ccache/ccache.mk
+++ b/package/ccache/ccache.mk
@@ -38,15 +38,25 @@ define HOST_CCACHE_PATCH_CONFIGURATION
 	sed -i 's,"%s/.ccache","$(BR_CACHE_DIR)",' $(@D)/ccache.c
 endef
 
-HOST_CCACHE_POST_CONFIGURE_HOOKS += \
-	HOST_CCACHE_PATCH_CONFIGURATION
+HOST_CCACHE_POST_CONFIGURE_HOOKS += HOST_CCACHE_PATCH_CONFIGURATION
 
 define HOST_CCACHE_MAKE_CACHE_DIR
 	mkdir -p $(BR_CACHE_DIR)
 endef
 
-HOST_CCACHE_POST_INSTALL_HOOKS += \
-	HOST_CCACHE_MAKE_CACHE_DIR
+HOST_CCACHE_POST_INSTALL_HOOKS += HOST_CCACHE_MAKE_CACHE_DIR
+
+# Provide capability to do initial ccache setup (e.g. increase default size)
+BR_CCACHE_INITIAL_SETUP = $(call qstrip,$(BR2_CCACHE_INITIAL_SETUP))
+ifneq ($(BR_CCACHE_INITIAL_SETUP),)
+define HOST_CCACHE_DO_INITIAL_SETUP
+	@$(call MESSAGE,"Applying initial settings")
+	$(CCACHE) $(BR_CCACHE_INITIAL_SETUP)
+	$(CCACHE) -s
+endef
+
+HOST_CCACHE_POST_INSTALL_HOOKS += HOST_CCACHE_DO_INITIAL_SETUP
+endif
 
 $(eval $(host-autotools-package))
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH v3 1/2] ccache: change default cache directory path to match config setting
  2014-05-01  2:05 [Buildroot] [PATCH v3 1/2] ccache: change default cache directory path to match config setting Danomi Manchego
  2014-05-01  2:05 ` [Buildroot] [PATCH v3 2/2] ccache: provide capability to do initial ccache setup Danomi Manchego
@ 2014-05-01  5:52 ` Thomas De Schampheleire
  2014-05-01 13:40   ` Danomi Manchego
  2014-06-14 17:58 ` Thomas Petazzoni
  2 siblings, 1 reply; 8+ messages in thread
From: Thomas De Schampheleire @ 2014-05-01  5:52 UTC (permalink / raw)
  To: buildroot

Danomi Manchego <danomimanchego123@gmail.com> schreef:
>Commit 433290761fceb476b095548eec10adf72405e050 changed the hard-coded
>ccache directory location to use BR_CACHE_DIR (then BUILDROOT_CACHE_DIR),
>which is exported by Makefile based on the BR2_CCACHE_DIR config option.
>This allowed the cache location to be changed on-the-fly by setting a
>"make" command line variable, but left the default location of ccache's
>normal default at "$HOME/.ccache".  Since this location does not match the
>default for BR2_CCACHE_DIR, it is basically almost never correct, so
>direct invocation of ccache outside of the buildroot Makefile, such as for
>increasing the cache size, becomes cumbersome.
>
>This patch changes the last-ditch cache location from "$HOME/.ccache" to
>the BR_CCACHE_DIR value defined when host-ccache is configured.  Note that
>the ability to later override the cache location by using a BR_CACHE_DIR
>command line variable is left intact.
>
>Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>

You  should have pasted my review and test tags here...

Reviewed-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Tested-by : Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH v3 1/2] ccache: change default cache directory path to match config setting
  2014-05-01  5:52 ` [Buildroot] [PATCH v3 1/2] ccache: change default cache directory path to match config setting Thomas De Schampheleire
@ 2014-05-01 13:40   ` Danomi Manchego
  2014-05-01 14:01     ` Thomas De Schampheleire
  0 siblings, 1 reply; 8+ messages in thread
From: Danomi Manchego @ 2014-05-01 13:40 UTC (permalink / raw)
  To: buildroot

Thomas,

On Thu, May 1, 2014 at 1:52 AM, Thomas De Schampheleire
<patrickdepinguin@gmail.com> wrote:
> You  should have pasted my review and test tags here...
>
> Reviewed-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
> Tested-by : Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

Such tags survive the rev process?  In this case, this patch didn't
change from v2 to v3, but in general, I thought it might be
disingenuous to claim those fields on rev X, when they were granted on
rev X-n ...

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH v3 1/2] ccache: change default cache directory path to match config setting
  2014-05-01 13:40   ` Danomi Manchego
@ 2014-05-01 14:01     ` Thomas De Schampheleire
  0 siblings, 0 replies; 8+ messages in thread
From: Thomas De Schampheleire @ 2014-05-01 14:01 UTC (permalink / raw)
  To: buildroot

Danomi Manchego <danomimanchego123@gmail.com> schreef:
>Thomas,
>
>On Thu, May 1, 2014 at 1:52 AM, Thomas De Schampheleire
><patrickdepinguin@gmail.com> wrote:
>> You  should have pasted my review and test tags here...
>>
>> Reviewed-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
>> Tested-by : Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
>
>Such tags survive the rev process?  In this case, this patch didn't
>change from v2 to v3, but in general, I thought it might be
>disingenuous to claim those fields on rev X, when they were granted on
>rev X-n ...

They only survive on unchanged revisions, which was the case on this first patch. Indeed for changed revisions, like the second patch, any tag should not be copy pasted as the content is different.

Best regards,
Thomas

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH v3 2/2] ccache: provide capability to do initial ccache setup
  2014-05-01  2:05 ` [Buildroot] [PATCH v3 2/2] ccache: provide capability to do initial ccache setup Danomi Manchego
@ 2014-05-02  8:29   ` Thomas De Schampheleire
  2014-06-14 18:01   ` Thomas Petazzoni
  1 sibling, 0 replies; 8+ messages in thread
From: Thomas De Schampheleire @ 2014-05-02  8:29 UTC (permalink / raw)
  To: buildroot

On Thu, May 1, 2014 at 4:05 AM, Danomi Manchego
<danomimanchego123@gmail.com> wrote:
> For example, if your project is known to require more space than the
> default max cache size, then you might want to increase the cache size
> to a suitable amount using the -M (--max-size) option.
>
> The string you specify here is passed verbatim to ccache.  Refer to
> ccache documentation for more details.
>
> These initial settings are applied after ccache has been compiled.
>
> Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>
>

Reviewed-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Tested-by : Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH v3 1/2] ccache: change default cache directory path to match config setting
  2014-05-01  2:05 [Buildroot] [PATCH v3 1/2] ccache: change default cache directory path to match config setting Danomi Manchego
  2014-05-01  2:05 ` [Buildroot] [PATCH v3 2/2] ccache: provide capability to do initial ccache setup Danomi Manchego
  2014-05-01  5:52 ` [Buildroot] [PATCH v3 1/2] ccache: change default cache directory path to match config setting Thomas De Schampheleire
@ 2014-06-14 17:58 ` Thomas Petazzoni
  2 siblings, 0 replies; 8+ messages in thread
From: Thomas Petazzoni @ 2014-06-14 17:58 UTC (permalink / raw)
  To: buildroot

Dear Danomi Manchego,

On Wed, 30 Apr 2014 22:05:06 -0400, Danomi Manchego wrote:
> Commit 433290761fceb476b095548eec10adf72405e050 changed the hard-coded
> ccache directory location to use BR_CACHE_DIR (then BUILDROOT_CACHE_DIR),
> which is exported by Makefile based on the BR2_CCACHE_DIR config option.
> This allowed the cache location to be changed on-the-fly by setting a
> "make" command line variable, but left the default location of ccache's
> normal default at "$HOME/.ccache".  Since this location does not match the
> default for BR2_CCACHE_DIR, it is basically almost never correct, so
> direct invocation of ccache outside of the buildroot Makefile, such as for
> increasing the cache size, becomes cumbersome.
> 
> This patch changes the last-ditch cache location from "$HOME/.ccache" to
> the BR_CCACHE_DIR value defined when host-ccache is configured.  Note that
> the ability to later override the cache location by using a BR_CACHE_DIR
> command line variable is left intact.
> 
> Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>

Applied, thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH v3 2/2] ccache: provide capability to do initial ccache setup
  2014-05-01  2:05 ` [Buildroot] [PATCH v3 2/2] ccache: provide capability to do initial ccache setup Danomi Manchego
  2014-05-02  8:29   ` Thomas De Schampheleire
@ 2014-06-14 18:01   ` Thomas Petazzoni
  1 sibling, 0 replies; 8+ messages in thread
From: Thomas Petazzoni @ 2014-06-14 18:01 UTC (permalink / raw)
  To: buildroot

Dear Danomi Manchego,

On Wed, 30 Apr 2014 22:05:07 -0400, Danomi Manchego wrote:
> For example, if your project is known to require more space than the
> default max cache size, then you might want to increase the cache size
> to a suitable amount using the -M (--max-size) option.
> 
> The string you specify here is passed verbatim to ccache.  Refer to
> ccache documentation for more details.
> 
> These initial settings are applied after ccache has been compiled.
> 
> Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>

Applied, thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-06-14 18:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-01  2:05 [Buildroot] [PATCH v3 1/2] ccache: change default cache directory path to match config setting Danomi Manchego
2014-05-01  2:05 ` [Buildroot] [PATCH v3 2/2] ccache: provide capability to do initial ccache setup Danomi Manchego
2014-05-02  8:29   ` Thomas De Schampheleire
2014-06-14 18:01   ` Thomas Petazzoni
2014-05-01  5:52 ` [Buildroot] [PATCH v3 1/2] ccache: change default cache directory path to match config setting Thomas De Schampheleire
2014-05-01 13:40   ` Danomi Manchego
2014-05-01 14:01     ` Thomas De Schampheleire
2014-06-14 17:58 ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.