Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variable contains operation using old BitBake override syntax #13

Closed
NassimEdi opened this issue Jan 14, 2022 · 7 comments
Closed

Variable contains operation using old BitBake override syntax #13

NassimEdi opened this issue Jan 14, 2022 · 7 comments

Comments

@NassimEdi
Copy link

Hello,

When running bitbake -c menuconfig virtual/kernel, I get the following error:

ERROR: .../meta-polarfire-soc-yocto-bsp/yocto-dev/meta-tensorflow-lite/recipes-framework/tensorflow-lite/python3-tensorflow-lite_2.6.0.bb: Variable SRC_URI_append_riscv64 contains an operation using the old override syntax. Please convert this layer/metadata before attempting to use with a newer bitbake.
ERROR: Failed to parse recipe: .../meta-polarfire-soc-yocto-bsp/yocto-dev/meta-tensorflow-lite/recipes-framework/tensorflow-lite/python3-tensorflow-lite_2.6.0.bb

I am using the tensorflow-lite layer in combination with this BSP, which also takes care of creating the build environment (bitbake 1.52).

@NobuoTsukamoto
Copy link
Owner

Is it possible to see if the error is resolved by modifying the override syntax?

https://github.com/NobuoTsukamoto/meta-tensorflow-lite/blob/master/recipes-framework/tensorflow-lite/python3-tensorflow-lite_2.6.0.bb#L18

SRC_URI:append:riscv64 += " \

Reference:
https://docs.yoctoproject.org/migration-guides/migration-3.4.html

@NassimEdi
Copy link
Author

Thank you for the reference. Converting all instances of the old override syntax fixed the problem. However I still get the following error when building an image that installs the python3-tensorflow-lite package:

ERROR: python3-tensorflow-lite-2.7.0-r0 do_patch: Applying patch 'link-atomic-lib.patch' on target directory '/home/nassim/cloned_repos/yocto-dev/build/tmp-glibc/work/riscv64-oe-linux/python3-tensorflow-lite/2.7.0-r0/git'
CmdError('quilt --quiltrc /home/nassim/cloned_repos/yocto-dev/build/tmp-glibc/work/riscv64-oe-linux/python3-tensorflow-lite/2.7.0-r0/recipe-sysroot-native/etc/quiltrc push', 0, "stdout: Applying patch link-atomic-lib.patch\ncan't find file to patch at input line 5\nPerhaps you used the wrong -p or --strip option?\nThe text leading up to this was:\n--------------------------\n|diff --git a/tensorflow/lite/tools/make/Makefile b/tensorflow/lite/tools/make/Makefile\n|index 9d90e9526be..1ba137304e7 100644\n|--- a/tensorflow/lite/tools/make/Makefile\n|+++ b/tensorflow/lite/tools/make/Makefile\n--------------------------\nNo file to patch. Skipping patch.\n1 out of 1 hunk ignored\ncan't find file to patch at input line 19\nPerhaps you used the wrong -p or --strip option?\nThe text leading up to this was:\n--------------------------\n|diff --git a/tensorflow/lite/tools/pip_package/setup.py b/tensorflow/lite/tools/pip_package/setup.py\n|index 8c122418abd..5ccd40683b1 100644\n|--- a/tensorflow/lite/tools/pip_package/setup.py\n|+++ b/tensorflow/lite/tools/pip_package/setup.py\n--------------------------\nNo file to patch. Skipping patch.\n1 out of 1 hunk ignored\nPatch link-atomic-lib.patch does not apply (enforce with -f)\n\nstderr: ")

With the following failure log:

DEBUG: Executing python function extend_recipe_sysroot
NOTE: Direct dependencies are ['virtual:native:/home/nassim/cloned_repos/yocto-dev/openembedded-core/meta/recipes-devtools/patch/patch_2.7.6.bb:do_populate_sysroot', '/home/nassim/cloned_repos/yocto-dev/openembedded-core/meta/recipes-devtools/quilt/quilt-native_0.66.bb:do_populate_sysroot']
NOTE: Installed into sysroot: ['patch-native', 'quilt-native', 'attr-native', 'libtool-native', 'gettext-minimal-native', 'texinfo-dummy-native']
NOTE: Skipping as already exists in sysroot: []
DEBUG: sed -e 's:^[^/]*/:/home/nassim/cloned_repos/yocto-dev/build/tmp-glibc/work/riscv64-oe-linux/python3-tensorflow-lite/2.7.0-r0/recipe-sysroot-native/:g' /home/nassim/cloned_repos/yocto-dev/build/tmp-glibc/sysroots-components/x86_64/quilt-native/fixmepath /home/nassim/cloned_repos/yocto-dev/build/tmp-glibc/sysroots-components/x86_64/libtool-native/fixmepath | xargs sed -i -e 's:FIXMESTAGINGDIRTARGET:/home/nassim/cloned_repos/yocto-dev/build/tmp-glibc/work/riscv64-oe-linux/python3-tensorflow-lite/2.7.0-r0/recipe-sysroot:g; s:FIXMESTAGINGDIRHOST:/home/nassim/cloned_repos/yocto-dev/build/tmp-glibc/work/riscv64-oe-linux/python3-tensorflow-lite/2.7.0-r0/recipe-sysroot-native:g' -e 's:FIXME_PSEUDO_SYSROOT:/home/nassim/cloned_repos/yocto-dev/build/tmp-glibc/sysroots-components/x86_64/pseudo-native:g' -e 's:FIXME_HOSTTOOLS_DIR:/home/nassim/cloned_repos/yocto-dev/build/tmp-glibc/hosttools:g' -e 's:FIXME_PKGDATA_DIR:/home/nassim/cloned_repos/yocto-dev/build/tmp-glibc/pkgdata/icicle-kit-es:g' -e 's:FIXME_PSEUDO_LOCALSTATEDIR:/home/nassim/cloned_repos/yocto-dev/build/tmp-glibc/work/riscv64-oe-linux/python3-tensorflow-lite/2.7.0-r0/pseudo/:g' -e 's:FIXME_LOGFIFO:/home/nassim/cloned_repos/yocto-dev/build/tmp-glibc/work/riscv64-oe-linux/python3-tensorflow-lite/2.7.0-r0/temp/fifo.24267:g'
DEBUG: Python function extend_recipe_sysroot finished
DEBUG: Executing python function do_patch
DEBUG: Executing python function patch_do_patch
DEBUG: Searching for 001-v2.7-Fix-the-xnnpack-by-default-logic-for-Python.patch in paths:
/home/nassim/cloned_repos/yocto-dev/meta-tensorflow-lite/recipes-framework/tensorflow-lite/python3-tensorflow-lite-2.7.0/nodistro
/home/nassim/cloned_repos/yocto-dev/meta-tensorflow-lite/recipes-framework/tensorflow-lite/python3-tensorflow-lite/nodistro
/home/nassim/cloned_repos/yocto-dev/meta-tensorflow-lite/recipes-framework/tensorflow-lite/files/nodistro
/home/nassim/cloned_repos/yocto-dev/meta-tensorflow-lite/recipes-framework/tensorflow-lite/python3-tensorflow-lite-2.7.0/icicle-kit-es
/home/nassim/cloned_repos/yocto-dev/meta-tensorflow-lite/recipes-framework/tensorflow-lite/python3-tensorflow-lite/icicle-kit-es
/home/nassim/cloned_repos/yocto-dev/meta-tensorflow-lite/recipes-framework/tensorflow-lite/files/icicle-kit-es
/home/nassim/cloned_repos/yocto-dev/meta-tensorflow-lite/recipes-framework/tensorflow-lite/python3-tensorflow-lite-2.7.0/riscv64
/home/nassim/cloned_repos/yocto-dev/meta-tensorflow-lite/recipes-framework/tensorflow-lite/python3-tensorflow-lite/riscv64
/home/nassim/cloned_repos/yocto-dev/meta-tensorflow-lite/recipes-framework/tensorflow-lite/files/riscv64
/home/nassim/cloned_repos/yocto-dev/meta-tensorflow-lite/recipes-framework/tensorflow-lite/python3-tensorflow-lite-2.7.0/
/home/nassim/cloned_repos/yocto-dev/meta-tensorflow-lite/recipes-framework/tensorflow-lite/python3-tensorflow-lite/
/home/nassim/cloned_repos/yocto-dev/meta-tensorflow-lite/recipes-framework/tensorflow-lite/files/
DEBUG: Searching for 001-v2.7-Disable-XNNPACKPack-CMakeFile.patch in paths:
/home/nassim/cloned_repos/yocto-dev/meta-tensorflow-lite/recipes-framework/tensorflow-lite/python3-tensorflow-lite-2.7.0/nodistro
/home/nassim/cloned_repos/yocto-dev/meta-tensorflow-lite/recipes-framework/tensorflow-lite/python3-tensorflow-lite/nodistro
/home/nassim/cloned_repos/yocto-dev/meta-tensorflow-lite/recipes-framework/tensorflow-lite/files/nodistro
/home/nassim/cloned_repos/yocto-dev/meta-tensorflow-lite/recipes-framework/tensorflow-lite/python3-tensorflow-lite-2.7.0/icicle-kit-es
/home/nassim/cloned_repos/yocto-dev/meta-tensorflow-lite/recipes-framework/tensorflow-lite/python3-tensorflow-lite/icicle-kit-es
/home/nassim/cloned_repos/yocto-dev/meta-tensorflow-lite/recipes-framework/tensorflow-lite/files/icicle-kit-es
/home/nassim/cloned_repos/yocto-dev/meta-tensorflow-lite/recipes-framework/tensorflow-lite/python3-tensorflow-lite-2.7.0/riscv64
/home/nassim/cloned_repos/yocto-dev/meta-tensorflow-lite/recipes-framework/tensorflow-lite/python3-tensorflow-lite/riscv64
/home/nassim/cloned_repos/yocto-dev/meta-tensorflow-lite/recipes-framework/tensorflow-lite/files/riscv64
/home/nassim/cloned_repos/yocto-dev/meta-tensorflow-lite/recipes-framework/tensorflow-lite/python3-tensorflow-lite-2.7.0/
/home/nassim/cloned_repos/yocto-dev/meta-tensorflow-lite/recipes-framework/tensorflow-lite/python3-tensorflow-lite/
/home/nassim/cloned_repos/yocto-dev/meta-tensorflow-lite/recipes-framework/tensorflow-lite/files/
DEBUG: Searching for link-atomic-lib.patch in paths:
/home/nassim/cloned_repos/yocto-dev/meta-tensorflow-lite/recipes-framework/tensorflow-lite/python3-tensorflow-lite-2.7.0/nodistro
/home/nassim/cloned_repos/yocto-dev/meta-tensorflow-lite/recipes-framework/tensorflow-lite/python3-tensorflow-lite/nodistro
/home/nassim/cloned_repos/yocto-dev/meta-tensorflow-lite/recipes-framework/tensorflow-lite/files/nodistro
/home/nassim/cloned_repos/yocto-dev/meta-tensorflow-lite/recipes-framework/tensorflow-lite/python3-tensorflow-lite-2.7.0/icicle-kit-es
/home/nassim/cloned_repos/yocto-dev/meta-tensorflow-lite/recipes-framework/tensorflow-lite/python3-tensorflow-lite/icicle-kit-es
/home/nassim/cloned_repos/yocto-dev/meta-tensorflow-lite/recipes-framework/tensorflow-lite/files/icicle-kit-es
/home/nassim/cloned_repos/yocto-dev/meta-tensorflow-lite/recipes-framework/tensorflow-lite/python3-tensorflow-lite-2.7.0/riscv64
/home/nassim/cloned_repos/yocto-dev/meta-tensorflow-lite/recipes-framework/tensorflow-lite/python3-tensorflow-lite/riscv64
/home/nassim/cloned_repos/yocto-dev/meta-tensorflow-lite/recipes-framework/tensorflow-lite/files/riscv64
/home/nassim/cloned_repos/yocto-dev/meta-tensorflow-lite/recipes-framework/tensorflow-lite/python3-tensorflow-lite-2.7.0/
/home/nassim/cloned_repos/yocto-dev/meta-tensorflow-lite/recipes-framework/tensorflow-lite/python3-tensorflow-lite/
/home/nassim/cloned_repos/yocto-dev/meta-tensorflow-lite/recipes-framework/tensorflow-lite/files/
NOTE: Applying patch '001-v2.7-Fix-the-xnnpack-by-default-logic-for-Python.patch' (../meta-tensorflow-lite/recipes-framework/tensorflow-lite/files/001-v2.7-Fix-the-xnnpack-by-default-logic-for-Python.patch)
NOTE: Applying patch '001-v2.7-Disable-XNNPACKPack-CMakeFile.patch' (../meta-tensorflow-lite/recipes-framework/tensorflow-lite/files/001-v2.7-Disable-XNNPACKPack-CMakeFile.patch)
NOTE: Applying patch 'link-atomic-lib.patch' (../meta-tensorflow-lite/recipes-framework/tensorflow-lite/files/link-atomic-lib.patch)
ERROR: Applying patch 'link-atomic-lib.patch' on target directory '/home/nassim/cloned_repos/yocto-dev/build/tmp-glibc/work/riscv64-oe-linux/python3-tensorflow-lite/2.7.0-r0/git'
CmdError('quilt --quiltrc /home/nassim/cloned_repos/yocto-dev/build/tmp-glibc/work/riscv64-oe-linux/python3-tensorflow-lite/2.7.0-r0/recipe-sysroot-native/etc/quiltrc push', 0, "stdout: Applying patch link-atomic-lib.patch\ncan't find file to patch at input line 5\nPerhaps you used the wrong -p or --strip option?\nThe text leading up to this was:\n--------------------------\n|diff --git a/tensorflow/lite/tools/make/Makefile b/tensorflow/lite/tools/make/Makefile\n|index 9d90e9526be..1ba137304e7 100644\n|--- a/tensorflow/lite/tools/make/Makefile\n|+++ b/tensorflow/lite/tools/make/Makefile\n--------------------------\nNo file to patch. Skipping patch.\n1 out of 1 hunk ignored\ncan't find file to patch at input line 19\nPerhaps you used the wrong -p or --strip option?\nThe text leading up to this was:\n--------------------------\n|diff --git a/tensorflow/lite/tools/pip_package/setup.py b/tensorflow/lite/tools/pip_package/setup.py\n|index 8c122418abd..5ccd40683b1 100644\n|--- a/tensorflow/lite/tools/pip_package/setup.py\n|+++ b/tensorflow/lite/tools/pip_package/setup.py\n--------------------------\nNo file to patch. Skipping patch.\n1 out of 1 hunk ignored\nPatch link-atomic-lib.patch does not apply (enforce with -f)\n\nstderr: ")
DEBUG: Python function patch_do_patch finished
DEBUG: Python function do_patch finished

