diff mbox series

u-boot: fix externalsrc not triggering do_configure on defconfig changes

Message ID 20240321-u-boot-defconfig-devtool-v1-1-2fccfc4c6f5e@theobroma-systems.com
State Accepted, archived
Commit fef517b5f978cf848b9cc40e8ce6bb2762681182
Headers show
Series u-boot: fix externalsrc not triggering do_configure on defconfig changes | expand

Commit Message

Quentin Schulz March 21, 2024, 5:17 p.m. UTC
From: Quentin Schulz <quentin.schulz@theobroma-systems.com>

externalsrc only monitors files listed in CONFIGURE_FILES environment
variable to know if it should trigger a rebuild of do_configure. By
default it is unset, but the defconfig from U-Boot should be listed
otherwise an old defconfig may be used even though the change is
technically detected by the do_compile logic later in the process.

Because U-Boot recipe uses `make oldconfig` when no defconfig is passed,
monitor .config for that special case.

This fixes U-Boot recipes not detecting defconfig changes when
devtool'ed.

Reported-by: Iskander Amara <iskander.amara@theobroma-systems.com>
Cc: Quentin Schulz <foss+yocto@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---
Tested by running:

MACHINE=qemuarm devtool modify u-boot
MACHINE=qemuarm devtool build u-boot
[modify configs/qemu_arm_defconfig]
MACHINE=qemuarm devtool build u-boot
MACHINE=qemuarm bitbake-diffsigs -t u-boot compile
[Checksum for file oe-devtool-tree-sha1-u-boot changed]

Apply the patch, then run:

MACHINE=qemuarm devtool build u-boot
[modify configs/qemu_arm_defconfig]
MACHINE=qemuarm devtool build u-boot
MACHINE=qemuarm bitbake-diffsigs -t u-boot compile
[Hash for task dependency u-boot:do_configure changed
    Checksum for file qemu_arm_defconfig changed]
---
 meta/recipes-bsp/u-boot/u-boot-configure.inc | 2 ++
 1 file changed, 2 insertions(+)


---
base-commit: 94f99434eff15a92cfdc2dce423d32a1b74aab39
change-id: 20240321-u-boot-defconfig-devtool-905683a1bedc

Best regards,

Comments

Quentin Schulz March 22, 2024, 10:57 a.m. UTC | #1
Adding Steve as Cc since he's maintaining the stable branches.

I've tested this on Kirkstone as well (in downstream u-boot recipes 
including u-boot-configure.inc and have that new line themselves), so if 
this gets merged into master, I suggest we backport it to stable 
branches too?

Cheers,
Quentin

On 3/21/24 18:17, Quentin Schulz wrote:
> From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> 
> externalsrc only monitors files listed in CONFIGURE_FILES environment
> variable to know if it should trigger a rebuild of do_configure. By
> default it is unset, but the defconfig from U-Boot should be listed
> otherwise an old defconfig may be used even though the change is
> technically detected by the do_compile logic later in the process.
> 
> Because U-Boot recipe uses `make oldconfig` when no defconfig is passed,
> monitor .config for that special case.
> 
> This fixes U-Boot recipes not detecting defconfig changes when
> devtool'ed.
> 
> Reported-by: Iskander Amara <iskander.amara@theobroma-systems.com>
> Cc: Quentin Schulz <foss+yocto@0leil.net>
> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> ---
> Tested by running:
> 
> MACHINE=qemuarm devtool modify u-boot
> MACHINE=qemuarm devtool build u-boot
> [modify configs/qemu_arm_defconfig]
> MACHINE=qemuarm devtool build u-boot
> MACHINE=qemuarm bitbake-diffsigs -t u-boot compile
> [Checksum for file oe-devtool-tree-sha1-u-boot changed]
> 
> Apply the patch, then run:
> 
> MACHINE=qemuarm devtool build u-boot
> [modify configs/qemu_arm_defconfig]
> MACHINE=qemuarm devtool build u-boot
> MACHINE=qemuarm bitbake-diffsigs -t u-boot compile
> [Hash for task dependency u-boot:do_configure changed
>      Checksum for file qemu_arm_defconfig changed]
> ---
>   meta/recipes-bsp/u-boot/u-boot-configure.inc | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/meta/recipes-bsp/u-boot/u-boot-configure.inc b/meta/recipes-bsp/u-boot/u-boot-configure.inc
> index 235623d25a..378d675364 100644
> --- a/meta/recipes-bsp/u-boot/u-boot-configure.inc
> +++ b/meta/recipes-bsp/u-boot/u-boot-configure.inc
> @@ -8,6 +8,8 @@ inherit uboot-config cml1
>   
>   DEPENDS += "kern-tools-native"
>   
> +CONFIGURE_FILES = "${@d.getVar('UBOOT_MACHINE') or '.config'}"
> +
>   do_configure () {
>       if [ -n "${UBOOT_CONFIG}" ]; then
>           unset i j
> 
> ---
> base-commit: 94f99434eff15a92cfdc2dce423d32a1b74aab39
> change-id: 20240321-u-boot-defconfig-devtool-905683a1bedc
> 
> Best regards,
diff mbox series

Patch

diff --git a/meta/recipes-bsp/u-boot/u-boot-configure.inc b/meta/recipes-bsp/u-boot/u-boot-configure.inc
index 235623d25a..378d675364 100644
--- a/meta/recipes-bsp/u-boot/u-boot-configure.inc
+++ b/meta/recipes-bsp/u-boot/u-boot-configure.inc
@@ -8,6 +8,8 @@  inherit uboot-config cml1
 
 DEPENDS += "kern-tools-native"
 
+CONFIGURE_FILES = "${@d.getVar('UBOOT_MACHINE') or '.config'}"
+
 do_configure () {
     if [ -n "${UBOOT_CONFIG}" ]; then
         unset i j