riscv / meta-riscv

OpenEmbedded/Yocto layer for RISC-V Architecture
https://riscv.org/
Other
358 stars 136 forks source link

Dependency loop when building BSP for SiFive Unleashed #381

Closed ivysochyn closed 1 year ago

ivysochyn commented 1 year ago

Description

The bitbake opensbi (as well as other targets) are failing on the parsing stage as 11 dependency loops were found. The main problem is that the OpenSBI recipe depends on linux:do_deploy() and u-boot:do_deploy() (as it requires a binary of device tree for compilation process), and u-boot has dependency on OpenSBI, what generates multiple loops.

Steps to reproduce the issue: In order to reproduce the error I used the Langdale release of meta-riscv layer.

  1. Initialize the project
    mkdir riscv-yocto && cd riscv-yocto
    repo init -u https://github.com/riscv/meta-riscv  -b langdale -m tools/manifests/riscv-yocto.xml
    repo sync
    repo start work --all
  2. Initialize the building environment
    source meta-riscv/setup.sh
  3. Try to build the target
    MACHINE="freedom-u540" bitbake opensbi

Describe the results you received: On the output I got list of 11 dependency loops that were found by bitbake tool:

Dependency loop #1 found:                                                                                                                                     
  Task /data/meta-riscv/recipes-kernel/linux/linux-mainline_5.18.bb:do_assemble_fitimage (dependent Tasks ['linux-mainline_5.18.bb:do_kernel_generate_rsa_keys', 'linux-mainline_5.18.bb:do_compile', 'u-boot_2022.10.bb:do_populate_sysroot'])                                                                                                                                                            
  Task /data/meta-riscv/recipes-kernel/linux/linux-mainline_5.18.bb:do_install (dependent Tasks ['linux-mainline_5.18.bb:do_sizecheck', 'pseudo_git.bb:do_populate_sysroot', 'linux-mainline_5.18.bb:do_transform_kernel', 'linux-mainline_5.
18.bb:do_assemble_fitimage', 'linux-mainline_5.18.bb:do_compile'])                                                                                                                                                                             Task /data/meta-riscv/recipes-kernel/linux/linux-mainline_5.18.bb:do_bundle_initramfs (dependent Tasks ['linux-mainline_5.18.bb:do_install'])               
  Task /data/meta-riscv/recipes-kernel/linux/linux-mainline_5.18.bb:do_assemble_fitimage_initramfs (dependent Tasks ['linux-mainline_5.18.bb:do_bundle_initramfs'])                                                                          
  Task /data/meta-riscv/recipes-kernel/linux/linux-mainline_5.18.bb:do_deploy (dependent Tasks ['linux-mainline_5.18.bb:do_bundle_initramfs', 'linux-mainline_5.18.bb:do_populate_sysroot', 'depmodwrapper-cross_1.0.bb:do_populate_sysroot',
 'linux-mainline_5.18.bb:do_assemble_fitimage_initramfs', 'linux-mainline_5.18.bb:do_packagedata', 'pigz_2.7.bb:do_populate_sysroot'])                                                                     
  Task /data/openembedded-core/meta/recipes-bsp/opensbi/opensbi_1.1.bb:do_compile (dependent Tasks ['u-boot_2022.10.bb:do_deploy', 'opensbi_1.1.bb:do_configure', 'linux-mainline_5.18.bb:do_deploy'])                                       
  Task /data/openembedded-core/meta/recipes-bsp/opensbi/opensbi_1.1.bb:do_install (dependent Tasks ['opensbi_1.1.bb:do_compile', 'pseudo_git.bb:do_populate_sysroot'])                                     
  Task /data/openembedded-core/meta/recipes-bsp/opensbi/opensbi_1.1.bb:do_deploy (dependent Tasks ['opensbi_1.1.bb:do_install'])                                                                           
  Task /data/openembedded-core/meta/recipes-bsp/u-boot/u-boot_2022.10.bb:do_compile (dependent Tasks ['u-boot_2022.10.bb:do_configure', 'opensbi_1.1.bb:do_deploy'])  
  Task /data/openembedded-core/meta/recipes-bsp/u-boot/u-boot_2022.10.bb:do_install (dependent Tasks ['u-boot_2022.10.bb:do_compile', 'u-boot_2022.10.bb:do_create_extlinux_config', 'pseudo_git.bb:do_populate_sysroot', 'u-boot_2022.10.bb:
do_uboot_assemble_fitimage'])                                                                                                                                                                              
  Task /data/openembedded-core/meta/recipes-bsp/u-boot/u-boot_2022.10.bb:do_populate_sysroot (dependent Tasks ['u-boot_2022.10.bb:do_install', 'binutils-cross_2.39.bb:do_populate_sysroot'])                                                                                                                                                                                                              
Dependency loop #2 found: 
...                                                 

Describe the results you expected: The building process start was expected.

Additional information you deem important (e.g. issue happens only occasionally): I believe that problem will be traced for any targets under the generic platform group for OpenSBI as they all require the device tree to be passed during the compilation stage.

Additional details (revisions used, host distro, etc.):

Build Configuration:                                                                                                                                          
BB_VERSION           = "2.2.0"                                                                                                                                
BUILD_SYS            = "x86_64-linux"                                                                                                                         
NATIVELSBSTRING      = "debian-11"                                                                                                                            
TARGET_SYS           = "riscv64-oe-linux"                                                                                                                     
MACHINE              = "freedom-u540"                                                                                                                         
DISTRO               = "nodistro"                                                                                                                             
DISTRO_VERSION       = "nodistro.0"                                                                                                                           
TUNE_FEATURES        = "riscv64"                                                                                                                              
meta                 = "work:57239d66b933c4313cf331d35d13ec2d0661c38f"                                                                                        
meta-oe                                                                                                                                                       
meta-python                                                                                                                                                   
meta-multimedia                                                                                                                                               
meta-networking      = "work:84ffd15cd1f77da445c9900a2d08892cd58f3313"                                                                                        
meta-riscv           = "work:3b122e49f7287ab446e1ead1e302eb306ce5e8eb" 
kraj commented 1 year ago

for freedom-u540 its better to include meta-sifive layer where it is maintained uptodate here https://github.com/sifive/meta-sifive

After running source meta-riscv/setup.sh do following

cd ..
git clone https://github.com/sifive/meta-sifive
cd -
bitbake-layers add-layer ../meta-sifive

Then do the

MACHINE="freedom-u540" bitbake opensbi