I am quite new to Yocto, so the cause is not trivial to me. Do you have an idea on what might be causing this?

@NobuoTsukamoto
Copy link
Owner

There seems to be a problem with link-atomic-lib.patch. I check the details of link-atomic-lib.patch. This patch may not be needed.

https://github.com/NobuoTsukamoto/meta-tensorflow-lite/blob/master/recipes-framework/tensorflow-lite/python3-tensorflow-lite_2.7.0.bb#L18

@NobuoTsukamoto
Copy link
Owner

@NassimEdi
Sorry for the late reply.
I'm working on a fix for a riscv64 build issue in the work_2.7_build branch.

  • Modifying the override syntax.
  • Fixed build error in simple_memory_arena_debug_dump.cc

With meta-polarfire-soc-yocto-bsp, the build of python3-tensorflorw-lite seems to be successful, but in the end I got the following error:
With meta-polarfire-soc-yocto-bsp, the build of python3-tensorflorw-lite seems to be successful, but in the end I got the following error:
I'm not sure if this is a problem with my environment. Is it possible to build and check in your environment?

$ bitbake mpfs-dev-cli
Loading cache: 100% |#########################################################################################################################################################################################################| Time: 0:00:00
Loaded 3781 entries from dependency cache.
Parsing recipes: 100% |#######################################################################################################################################################################################################| Time: 0:00:00
Parsing of 2443 .bb files complete (2441 cached, 2 parsed). 3783 targets, 168 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION           = "1.52.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "universal"
TARGET_SYS           = "riscv64-oe-linux"
MACHINE              = "qemuriscv64"
DISTRO               = "nodistro"
DISTRO_VERSION       = "nodistro.0"
TUNE_FEATURES        = "riscv64"
meta                 = "HEAD:63a235d86edb5ca628c8601ed06fb04da3186141"
meta-oe              
meta-python          
meta-multimedia      
meta-networking      = "HEAD:77718718cf0eec2c7119d101a353f343e2769b1b"
meta-riscv           = "HEAD:47faa008327abc388c52246b24a8a458b30b6f0d"
meta-polarfire-soc-yocto-bsp = "HEAD:02cb81741a5e1b37f89318d04ebc6b2854bfe736"
meta-tensorflow-lite = "master:5b200d7e76b92eeebd81ea3de06ad403eb7d0c62"

