Re: [yocto] do_package error after building meta-tensorflow and libcamera-apps does not detect tensorflow-lite

Hongxu Jia <[email protected]>
Newsgroups org.yoctoproject.lists.yocto
Message-ID <[email protected]>
On 9/13/25 11:57, ashish shrikhande6 via lists.yoctoproject.org wrote:
> **
> *CAUTION: This email comes from a non Wind River email account!*
> Do not click links or open attachments unless you recognize the sender 
> and know the content is safe.
> I am facing two issues in building meta-tensorflow. I am trying to 
> build tensorflow-lite in latest Yocto whinlatter for Raspberrypi5 target.
> When I get try to build tensorflow-lite
> I get below error:
> ***********************************************************************************************************************************************
> ERROR: tensorflow-lite-2.19.0-r0 do_package: Error executing a python 
> function in exec_func_python() autogenerated:
> The stack trace of python calls that resulted in this 
> exception/failure was:
> File: 'exec_func_python() autogenerated', lineno: 2, function: <module>
>      0001:
>  *** 0002:sstate_report_unihash(d)
>      0003:
> File: 
> '/home/ashish/raspberrypi5_whinlater/poky/meta/classes-global/sstate.bbclass', 
> lineno: 917, function: sstate_report_unihash
>      0913:    report_unihash = getattr(bb.parse.siggen, 
> 'report_unihash', None)
>      0914:
>      0915:    if report_unihash:
>      0916:        ss = sstate_state_fromvars(d)
>  *** 0917:        report_unihash(os.getcwd(), ss['task'], d)
>      0918:}
>      0919:
>      0920:#
>      0921:# Shell function to decompress and prepare a package for 
> installation
> File: 
> '/home/ashish/raspberrypi5_whinlater/poky/bitbake/lib/bb/siggen.py', 
> lineno: 784, function: report_unihash
>      0780:
>      0781:            if "." in self.method:
>      0782:                (module, method) = self.method.rsplit('.', 1)
>      0783:                locs['method'] = 
> getattr(importlib.import_module(module), method)
>  *** 0784:                outhash = bb.utils.better_eval('method(path, 
> sigfile, task, d)', locs)
>      0785:            else:
>      0786:                outhash = bb.utils.better_eval(self.method + 
> '(path, sigfile, task, d)', locs)
>      0787:
>      0788:            try:
> File: 
> '/home/ashish/raspberrypi5_whinlater/poky/bitbake/lib/bb/utils.py', 
> lineno: 487, function: better_eval
>      0483:    if extraglobals:
>      0484:        ctx = copy.copy(ctx)
>      0485:        for g in extraglobals:
>      0486:            ctx[g] = extraglobals[g]
>  *** 0487:    return eval(source, ctx, locals)
>      0488:
>      0489:@contextmanager
>      0490:def fileslocked(files, *args, **kwargs):
>      0491:    """Context manager for locking and unlocking file locks. 
> Uses
> File: '<string>', lineno: 1, function: <module>
>   File "<string>", line 1, in <module>
> File: 
> '/home/ashish/raspberrypi5_whinlater/poky/meta/lib/oe/sstatesig.py', 
> lineno: 722, function: OEOuthashBasic
>      0718:                update_hash("\n")
>      0719:
>      0720:            # Process this directory and all its child files
>      0721:            if include_root or root != ".":
>  *** 0722:                process(root)
>      0723:            for f in files:
>      0724:                if f == 'fixmepath':
>      0725:                    continue
>      0726:                process(os.path.join(root, f))
> File: 
> '/home/ashish/raspberrypi5_whinlater/poky/meta/lib/oe/sstatesig.py', 
> lineno: 661, function: process
>      0657:                    except KeyError as e:
>      0658:                        msg = ("KeyError: %s\nPath %s is 
> owned by uid %d, gid %d, which doesn't match "
>      0659:                            "any user/group on target. This 
> may be due to host contamination." %
>      0660:                            (e, os.path.abspath(path), 
> s.st_uid, s.st_gid))
>  *** 0661:                        raise 
> Exception(msg).with_traceback(e.__traceback__)
>      0662:
>      0663:                if include_timestamps:
>      0664:                    # Need to clamp to SOURCE_DATE_EPOCH
>      0665:                    if s.st_mtime > source_date_epoch:
> File: 
> '/home/ashish/raspberrypi5_whinlater/poky/meta/lib/oe/sstatesig.py', 
> lineno: 655, function: process
>      0651:                    else:
>      0652:                        add_perm(stat.S_IXOTH, 'x')
>      0653:
>      0654:                    try:
>  *** 0655:                        update_hash(" %10s" % 
> pwd.getpwuid(s.st_uid).pw_name)
>      0656:                        update_hash(" %10s" % 
> grp.getgrgid(s.st_gid).gr_name)
>      0657:                    except KeyError as e:
>      0658:                        msg = ("KeyError: %s\nPath %s is 
> owned by uid %d, gid %d, which doesn't match "
>      0659:                            "any user/group on target. This 
> may be due to host contamination." %
> Exception: Exception: KeyError: 'getpwuid(): uid not found: 1000'
> Path 
> /home/ashish/raspberrypi5_whinlater/poky/build/tmp/work/cortexa76-poky-linux/tensorflow-lite/2.19.0/sstate-build-package/package/usr/lib/python3.13/site-packages/tflite_runtime 
> is owned by uid 1000, gid 1000, which doesn't match any user/group on 
> target. This may be due to host contamination.
> ERROR: Logfile of failure stored in: 
> /home/ashish/raspberrypi5_whinlater/poky/build/tmp/work/cortexa76-poky-linux/tensorflow-lite/2.19.0/temp/log.do_package.4189490
> NOTE: recipe tensorflow-lite-2.19.0-r0: task do_package: Failed

 From the log, it should be the issue of sstate cache, such as two 
builds share one sstate share

in 1st build, build tensorflow-lite, and then in 2nd build, it resue the 
sstate cache of 1st build.

when you rebuilt from scratch (bitbake tensorflow-lite -cceansstate && 
bitbake tensorflow-lite)

or trigger do_install rebuild will fix the issue

> ********************************************************************************************************************************************************************************************************
> After I comment below part from recipe it successfully build it:
>     ${STAGING_BINDIR_NATIVE}/pip3 install --disable-pip-version-check -v \
>         -t ${D}/${PYTHON_SITEPACKAGES_DIR} --no-cache-dir --no-deps \
> ${S}/tensorflow/lite/tools/pip_package/gen/tflite_pip/python3/dist/tflite_runtime-${PV}*cp313*.whl
>     rm -rf ${D}${PYTHON_SITEPACKAGES_DIR}/tflite_runtime-${PV}.dist-info
> Since I wanted to build rpicam-apps (libcamera-apps) with 
> tensorflow-lite support I commented above part as wheel is not required.
> When I build  libcamera-apps, since meta-tensorflow uses bazel to 
> build, it does not generate libtensorflowlite.pc for libcamera-apps to 
> integrate.

By default, no libtensorflowlite.pc is provided for now, you could 
manually add the libtensorflowlite.pc to along with recipe and install 
it in task do_install

//Hongxu

> How to solve these issues? I am new to Yocto and looking for some help?
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#65829):https://lists.yoctoproject.org/g/yocto/message/65829
> Mute This Topic:https://lists.yoctoproject.org/mt/115218449/3617049
> Group Owner:[email protected]
> Unsubscribe:https://lists.yoctoproject.org/g/yocto/unsub  [[email protected]]
> -=-=-=-=-=-=-=-=-=-=-=-
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.