u-boot: do_compile depends on the value of UBOOT_LOCALVERSION
PATCH 1/1 u-boot: do_compile depends on the value of UBOOT_LOCALVERSION
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:Quoted 1 line
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
--- meta/recipes-bsp/u-boot/u-boot.inc | 1 + 1 file changed, 1 insertion(+)
meta/recipes-bsp/u-boot/u-boot.inc +1 -0
@@ -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
Signature · 1 line
2.25.1
Quoted 33 lines · Denys Dmytriyenko
UBOOT_LOCALVERSIONis often used to pass SCM commit SHA to the code via populating .scmversion file at the start ofdo_compile(). Let's explicitly markdo_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:Quoted 1 line
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_URIThe variable dependency chain for the failure is: SRCPV ->UBOOT_LOCALVERSION->do_compileERROR: Parsing halted due to errors, see error messages above
Signed-off-by Denys Dmytriyenko <[email protected]>--- meta/recipes-bsp/u-boot/u-boot.inc | 1 + 1 file changed, 1 insertion(+)meta/recipes-bsp/u-boot/u-boot.inc +0
-0
meta/recipes-bsp/u-boot/u-boot.inc PACKAGECONFIG[openssl] = ",,openssl-native" · line 29
Quoted 7 lines
meta/recipes-bsp/u-boot/u-boot.inc +1
-0@@ -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
How would I reproduce this?
The fix looks a bit like a workaround and I'd like to understand what is really going on here.
Cheers,
Richard
Quoted 8 lines · Richard Purdie
Quoted 7 lines · Denys Dmytriyenko
UBOOT_LOCALVERSIONis often used to pass SCM commit SHA to the code via populating .scmversion file at the start ofdo_compile(). Let's explicitly markdo_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
^^^^^^^^
Quoted 31 lines
Quoted 31 lines
Loading cache: 100%
Loaded 0 entries from dependency cache.
WARNING: /OE/poky-master/meta/recipes-bsp/u-boot/u-boot_2023.04.bb: Exception duringbuild_dependenciesfordo_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, inget_srcrev(d=<bb.data_smart.DataSmart object at 0x7fa0604a7100>, method_name='sortable_revision'):
if not scms:
> raiseFetchError("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_URIThe variable dependency chain for the failure is: SRCPV ->UBOOT_LOCALVERSION->do_compileERROR: Parsing halted due to errors, see error messages above
Signed-off-by Denys Dmytriyenko <[email protected]>--- meta/recipes-bsp/u-boot/u-boot.inc | 1 + 1 file changed, 1 insertion(+)meta/recipes-bsp/u-boot/u-boot.inc +1
-0@@ -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}"
Quoted 4 lines
meta/recipes-bsp/u-boot/u-boot.inc PACKAGECONFIG[openssl] = ",,openssl-native" · line 29
Quoted 2 lines
meta/recipes-bsp/u-boot/u-boot.inc +0
-0require u-boot-configure.incHow would I reproduce this?
The instructions are in the description above.
Quoted 2 lines
The fix looks a bit like a workaround and I'd like to understand what is really going on here.
This started happening recently after your change that empties SRC_URI for code parser cache handling in BB_HASH_CODEPARSER_VALS, as reported here:
https://lists.openembedded.org/g/openembedded-core/message/181726
Signature · 1 line
Denys
Quoted 44 lines · Denys Dmytriyenko
Quoted 8 lines · Richard Purdie
Quoted 7 lines · Denys Dmytriyenko
UBOOT_LOCALVERSIONis often used to pass SCM commit SHA to the code via populating .scmversion file at the start ofdo_compile(). Let's explicitly markdo_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^^^^^^^^
Quoted 31 lines
Quoted 31 lines
Loading cache: 100%
Loaded 0 entries from dependency cache.
WARNING: /OE/poky-master/meta/recipes-bsp/u-boot/u-boot_2023.04.bb: Exception duringbuild_dependenciesfordo_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, inget_srcrev(d=<bb.data_smart.DataSmart object at 0x7fa0604a7100>, method_name='sortable_revision'):
if not scms:
> raiseFetchError("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_URIThe variable dependency chain for the failure is: SRCPV ->UBOOT_LOCALVERSION->do_compileERROR: Parsing halted due to errors, see error messages above
Signed-off-by Denys Dmytriyenko <[email protected]>--- meta/recipes-bsp/u-boot/u-boot.inc | 1 + 1 file changed, 1 insertion(+)meta/recipes-bsp/u-boot/u-boot.inc +1
-0@@ -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}"
Quoted 6 lines
Quoted 4 lines
meta/recipes-bsp/u-boot/u-boot.inc PACKAGECONFIG[openssl] = ",,openssl-native" · line 29
Quoted 2 lines
meta/recipes-bsp/u-boot/u-boot.inc +0
-0require u-boot-configure.incHow would I reproduce this?
The instructions are in the description above.
Sorry, I'd assumed you'd need a specific target MACHINE so I somehow didn't think they were complete.
Quoted 9 lines
Quoted 4 lines
The fix looks a bit like a workaround and I'd like to understand what is really going on here.
This started happening recently after your change that empties
SRC_URIfor code parser cache handling inBB_HASH_CODEPARSER_VALS, as reported here:https://lists.openembedded.org/g/openembedded-core/message/181726
It would be useful if the commit message had mentioned that!
I suspect the correct fix is to add SRCPV=xxx toBB_HASH_CODEPARSER_VALS
Could you see if that works instead?
Cheers,
Richard
Quoted 50 lines · Richard Purdie
Quoted 49 lines · Denys Dmytriyenko
Quoted 8 lines · Richard Purdie
Quoted 7 lines · Denys Dmytriyenko
UBOOT_LOCALVERSIONis often used to pass SCM commit SHA to the code via populating .scmversion file at the start ofdo_compile(). Let's explicitly markdo_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^^^^^^^^
Quoted 35 lines
Quoted 26 lines
Loading cache: 100%
Loaded 0 entries from dependency cache.
WARNING: /OE/poky-master/meta/recipes-bsp/u-boot/u-boot_2023.04.bb: Exception duringbuild_dependenciesfordo_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, inget_srcrev(d=<bb.data_smart.DataSmart object at 0x7fa0604a7100>, method_name='sortable_revision'):
if not scms:
> raiseFetchError("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_URIThe variable dependency chain for the failure is: SRCPV ->UBOOT_LOCALVERSION->do_compileERROR: Parsing halted due to errors, see error messages above
Signed-off-by Denys Dmytriyenko <[email protected]>--- meta/recipes-bsp/u-boot/u-boot.inc | 1 + 1 file changed, 1 insertion(+)meta/recipes-bsp/u-boot/u-boot.inc +0
-0meta/recipes-bsp/u-boot/u-boot.inc PACKAGECONFIG[openssl] = ",,openssl-native" · line 29
Quoted 7 lines
meta/recipes-bsp/u-boot/u-boot.inc +1
-0@@ -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.incHow would I reproduce this?
Quoted 4 lines
Quoted 1 line
The instructions are in the description above.
Sorry, I'd assumed you'd need a specific target MACHINE so I somehow didn't think they were complete.
No, any qemu target should do.
Quoted 6 lines
Quoted 6 lines
Quoted 2 lines
The fix looks a bit like a workaround and I'd like to understand what is really going on here.
This started happening recently after your change that empties
SRC_URIfor code parser cache handling inBB_HASH_CODEPARSER_VALS, as reported here:
Quoted 8 lines
It would be useful if the commit message had mentioned that!
I suspect the correct fix is to add SRCPV=xxx to
BB_HASH_CODEPARSER_VALSCould you see if that works instead?
Yes, it works. Do you need a patch?
Signature · 1 line
Denys