Initialising tasks: 100% |####################################################################################################################################################################################################| Time: 0:00:03
Sstate summary: Wanted 48 Local 0 Network 0 Missed 48 Current 2864 (0% match, 98% complete)
NOTE: Executing Tasks
WARNING: u-boot-1_2021.07-r0 do_fetch: Failed to fetch URL file://.txt, attempting MIRRORS if available
ERROR: u-boot-1_2021.07-r0 do_fetch: Fetcher failure: Unable to find file file://.txt anywhere. The paths that were searched were:
    /work/yocto-dev/meta-riscv/recipes-bsp/u-boot/files/nodistro
    /work/yocto-dev/meta-polarfire-soc-yocto-bsp/recipes-bsp/u-boot/files/nodistro
    /work/yocto-dev/openembedded-core/meta/recipes-bsp/u-boot/u-boot-2021.07/nodistro
    /work/yocto-dev/openembedded-core/meta/recipes-bsp/u-boot/u-boot/nodistro
    /work/yocto-dev/openembedded-core/meta/recipes-bsp/u-boot/files/nodistro
    /work/yocto-dev/meta-riscv/recipes-bsp/u-boot/files/qemuriscv64
    /work/yocto-dev/meta-polarfire-soc-yocto-bsp/recipes-bsp/u-boot/files/qemuriscv64
    /work/yocto-dev/openembedded-core/meta/recipes-bsp/u-boot/u-boot-2021.07/qemuriscv64
    /work/yocto-dev/openembedded-core/meta/recipes-bsp/u-boot/u-boot/qemuriscv64
    /work/yocto-dev/openembedded-core/meta/recipes-bsp/u-boot/files/qemuriscv64
    /work/yocto-dev/meta-riscv/recipes-bsp/u-boot/files/qemuall
    /work/yocto-dev/meta-polarfire-soc-yocto-bsp/recipes-bsp/u-boot/files/qemuall
    /work/yocto-dev/openembedded-core/meta/recipes-bsp/u-boot/u-boot-2021.07/qemuall
    /work/yocto-dev/openembedded-core/meta/recipes-bsp/u-boot/u-boot/qemuall
    /work/yocto-dev/openembedded-core/meta/recipes-bsp/u-boot/files/qemuall
    /work/yocto-dev/meta-riscv/recipes-bsp/u-boot/files/riscv64
    /work/yocto-dev/meta-polarfire-soc-yocto-bsp/recipes-bsp/u-boot/files/riscv64
    /work/yocto-dev/openembedded-core/meta/recipes-bsp/u-boot/u-boot-2021.07/riscv64
    /work/yocto-dev/openembedded-core/meta/recipes-bsp/u-boot/u-boot/riscv64
    /work/yocto-dev/openembedded-core/meta/recipes-bsp/u-boot/files/riscv64
    /work/yocto-dev/meta-riscv/recipes-bsp/u-boot/files/
    /work/yocto-dev/meta-polarfire-soc-yocto-bsp/recipes-bsp/u-boot/files/
    /work/yocto-dev/openembedded-core/meta/recipes-bsp/u-boot/u-boot-2021.07/
    /work/yocto-dev/openembedded-core/meta/recipes-bsp/u-boot/u-boot/
    /work/yocto-dev/openembedded-core/meta/recipes-bsp/u-boot/files/
    /work/yocto-dev/build/downloads
ERROR: u-boot-1_2021.07-r0 do_fetch: Bitbake Fetcher Error: FetchError('Unable to fetch URL from any source.', 'file://.txt')
ERROR: Logfile of failure stored in: /work/yocto-dev/build/tmp-glibc/work/qemuriscv64-oe-linux/u-boot/1_2021.07-r0/temp/log.do_fetch.180209
ERROR: Task (/work/yocto-dev/openembedded-core/meta/recipes-bsp/u-boot/u-boot_2021.07.bb:do_fetch) failed with exit code '1'
NOTE: Tasks Summary: Attempted 6971 tasks of which 6954 didn't need to be rerun and 1 failed.
NOTE: Writing buildhistory
NOTE: Writing buildhistory took: 1 seconds
NOTE: Build completion summary:
NOTE:   do_deploy_source_date_epoch: 0.0% sstate reuse(0 setscene, 1 scratch)
NOTE:   do_package_qa: 0.0% sstate reuse(0 setscene, 1 scratch)
NOTE:   do_packagedata: 0.0% sstate reuse(0 setscene, 1 scratch)
NOTE:   do_package_write_ipk: 0.0% sstate reuse(0 setscene, 1 scratch)
NOTE:   do_populate_lic: 0.0% sstate reuse(0 setscene, 1 scratch)

Summary: 1 task failed:
  /work/yocto-dev/openembedded-core/meta/recipes-bsp/u-boot/u-boot_2021.07.bb:do_fetch
Summary: There was 1 WARNING message shown.
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.

@NassimEdi
Copy link
Author

@NobuoTsukamoto,
When I remove the .bb for v2.7, the image build with python3-tensorflow-lite is entirely successful in my environment. Thank you for the help and good luck with the fix. I think we can close this issue.

@NobuoTsukamoto
Copy link
Owner

@NassimEdi
Fixed the recipe for v2.7.0. [25db850]
Fixed to be able to download modules related to TensorFlow Lite.
I don't have a PolarFire SoC HW so I can't see it working. Also, qemuriscv64 couldn't be built due to another factor (probably opensbi).

I will continue to check and if it works, I will merge it into the master branch.

Thank you very much for reporting this problem.

@NobuoTsukamoto
Copy link
Owner

@NassimEdi
Added libatomic link in the commit of 000d190.
This is because the following error occurred in qemuriscv64 built with sifive/freedom-u-sdk.

/usr/lib/python3.10/site-packages/tflite_runtime/_pywrap_tensorflow_interpreter_wrapper.so: undefined symbol: __atomic_compare_exchange_1

I think it will happen on the target of riscv64.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants