All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0 of 2 v3] Fix pkg-kconfig infra
@ 2014-08-05 10:36 Thomas De Schampheleire
  2014-08-05 10:36 ` [Buildroot] [PATCH 1 of 2 v3] infra/pkg-kconfig: join comments to the related code-block Thomas De Schampheleire
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Thomas De Schampheleire @ 2014-08-05 10:36 UTC (permalink / raw)
  To: buildroot

This series fixes a nasty regression introduced with the pkg-kconfig
infrastructure recently applied, whereby kconfig packages are always
rebuilt on each 'make', as detected by Yann.

This series incorporates an alternative solution than v2 sent out by Yann.
Instead of re-touching the stamp file, make sure that such timing problems
cannot occur by calling 'make oldconfig' from within pkg-kconfig itself,
instead of from the package. Looking at the to-be-converted linux package,
oldconfig is also run there, so it makes sense to add this to pkg-kconfig.

Contrary to Yann's solution, if a package makes another change to .config
from the configure script, a rebuild will happen still. I consider that an
error in the package. Any 'fixup' of the config is supposed to be in the
KCONFIG_FIXUP_CMDS.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

---
Yann E. Morin (1)
  infra/pkg-kconfig: join comments to the related code-block

Thomas De Schampheleire (1)
  infra/pkg-kconfig: incorporate oldconfig call to avoid endless rebuilds

 package/busybox/busybox.mk |  2 --
 package/pkg-kconfig.mk     |  9 ++-------
 package/uclibc/uclibc.mk   |  6 ------
 3 files changed, 2 insertions(+), 15 deletions(-)

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

* [Buildroot] [PATCH 1 of 2 v3] infra/pkg-kconfig: join comments to the related code-block
  2014-08-05 10:36 [Buildroot] [PATCH 0 of 2 v3] Fix pkg-kconfig infra Thomas De Schampheleire
@ 2014-08-05 10:36 ` Thomas De Schampheleire
  2014-08-05 10:36 ` [Buildroot] [PATCH 2 of 2 v3] infra/pkg-kconfig: incorporate oldconfig call to avoid endless rebuilds Thomas De Schampheleire
  2014-08-06 17:58 ` [Buildroot] [PATCH 0 of 2 v3] Fix pkg-kconfig infra Thomas Petazzoni
  2 siblings, 0 replies; 6+ messages in thread
From: Thomas De Schampheleire @ 2014-08-05 10:36 UTC (permalink / raw)
  To: buildroot

From: "Yann E. MORIN" <yann.morin.1998@free.fr>

The current layout of comments wrt. to the related code-blocks is a bit
hard to handle visually.

Remove empty lines between the comments and their respective related
code-blocks.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Acked-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

---
v3: no changes

 package/pkg-kconfig.mk | 7 -------
 1 file changed, 7 deletions(-)

diff -r df91fcff2e1a -r f81734945d5b package/pkg-kconfig.mk
--- a/package/pkg-kconfig.mk	Wed Apr 30 16:21:53 2014 +0200
+++ b/package/pkg-kconfig.mk	Tue Aug 05 00:06:57 2014 +0200
@@ -32,36 +32,30 @@
 $(call inner-generic-package,$(1),$(2),$(3),$(4))
 
 # Default values
-
 $(2)_KCONFIG_EDITORS ?= menuconfig
 $(2)_KCONFIG_OPT ?=
 $(2)_KCONFIG_FIXUP_CMDS ?=
 
 # FOO_KCONFIG_FILE is required
-
 ifndef $(2)_KCONFIG_FILE
 $$(error Internal error: no value specified for $(2)_KCONFIG_FILE)
 endif
 
 # The .config file is obtained by copying it from the specified source
 # configuration file, after the package has been patched.
-
 $$($(2)_DIR)/.config: $$($(2)_KCONFIG_FILE) | $(1)-patch
 	$$(INSTALL) -m 0644 $$($(2)_KCONFIG_FILE) $$($(2)_DIR)/.config
 
 # In order to get a usable, consistent configuration, some fixup may be needed.
 # The exact rules are specified by the package .mk file.
-
 $$($(2)_DIR)/.stamp_kconfig_fixup_done: $$($(2)_DIR)/.config
 	$$($(2)_KCONFIG_FIXUP_CMDS)
 	$$(Q)touch $$@
 
 # Before running configure, the configuration file should be present and fixed
-
 $$($(2)_TARGET_CONFIGURE): $$($(2)_DIR)/.stamp_kconfig_fixup_done
 
 # Configuration editors (menuconfig, ...)
-
 $$(addprefix $(1)-,$$($(2)_KCONFIG_EDITORS)): $$($(2)_DIR)/.stamp_kconfig_fixup_done
 	$$($(2)_MAKE_ENV) $$(MAKE) -C $$($(2)_DIR) \
 		$$($(2)_KCONFIG_OPT) $$(subst $(1)-,,$$@)
@@ -69,7 +63,6 @@
 	rm -f $$($(2)_DIR)/.stamp_{target,staging}_installed
 
 # 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)
 

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

* [Buildroot] [PATCH 2 of 2 v3] infra/pkg-kconfig: incorporate oldconfig call to avoid endless rebuilds
  2014-08-05 10:36 [Buildroot] [PATCH 0 of 2 v3] Fix pkg-kconfig infra Thomas De Schampheleire
  2014-08-05 10:36 ` [Buildroot] [PATCH 1 of 2 v3] infra/pkg-kconfig: join comments to the related code-block Thomas De Schampheleire
@ 2014-08-05 10:36 ` Thomas De Schampheleire
  2014-08-05 19:27   ` Yann E. MORIN
  2014-08-06 17:58 ` [Buildroot] [PATCH 0 of 2 v3] Fix pkg-kconfig infra Thomas Petazzoni
  2 siblings, 1 reply; 6+ messages in thread
From: Thomas De Schampheleire @ 2014-08-05 10:36 UTC (permalink / raw)
  To: buildroot

The configure step of the busybox package performs 'make oldconfig', which
causes the .config file to be updated. Thus, the .config file is more recent
than our stamp file .stamp_kconfig_fixup_done. On a subsequent build, our
dependency rules would kick in, and run the config fixup again, thus
kicking in the package's configure, build and install steps yet once
more, that, ad infinitum.

One solution is to modify kconfig-package to introduce an explicit touch of
the .kconfig_fixup_config_done stamp file, as post-configure hook.

Another solution, implemented by this patch, is to move the oldconfig call
from the package's .mk file to the kconfig-package infrastructure and make
sure it is done as part of the fixup commands. This way, the stamp file will
only be touched once, after the full fixup (including oldconfig) and no
endless rebuilds will occur.

Reported-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Suggested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

---
v3: implement alternative implementation

 package/busybox/busybox.mk |  2 --
 package/pkg-kconfig.mk     |  9 ++-------
 package/uclibc/uclibc.mk   |  6 ------
 3 files changed, 2 insertions(+), 15 deletions(-)

diff -r f81734945d5b -r 707fc324a92e package/busybox/busybox.mk
--- a/package/busybox/busybox.mk	Tue Aug 05 00:06:57 2014 +0200
+++ b/package/busybox/busybox.mk	Tue Aug 05 11:39:06 2014 +0200
@@ -205,8 +205,6 @@
 endef
 
 define BUSYBOX_CONFIGURE_CMDS
-	@yes "" | $(MAKE) ARCH=$(KERNEL_ARCH) CROSS_COMPILE="$(TARGET_CROSS)" \
-		-C $(@D) oldconfig
 	$(BUSYBOX_NOCLOBBER_INSTALL)
 endef
 
diff -r f81734945d5b -r 707fc324a92e package/pkg-kconfig.mk
--- a/package/pkg-kconfig.mk	Tue Aug 05 00:06:57 2014 +0200
+++ b/package/pkg-kconfig.mk	Tue Aug 05 11:39:06 2014 +0200
@@ -50,6 +50,8 @@
 # The exact rules are specified by the package .mk file.
 $$($(2)_DIR)/.stamp_kconfig_fixup_done: $$($(2)_DIR)/.config
 	$$($(2)_KCONFIG_FIXUP_CMDS)
+	@yes "" | $$($(2)_MAKE_ENV) $$(MAKE) -C $$($(2)_DIR) \
+		$$($(2)_KCONFIG_OPT) oldconfig
 	$$(Q)touch $$@
 
 # Before running configure, the configuration file should be present and fixed
diff -r f81734945d5b -r 707fc324a92e package/uclibc/uclibc.mk
--- a/package/uclibc/uclibc.mk	Tue Aug 05 00:06:57 2014 +0200
+++ b/package/uclibc/uclibc.mk	Tue Aug 05 11:39:06 2014 +0200
@@ -431,12 +431,6 @@
 	$(UCLIBC_LOCALE_CONFIG)
 	$(UCLIBC_WCHAR_CONFIG)
 	$(UCLIBC_STRIP_CONFIG)
-	yes "" | $(MAKE1) -C $(@D) \
-		$(UCLIBC_MAKE_FLAGS) \
-		PREFIX=$(STAGING_DIR) \
-		DEVEL_PREFIX=/usr/ \
-		RUNTIME_PREFIX=$(STAGING_DIR) \
-		oldconfig
 endef
 
 define UCLIBC_CONFIGURE_CMDS

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

* [Buildroot] [PATCH 2 of 2 v3] infra/pkg-kconfig: incorporate oldconfig call to avoid endless rebuilds
  2014-08-05 10:36 ` [Buildroot] [PATCH 2 of 2 v3] infra/pkg-kconfig: incorporate oldconfig call to avoid endless rebuilds Thomas De Schampheleire
@ 2014-08-05 19:27   ` Yann E. MORIN
  2014-08-05 19:37     ` Thomas De Schampheleire
  0 siblings, 1 reply; 6+ messages in thread
From: Yann E. MORIN @ 2014-08-05 19:27 UTC (permalink / raw)
  To: buildroot

Thomas?, All,

On 2014-08-05 12:36 +0200, Thomas De Schampheleire spake thusly:
> The configure step of the busybox package performs 'make oldconfig', which
> causes the .config file to be updated. Thus, the .config file is more recent
> than our stamp file .stamp_kconfig_fixup_done. On a subsequent build, our
> dependency rules would kick in, and run the config fixup again, thus
> kicking in the package's configure, build and install steps yet once
> more, that, ad infinitum.
> 
> One solution is to modify kconfig-package to introduce an explicit touch of
> the .kconfig_fixup_config_done stamp file, as post-configure hook.
> 
> Another solution, implemented by this patch, is to move the oldconfig call
> from the package's .mk file to the kconfig-package infrastructure and make
> sure it is done as part of the fixup commands. This way, the stamp file will
> only be touched once, after the full fixup (including oldconfig) and no
> endless rebuilds will occur.
> 
> Reported-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Suggested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>

[tested with running multiple 'make' in sequence; tested that
 busybox-menuconfig still forces a fixup and a rebuild]
Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Regards,
Yann E. MORIN.

> ---
> v3: implement alternative implementation
> 
>  package/busybox/busybox.mk |  2 --
>  package/pkg-kconfig.mk     |  9 ++-------
>  package/uclibc/uclibc.mk   |  6 ------
>  3 files changed, 2 insertions(+), 15 deletions(-)
> 
> diff -r f81734945d5b -r 707fc324a92e package/busybox/busybox.mk
> --- a/package/busybox/busybox.mk	Tue Aug 05 00:06:57 2014 +0200
> +++ b/package/busybox/busybox.mk	Tue Aug 05 11:39:06 2014 +0200
> @@ -205,8 +205,6 @@
>  endef
>  
>  define BUSYBOX_CONFIGURE_CMDS
> -	@yes "" | $(MAKE) ARCH=$(KERNEL_ARCH) CROSS_COMPILE="$(TARGET_CROSS)" \
> -		-C $(@D) oldconfig
>  	$(BUSYBOX_NOCLOBBER_INSTALL)
>  endef
>  
> diff -r f81734945d5b -r 707fc324a92e package/pkg-kconfig.mk
> --- a/package/pkg-kconfig.mk	Tue Aug 05 00:06:57 2014 +0200
> +++ b/package/pkg-kconfig.mk	Tue Aug 05 11:39:06 2014 +0200
> @@ -50,6 +50,8 @@
>  # The exact rules are specified by the package .mk file.
>  $$($(2)_DIR)/.stamp_kconfig_fixup_done: $$($(2)_DIR)/.config
>  	$$($(2)_KCONFIG_FIXUP_CMDS)
> +	@yes "" | $$($(2)_MAKE_ENV) $$(MAKE) -C $$($(2)_DIR) \
> +		$$($(2)_KCONFIG_OPT) oldconfig
>  	$$(Q)touch $$@
>  
>  # Before running configure, the configuration file should be present and fixed
> diff -r f81734945d5b -r 707fc324a92e package/uclibc/uclibc.mk
> --- a/package/uclibc/uclibc.mk	Tue Aug 05 00:06:57 2014 +0200
> +++ b/package/uclibc/uclibc.mk	Tue Aug 05 11:39:06 2014 +0200
> @@ -431,12 +431,6 @@
>  	$(UCLIBC_LOCALE_CONFIG)
>  	$(UCLIBC_WCHAR_CONFIG)
>  	$(UCLIBC_STRIP_CONFIG)
> -	yes "" | $(MAKE1) -C $(@D) \
> -		$(UCLIBC_MAKE_FLAGS) \
> -		PREFIX=$(STAGING_DIR) \
> -		DEVEL_PREFIX=/usr/ \
> -		RUNTIME_PREFIX=$(STAGING_DIR) \
> -		oldconfig
>  endef
>  
>  define UCLIBC_CONFIGURE_CMDS

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH 2 of 2 v3] infra/pkg-kconfig: incorporate oldconfig call to avoid endless rebuilds
  2014-08-05 19:27   ` Yann E. MORIN
@ 2014-08-05 19:37     ` Thomas De Schampheleire
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas De Schampheleire @ 2014-08-05 19:37 UTC (permalink / raw)
  To: buildroot

"Yann E. MORIN" <yann.morin.1998@free.fr> schreef:
>Thomas?, All,
>
>On 2014-08-05 12:36 +0200, Thomas De Schampheleire spake thusly:
>> The configure step of the busybox package performs 'make oldconfig', which
>> causes the .config file to be updated. Thus, the .config file is more recent
>> than our stamp file .stamp_kconfig_fixup_done. On a subsequent build, our
>> dependency rules would kick in, and run the config fixup again, thus
>> kicking in the package's configure, build and install steps yet once
>> more, that, ad infinitum.
>> 
>> One solution is to modify kconfig-package to introduce an explicit touch of
>> the .kconfig_fixup_config_done stamp file, as post-configure hook.
>> 
>> Another solution, implemented by this patch, is to move the oldconfig call
>> from the package's .mk file to the kconfig-package infrastructure and make
>> sure it is done as part of the fixup commands. This way, the stamp file will
>> only be touched once, after the full fixup (including oldconfig) and no
>> endless rebuilds will occur.
>> 
>> Reported-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
>> Suggested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
>> Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
>
>[tested with running multiple 'make' in sequence; tested that
> busybox-menuconfig still forces a fixup and a rebuild]
>Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
>Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
>
>Regards,
>Yann E. MORIN.
>
>> ---
>> v3: implement alternative implementation
>> 
>>  package/busybox/busybox.mk |  2 --
>>  package/pkg-kconfig.mk     |  9 ++-------
>>  package/uclibc/uclibc.mk   |  6 ------
>>  3 files changed, 2 insertions(+), 15 deletions(-)
>> 
>> diff -r f81734945d5b -r 707fc324a92e package/busybox/busybox.mk
>> --- a/package/busybox/busybox.mk	Tue Aug 05 00:06:57 2014 +0200
>> +++ b/package/busybox/busybox.mk	Tue Aug 05 11:39:06 2014 +0200
>> @@ -205,8 +205,6 @@
>>  endef
>>  
>>  define BUSYBOX_CONFIGURE_CMDS
>> -	@yes "" | $(MAKE) ARCH=$(KERNEL_ARCH) CROSS_COMPILE="$(TARGET_CROSS)" \
>> -		-C $(@D) oldconfig
>>  	$(BUSYBOX_NOCLOBBER_INSTALL)
>>  endef
>>  
>> diff -r f81734945d5b -r 707fc324a92e package/pkg-kconfig.mk
>> --- a/package/pkg-kconfig.mk	Tue Aug 05 00:06:57 2014 +0200
>> +++ b/package/pkg-kconfig.mk	Tue Aug 05 11:39:06 2014 +0200
>> @@ -50,6 +50,8 @@
>>  # The exact rules are specified by the package .mk file.
>>  $$($(2)_DIR)/.stamp_kconfig_fixup_done: $$($(2)_DIR)/.config
>>  	$$($(2)_KCONFIG_FIXUP_CMDS)
>> +	@yes "" | $$($(2)_MAKE_ENV) $$(MAKE) -C $$($(2)_DIR) \
>> +		$$($(2)_KCONFIG_OPT) oldconfig
>>  	$$(Q)touch $$@
>>  
>>  # Before running configure, the configuration file should be present and fixed
>> diff -r f81734945d5b -r 707fc324a92e package/uclibc/uclibc.mk
>> --- a/package/uclibc/uclibc.mk	Tue Aug 05 00:06:57 2014 +0200
>> +++ b/package/uclibc/uclibc.mk	Tue Aug 05 11:39:06 2014 +0200
>> @@ -431,12 +431,6 @@
>>  	$(UCLIBC_LOCALE_CONFIG)
>>  	$(UCLIBC_WCHAR_CONFIG)
>>  	$(UCLIBC_STRIP_CONFIG)
>> -	yes "" | $(MAKE1) -C $(@D) \
>> -		$(UCLIBC_MAKE_FLAGS) \
>> -		PREFIX=$(STAGING_DIR) \
>> -		DEVEL_PREFIX=/usr/ \
>> -		RUNTIME_PREFIX=$(STAGING_DIR) \
>> -		oldconfig
>>  endef

One small note that I did not explicitly mention in the
commit message: this MAKE1 becomes a MAKE in the infra. I don't think this a problem, but full disclosure...

Best regards,
Thomas

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

* [Buildroot] [PATCH 0 of 2 v3] Fix pkg-kconfig infra
  2014-08-05 10:36 [Buildroot] [PATCH 0 of 2 v3] Fix pkg-kconfig infra Thomas De Schampheleire
  2014-08-05 10:36 ` [Buildroot] [PATCH 1 of 2 v3] infra/pkg-kconfig: join comments to the related code-block Thomas De Schampheleire
  2014-08-05 10:36 ` [Buildroot] [PATCH 2 of 2 v3] infra/pkg-kconfig: incorporate oldconfig call to avoid endless rebuilds Thomas De Schampheleire
@ 2014-08-06 17:58 ` Thomas Petazzoni
  2 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2014-08-06 17:58 UTC (permalink / raw)
  To: buildroot

Dear Thomas De Schampheleire,

On Tue, 05 Aug 2014 12:36:51 +0200, Thomas De Schampheleire wrote:

> Yann E. Morin (1)
>   infra/pkg-kconfig: join comments to the related code-block
> 
> Thomas De Schampheleire (1)
>   infra/pkg-kconfig: incorporate oldconfig call to avoid endless rebuilds

Thanks, series applied.

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

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

end of thread, other threads:[~2014-08-06 17:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-05 10:36 [Buildroot] [PATCH 0 of 2 v3] Fix pkg-kconfig infra Thomas De Schampheleire
2014-08-05 10:36 ` [Buildroot] [PATCH 1 of 2 v3] infra/pkg-kconfig: join comments to the related code-block Thomas De Schampheleire
2014-08-05 10:36 ` [Buildroot] [PATCH 2 of 2 v3] infra/pkg-kconfig: incorporate oldconfig call to avoid endless rebuilds Thomas De Schampheleire
2014-08-05 19:27   ` Yann E. MORIN
2014-08-05 19:37     ` Thomas De Schampheleire
2014-08-06 17:58 ` [Buildroot] [PATCH 0 of 2 v3] Fix pkg-kconfig infra 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.