Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] u-boot: do_compile depends on the value of UBOOT_LOCALVERSION
@ 2023-05-28 17:15 Denys Dmytriyenko
  2023-05-29 12:41 ` [OE-core] " Richard Purdie
  0 siblings, 1 reply; 5+ messages in thread
From: Denys Dmytriyenko @ 2023-05-28 17:15 UTC (permalink / raw)
  To: openembedded-core; +Cc: Denys Dmytriyenko

UBOOT_LOCALVERSION is often used to pass SCM commit SHA to the code
via populating .scmversion file at the start of do_compile(). Let's
explicitly mark do_compile() as depending on the the value of this
variable to avoid errors like this:

$ echo 'UBOOT_LOCALVERSION = "${SRCPV}"' >> conf/local.conf
$ bitbake u-boot
Loading cache: 100%
Loaded 0 entries from dependency cache.
WARNING: /OE/poky-master/meta/recipes-bsp/u-boot/u-boot_2023.04.bb: Exception during build_dependencies for do_compile
WARNING: /OE/poky-master/meta/recipes-bsp/u-boot/u-boot_2023.04.bb: Error during finalise of /OE/poky-master/meta/recipes-bsp/u-boot/u-boot_2023.04.bb
ERROR: ExpansionError during parsing /OE/poky-master/meta/recipes-bsp/u-boot/u-boot_2023.04.bb
Traceback (most recent call last):
  File "Var <SRCPV>", line 1, in <module>
  File "/OE/poky-master/bitbake/lib/bb/fetch2/__init__.py", line 784, in get_srcrev(d=<bb.data_smart.DataSmart object at 0x7fa0604a7100>, method_name='sortable_revision'):
         if not scms:
    >        raise FetchError("SRCREV was used yet no valid SCM was found in SRC_URI")

bb.data_smart.ExpansionError: Failure expanding variable SRCPV, expression was ${@bb.fetch2.get_srcrev(d)} which triggered exception FetchError: Fetcher failure: SRCREV was used yet no valid SCM was found in SRC_URI
The variable dependency chain for the failure is: SRCPV -> UBOOT_LOCALVERSION -> do_compile

ERROR: Parsing halted due to errors, see error messages above

Signed-off-by: Denys Dmytriyenko <denis@denix.org>
---
 meta/recipes-bsp/u-boot/u-boot.inc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/recipes-bsp/u-boot/u-boot.inc b/meta/recipes-bsp/u-boot/u-boot.inc
index b3482dcef3..ec8108f5c9 100644
--- a/meta/recipes-bsp/u-boot/u-boot.inc
+++ b/meta/recipes-bsp/u-boot/u-boot.inc
@@ -23,6 +23,7 @@ PACKAGECONFIG[openssl] = ",,openssl-native"
 # u-boot build system and appended to the u-boot version.  If the .scmversion
 # file already exists it will not be overwritten.
 UBOOT_LOCALVERSION ?= ""
+do_compile[vardepvalue] = "${UBOOT_LOCALVERSION}"
 
 require u-boot-configure.inc
 
-- 
2.25.1



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

end of thread, other threads:[~2023-05-30 19:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-28 17:15 [PATCH] u-boot: do_compile depends on the value of UBOOT_LOCALVERSION Denys Dmytriyenko
2023-05-29 12:41 ` [OE-core] " Richard Purdie
2023-05-29 16:06   ` Denys Dmytriyenko
2023-05-30 14:47     ` Richard Purdie
2023-05-30 19:12       ` Denys Dmytriyenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox