* [Buildroot] [PATCH] infra/pkg-kconfig: fix saving the config file
@ 2014-10-20 20:23 Yann E. MORIN
2014-10-22 8:53 ` Thomas De Schampheleire
2014-10-22 20:51 ` Thomas Petazzoni
0 siblings, 2 replies; 3+ messages in thread
From: Yann E. MORIN @ 2014-10-20 20:23 UTC (permalink / raw)
To: buildroot
When saving (aka updating) the configuration file of a kconfig package,
a subsequent call to "make" would rebuild the package, even though the
configuration did not actually change.
It took quite a while to understand why. But the reason is so simple and
obvious, when you think about it:
- $(@D)/.config depends on the config file $(BUSYBOX_CONFIG_FILE)
- busybox-update-config then copies $(@D)/.config back to the config
file $(BUSYBOX_CONFIG_FILE)
- so the config file is newer than $(@D)/.config
So, in the next run, pkg-kconfig believes that it has to rebuild
busybox. Bummer... :-/
So, the fix is very trivial, and just requires asking "cp" to preserve
timestamps, so the dependency does not kick in at the next run.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com>
---
package/pkg-kconfig.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/pkg-kconfig.mk b/package/pkg-kconfig.mk
index 071153a..ec58d69 100644
--- a/package/pkg-kconfig.mk
+++ b/package/pkg-kconfig.mk
@@ -66,7 +66,7 @@ $$(addprefix $(1)-,$$($(2)_KCONFIG_EDITORS)): $$($(2)_DIR)/.stamp_kconfig_fixup_
# Target to copy back the configuration to the source configuration file
$(1)-update-config: $$($(2)_DIR)/.stamp_kconfig_fixup_done
- cp -f $$($(2)_DIR)/.config $$($(2)_KCONFIG_FILE)
+ cp --preserve=timestamps -f $$($(2)_DIR)/.config $$($(2)_KCONFIG_FILE)
endef # inner-kconfig-package
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH] infra/pkg-kconfig: fix saving the config file
2014-10-20 20:23 [Buildroot] [PATCH] infra/pkg-kconfig: fix saving the config file Yann E. MORIN
@ 2014-10-22 8:53 ` Thomas De Schampheleire
2014-10-22 20:51 ` Thomas Petazzoni
1 sibling, 0 replies; 3+ messages in thread
From: Thomas De Schampheleire @ 2014-10-22 8:53 UTC (permalink / raw)
To: buildroot
On Mon, Oct 20, 2014 at 10:23 PM, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> When saving (aka updating) the configuration file of a kconfig package,
> a subsequent call to "make" would rebuild the package, even though the
> configuration did not actually change.
>
> It took quite a while to understand why. But the reason is so simple and
> obvious, when you think about it:
>
> - $(@D)/.config depends on the config file $(BUSYBOX_CONFIG_FILE)
> - busybox-update-config then copies $(@D)/.config back to the config
> file $(BUSYBOX_CONFIG_FILE)
> - so the config file is newer than $(@D)/.config
>
> So, in the next run, pkg-kconfig believes that it has to rebuild
> busybox. Bummer... :-/
>
> So, the fix is very trivial, and just requires asking "cp" to preserve
> timestamps, so the dependency does not kick in at the next run.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com>
Reviewed-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH] infra/pkg-kconfig: fix saving the config file
2014-10-20 20:23 [Buildroot] [PATCH] infra/pkg-kconfig: fix saving the config file Yann E. MORIN
2014-10-22 8:53 ` Thomas De Schampheleire
@ 2014-10-22 20:51 ` Thomas Petazzoni
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2014-10-22 20:51 UTC (permalink / raw)
To: buildroot
Dear Yann E. MORIN,
On Mon, 20 Oct 2014 22:23:36 +0200, Yann E. MORIN wrote:
> When saving (aka updating) the configuration file of a kconfig package,
> a subsequent call to "make" would rebuild the package, even though the
> configuration did not actually change.
>
> It took quite a while to understand why. But the reason is so simple and
> obvious, when you think about it:
>
> - $(@D)/.config depends on the config file $(BUSYBOX_CONFIG_FILE)
> - busybox-update-config then copies $(@D)/.config back to the config
> file $(BUSYBOX_CONFIG_FILE)
> - so the config file is newer than $(@D)/.config
>
> So, in the next run, pkg-kconfig believes that it has to rebuild
> busybox. Bummer... :-/
>
> So, the fix is very trivial, and just requires asking "cp" to preserve
> timestamps, so the dependency does not kick in at the next run.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Thomas De Schampheleire <patrickdepinguin@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] 3+ messages in thread
end of thread, other threads:[~2014-10-22 20:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-20 20:23 [Buildroot] [PATCH] infra/pkg-kconfig: fix saving the config file Yann E. MORIN
2014-10-22 8:53 ` Thomas De Schampheleire
2014-10-22 20:51 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox