Skip to contentSkip to conversation

Fix pkg-kconfig infra (branch yem/kconfig)

PATCH New Yann E. MORIN 2 participants 10 messages Aug 4, 2014

lore
Share & tools
lore
#0 lore raw

cover Fix pkg-kconfig infra (branch yem/kconfig)

Hello All!

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

The proposed fix consists in a post-configure hook, and I believe this is enough to get us rolling for the next release.

A better fix would be to move the call to 'oldocnifg' out of the packages, and into the kconfig infra itself, but this is a bit more involved. This could be done in -next (or maybe in master shortly after -rc1 if possible).

Regards,
Yann E. MORIN.

The following changes since commit 98a18ea01d7ea3f69bf5c44d48358dd110764c9c:

m2tools: fix MIA comment dependencies (2014-08-04 18:29:40 +0200)

are available in the git repository at:

git://gitorious.org/buildroot/buildroot.git yem/kconfig

for you to fetch changes up to fb48537ba04cc50d1f8043e5e347dedcdd5ba671:

infra/pkg-kconfig: do not rebuild kconfig packages again and again (2014-08-04 19:13:30 +0200)

----------------------------------------------------------------
Yann E. MORIN (2):
infra/pkg-kconfig: join comments to the related code-block infra/pkg-kconfig: do not rebuild kconfig packages again and again

 package/pkg-kconfig.mk | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'
#1 lore raw

PATCH 1/2 infra/pkg-kconfig: join comments to the related code-block

Some one-line comment apply to equally-onel-line code blocks, and thus the current layout is a bit hard to handle visually.

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

Cc Thomas De Schampheleire <[email protected]>
Cc Thomas Petazzoni <[email protected]>
---
 package/pkg-kconfig.mk | 7 -------
 1 file changed, 7 deletions(-)
package/pkg-kconfig.mk +0 -7
index 5220fdf..8b777f1 100644
@@ -32,36 +32,30 @@ define inner-kconfig-package
 $(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 @@ $$(addprefix $(1)-,$$($(2)_KCONFIG_EDITORS)): $$($(2)_DIR)/.stamp_kconfig_fixup_
 	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)
 
Signature · 1 line
1.9.1
#4 lore raw

PATCH 2/2 infra/pkg-kconfig: do not rebuild kconfig packages again and again

In reply to Yann E. MORIN

When a kconfig-based package executes its confiigure step, it may overwrite it .config file. Thus, the .config file is more recent than our stamp file .stamp_kconfig_fixup_done. On a subsequent build, out dependency rules would kick in, and run the config fixup again, thus kikcing in the package's configure, build and isntall steps yet once more, that, ad libitum.

Fix that by introducing a post-configure hook that re-touches our stamp file, so it is always more recent than the .config.

Cc Thomas De Schampheleire <[email protected]>
Cc Thomas Petazzoni <[email protected]>
---
 package/pkg-kconfig.mk | 10 ++++++++++
 1 file changed, 10 insertions(+)
package/pkg-kconfig.mk +10 -0
index 8b777f1..16cc154 100644
@@ -55,6 +55,16 @@ $$($(2)_DIR)/.stamp_kconfig_fixup_done: $$($(2)_DIR)/.config
 # Before running configure, the configuration file should be present and fixed
 $$($(2)_TARGET_CONFIGURE): $$($(2)_DIR)/.stamp_kconfig_fixup_done
 
+# During their configure steps, some kconfig packages may regenerate their
+# .config file, thus making it more recent than our .stamp_kconfig_fixup_done
+# stamp file; thus, on a subsequent build, the package will be reconfigured
+# and rebuilt, re-installed, again and again...
+# Work around this by re-touching our stamp file after the configure step.
+define KCONFIG_RETOUCH_FIXUP_STAMP_HOOK
+	$$(Q)touch $$(@D)/.stamp_kconfig_fixup_done
+endef
+$(2)_POST_CONFIGURE_HOOKS += KCONFIG_RETOUCH_FIXUP_STAMP_HOOK
+
 # Configuration editors (menuconfig, ...)
 $$(addprefix $(1)-,$$($(2)_KCONFIG_EDITORS)): $$($(2)_DIR)/.stamp_kconfig_fixup_done
 	$$($(2)_MAKE_ENV) $$(MAKE) -C $$($(2)_DIR) \
Signature · 1 line
1.9.1
#3 lore raw

PATCH 1/2 infra/pkg-kconfig: join comments to the related code-block

In reply to Thomas De Schampheleire

Thomas, All,

On 2014-08-04 19:24 +0200, Thomas De Schampheleire spake thusly:

Quoted 5 lines

"Yann E. MORIN" <[email protected]> schreef:

Quoted 1 line

Some one-line comment apply to equally-onel-line code blocks, and thus

comments
'equally-onel-line'? Not sure what you mean here.

Right, I will rephrase that (and try not to make other typoes).

Quoted 2 lines

Content-wise:

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'
#5 lore raw

PATCH 2/2 infra/pkg-kconfig: do not rebuild kconfig packages again and again

In reply to Yann E. MORIN

"Yann E. MORIN" <[email protected]> schreef:

Quoted 1 line

When a kconfig-based package executes its confiigure step, it may

configure

Quoted 1 line

overwrite it .config file. Thus, the .config file is more recent than

its

Quoted 1 line

our stamp file .stamp_kconfig_fixup_done. On a subsequent build, out

our

Quoted 2 lines

dependency rules would kick in, and run the config fixup again, thus kikcing in the package's configure, build and isntall steps yet once

kicking
install

Quoted 1 line

more, that, ad libitum.

You mean 'ad infinitum' ?

Quoted 3 lines

Fix that by introducing a post-configure hook that re-touches our stamp file, so it is always more recent than the .config.

Could you share an example of which package does what type of change to the .config?

Thanks!
Thomas

#6 lore raw

PATCH 2/2 infra/pkg-kconfig: do not rebuild kconfig packages again and again

Thomas De Schampheleire <[email protected]> schreef:

Quoted 21 lines

"Yann E. MORIN" <[email protected]> schreef:

Quoted 1 line

When a kconfig-based package executes its confiigure step, it may

configure

Quoted 1 line

overwrite it .config file. Thus, the .config file is more recent than

its

Quoted 1 line

our stamp file .stamp_kconfig_fixup_done. On a subsequent build, out

our

Quoted 2 lines

dependency rules would kick in, and run the config fixup again, thus kikcing in the package's configure, build and isntall steps yet once

kicking
install

Quoted 1 line

more, that, ad libitum.

Quoted 7 lines

You mean 'ad infinitum' ?

Quoted 3 lines

Fix that by introducing a post-configure hook that re-touches our stamp file, so it is always more recent than the .config.

Could you share an example of which package does what type of change to the .config?

Ah, this was explained in the intro mail, maybe it should be added here too...

#7 lore raw

PATCH 2/2 infra/pkg-kconfig: do not rebuild kconfig packages again and again

In reply to Thomas De Schampheleire

Thomas, All,

On 2014-08-04 19:32 +0200, Thomas De Schampheleire spake thusly:

Quoted 7 lines

"Yann E. MORIN" <[email protected]> schreef:

Quoted 1 line

When a kconfig-based package executes its confiigure step, it may

configure

Quoted 1 line

overwrite it .config file. Thus, the .config file is more recent than

its

Quoted 7 lines
Quoted 1 line

our stamp file .stamp_kconfig_fixup_done. On a subsequent build, out

our

Quoted 2 lines

dependency rules would kick in, and run the config fixup again, thus kikcing in the package's configure, build and isntall steps yet once

kicking
install

OK, fixed.

Quoted 2 lines
Quoted 1 line

more, that, ad libitum.

You mean 'ad infinitum' ?

Yep, that fits better, indeed. Ad nauseam fits, too... :-] Will change, thanks.

Quoted 4 lines
Quoted 2 lines

Fix that by introducing a post-configure hook that re-touches our stamp file, so it is always more recent than the .config.

Could you share an example of which package does what type of change to the .config?

Yep. Busybox. It calls 'make oldconfig' in its configure commands, thus overwritting its .config.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'
#8 lore raw

cover Fix pkg-kconfig infra (branch yem/kconfig)

In reply to Yann E. MORIN

"Yann E. MORIN" <[email protected]> schreef:

Quoted 6 lines

Hello All!

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

Quoted 7 lines

The proposed fix consists in a post-configure hook, and I believe this is enough to get us rolling for the next release.

A better fix would be to move the call to 'oldocnifg' out of the packages, and into the kconfig infra itself, but this is a bit more involved. This could be done in -next (or maybe in master shortly after -rc1 if possible).

For uclibc, the oldconfig call is actually part of the fixup commands, so no problem there, right?

What if we do the same for busybox?

Best regards,
Thomas

#9 lore raw

cover Fix pkg-kconfig infra (branch yem/kconfig)

Thomas, All,

On 2014-08-04 20:13 +0200, Thomas De Schampheleire spake thusly:

Quoted 10 lines

"Yann E. MORIN" <[email protected]> schreef:

Quoted 9 lines

Hello All!

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

The proposed fix consists in a post-configure hook, and I believe this is enough to get us rolling for the next release.

Quoted 7 lines
Quoted 4 lines

A better fix would be to move the call to 'oldocnifg' out of the packages, and into the kconfig infra itself, but this is a bit more involved. This could be done in -next (or maybe in master shortly after -rc1 if possible).

For uclibc, the oldconfig call is actually part of the fixup commands, so no problem there, right?

Right, I did look at it, and it should work OK.

Quoted 1 line

What if we do the same for busybox?

Well, I do not know what your plans are for the other kconfig packages, so I came up with the hook solution, because it is fool-proof against any future kconfig package messing arounf with oldconfig, and because we need a quick fix.

But as I said in the cover-letter, we can further improve the situation in -next.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'