Bug 14626

Summary: eSDKs are missing sstate objects
Product: [Yocto Project Subprojects] eSDK Reporter: Robert Berger <pokylinux>
Component: eSDKAssignee: Ross Burton <ross.burton>
Status: RESOLVED FIXED QA Contact: Francisco Pedraza <francisco.j.pedraza.gonzalez>
Severity: normal    
Priority: Medium+ CC: andrej.v, randy.macleod, ross.burton, sgw
Version: 3.4   
Target Milestone: 4.2 M1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: Regression (Used to work)
Verified: Documentation change: Don't know
Attachments:
Description Flags
testcase
none
testcase which collects data ;) none

Description Robert Berger 2021-11-12 11:21:03 UTC
Created attachment 4841 [details]
testcase

When I use the eSDK to build this example this happens:

I'm on the host
++ '[' -d hello ']'
++ rm -rf hello
++ tar xzvf hello.tar.gz
hello/
hello/README
hello/hello.c
hello/Makefile.example.linux
hello/Makefile.example.bsd
hello/tp.c
hello/ust_tests_hello.h
hello/Makefile.am
++ pushd hello
~/projects/yocto-3.0/yocto-multi-v7-ml/yocto-for-trainer/recipes/89_lttng-ust/hello ~/projects/yocto-3.0/yocto-multi-v7-ml/yocto-for-trainer/recipes/89_lttng-ust
++ plus_off
++ set +x
+ use buildttools-extended
+ source /opt/buildtools-extended/resy/3.4.66/multi-v7-ml/imx6q-phytec-mira-rdk-nand/environment-setup-x86_64-resysdk-linux
+ press <ENTER> to go on

++ echo 'source /opt/ext-sdk/resy/3.4.66/multi-v7-ml/imx6q-phytec-mira-rdk-nand/environment-setup-armv7at2hf-neon-resy-linux-gnueabi'
source /opt/ext-sdk/resy/3.4.66/multi-v7-ml/imx6q-phytec-mira-rdk-nand/environment-setup-armv7at2hf-neon-resy-linux-gnueabi
++ plus_off
++ set +x
SDK environment now set up; additionally you may now run devtool to perform development tasks.
Run devtool --help for further details.
rm -f hello
arm-resy-linux-gnueabi-gcc  -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/opt/ext-sdk/resy/3.4.66/multi-v7-ml/imx6q-phytec-mira-rdk-nand/tmp/sysroots/multi-v7-ml -O2 -I. -o hello -ldl -llttng-ust hello.c tp.c
In file included from hello.c:39:
ust_tests_hello.h:29:10: fatal error: lttng/tracepoint.h: No such file or directory
   29 | #include <lttng/tracepoint.h>
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from tp.c:26:
ust_tests_hello.h:29:10: fatal error: lttng/tracepoint.h: No such file or directory
   29 | #include <lttng/tracepoint.h>
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:4: hello] Error 1


When I use the classic SDK built with the same meta-data it works:

++ rm -rf hello
++ tar xzvf hello.tar.gz
hello/
hello/README
hello/hello.c
hello/Makefile.example.linux
hello/Makefile.example.bsd
hello/tp.c
hello/ust_tests_hello.h
hello/Makefile.am
++ pushd hello
~/projects/yocto-3.0/yocto-multi-v7-ml/yocto-for-trainer/recipes/89_lttng-ust/hello ~/projects/yocto-3.0/yocto-multi-v7-ml/yocto-for-trainer/recipes/89_lttng-ust
++ set +x
+ source /opt/sdk/resy/3.4.66/multi-v7-ml/imx6q-phytec-mira-rdk-nand/environment-setup-armv7at2hf-neon-resy-linux-gnueabi
++ cp Makefile.example.linux Makefile
++ make clean
rm -f hello
++ make
arm-resy-linux-gnueabi-gcc  -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/opt/sdk/resy/3.4.66/multi-v7-ml/imx6q-phytec-mira-rdk-nand/sysroots/armv7at2hf-neon-resy-linux-gnueabi -O2 -I. -o hello -ldl -llttng-ust hello.c tp.c
++ popd
~/projects/yocto-3.0/yocto-multi-v7-ml/yocto-for-trainer/recipes/89_lttng-ust
++ set +x
Comment 1 Robert Berger 2021-11-12 11:22:34 UTC
might be related to 

https://bugzilla.yoctoproject.org/show_bug.cgi?id=14624
Comment 2 Robert Berger 2021-11-12 11:37:03 UTC
Created attachment 4842 [details]
testcase which collects data ;)

The previous test case shows the compilation issue as well, but this one collects data as well.
Comment 3 Saul Wold 2022-02-03 18:59:50 UTC
Hi Robert,

Can I get clarification as to what version and image / sdk your building including any additional packages installed (INSTALL_IMAGE) or other distro or local settings.

Thanks
Comment 4 Stephen K Jolley 2022-02-12 00:17:13 UTC
Saul agreed to take this.
Comment 5 Saul Wold 2022-08-30 15:02:44 UTC
Is this still a problem in the current release or Kirkstone?
Comment 6 Randy MacLeod 2022-09-01 14:59:16 UTC
Robert, Is this still a problem in the current release or Kirkstone?
Comment 7 Ross Burton 2022-10-06 20:58:10 UTC
Huh.
Comment 8 Ross Burton 2022-10-07 12:19:14 UTC
So yes, I can replicate this with current master (almost langdale).
Comment 9 Ross Burton 2022-10-07 14:52:19 UTC
I believe the correct workflow is to unpack the eSDK, source the environment script, then run 'devtool sdk-install lttng-ust'.  However, that fails for me.
Comment 10 Ross Burton 2022-10-12 11:48:36 UTC
If I build an eSDK, some sstate is missing and eg 'devtool sdk-install libxml2' fails with Unavailable, despite the fact that it should be in the eSDK.

It looks like some of the sstate is missing in the eSDK.  For example, conf/locked-sigs.inc says:
   libxml2:do_package_write_rpm:787fe8aabd0010122c8c2070aa0c6e3fac39895963e19600a48226ab3e2b1346

And indeed, this sstate exists:

sstate-cache/78/7f/sstate:libxml2:cortexa57-poky-linux:2.9.14:r0:cortexa57:10:787fe8aabd0010122c8c2070aa0c6e3fac39895963e19600a48226ab3e2b1346_package_write_rpm.tar.zst

However, the populate-sysroot sstate:

libxml2:do_populate_sysroot:a37ec72685d847402a8a18b781f453ad30f6aff72892e457e36456163714bb81

Does not exist at all. I suspect this is related to hash equivalency.
Comment 11 Ross Burton 2022-10-12 11:48:57 UTC
*** Bug 14924 has been marked as a duplicate of this bug. ***
Comment 12 Ross Burton 2022-10-13 12:15:24 UTC
Try with this small patch:

diff --git a/scripts/oe-check-sstate b/scripts/oe-check-sstate
index f4cc5869de..0f0afab1f3 100755
--- a/scripts/oe-check-sstate
+++ b/scripts/oe-check-sstate
@@ -52,7 +52,7 @@ def check(args):

         try:
             output = subprocess.check_output(
-                    'bitbake -n %s' % ' '.join(args.target),
+                    'bitbake -n --runall=build %s' % ' '.join(args.target),
                     stderr=subprocess.STDOUT,
                     env=env,
                     shell=True)
Comment 14 Ross Burton 2022-10-19 20:40:36 UTC
Slightly improved version with a more verbose commit message:

https://lore.kernel.org/openembedded-core/20221019203808.2275846-2-ross.burton@arm.com/T/#u
Comment 15 Ross Burton 2022-10-27 15:13:56 UTC
Merged in oe-core 1b62344f919b5122f048b6409d09386d7d6dd3cd.
Comment 16 Randy MacLeod 2025-02-14 16:46:21 UTC
bulk change to add Saul's non-WR address.
Comment 17 Randy MacLeod 2025-02-14 16:48:16 UTC
Bulk change: Remove Saul's old WR address.