On Tue, 2026-05-19 at 06:28 +0000, Jamin Lin via lists.openembedded.org
wrote:
> Hi Paul,
> 
> > Subject: Re: [PATCH v1 1/2] externalsrc: Handle nested git repos from 
> > multiple
> > SRC_URI entries
> > 
> > On Fri, 2026-05-15 at 09:36 +0000, Jamin Lin wrote:
> > > When a recipe uses multiple git SRC_URI entries with different
> > > destsuffix values (e.g. Zephyr-based recipes with separate repos for
> > > the kernel, modules, and application), each source is unpacked into a
> > > subdirectory of EXTERNALSRC that retains its own .git directory.
> > > 
> > > srctree_hash_files() calls 'git add -A .' at the EXTERNALSRC root,
> > > which fails with exit code 128 when git encounters these unregistered
> > > nested git repositories, halting the bitbake parse phase.
> > 
> > Is this true? The documentation for `git add` [1] talks about issuing a 
> > warning
> > when this occurs, not an error, and in some quick local testing I get a 
> > successful
> > exit (exit code 0) when I try this.
> > 
> 
> Please try the "zephyr-helloworld" package.
> 
> This recipe uses multiple Git repositories in "SRC_URI", and I can reproduce 
> the issue with this package:
> 
> https://git.yoctoproject.org/meta-zephyr/tree/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-kernel-src-4.3.0.inc
>  
> 
> Steps to reproduce:
> 
> 1. git clone https://github.com/openembedded/bitbake.git
> 2. git clone https://github.com/openembedded/openembedded-core.git
> 3. git clone https://git.yoctoproject.org/meta-zephyr
> 4. git clone https://github.com/openembedded/meta-openembedded.git
> 5. source openembedded-core/oe-init-build-env build
> 6. Edit build/conf/bblayers.conf and add the following layers:
> 
>    * meta-openembedded/meta-python
>    * meta-zephyr/meta-zephyr-core
>    * meta-openembedded/meta-oe
> 7. devtool modify zephyr-helloworld
> 8. bitbake -c cleanall zephyr-helloworld
> 9. bitbake zephyr-helloworld
> 
> After that, the following parser error occurs, and the package can no longer 
> be built:
> 
> ```text
> jamin_lin@aspeed-fw02:~/oe-review/build$ bitbake zephyr-helloworld
> Loading cache: 100% 
> |#########################################################################################################################################################################################################|
>  Time: 0:00:01
> Loaded 4949 entries from dependency cache.
> ERROR: ExpansionError during parsing 
> /home/jamin_lin/oe-review/meta-zephyr/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-helloworld.bb
> bb.data_smart.ExpansionError: Failure expanding variable 
> do_compile[file-checksums], expression was ${@srctree_hash_files(d)} which 
> triggered exception CalledProcessError: Command '['git', 'add', '-A', '.']' 
> returned non-zero exit status 128.
> The variable dependency chain for the failure is: do_compile[file-checksums]
> 
> ERROR: Parsing halted due to errors, see error messages above
> Parsing recipes:   0% |                                                       
>                                                                               
>                                                                  | ETA:  
> --:--:--
> Summary: There were 2 ERROR messages, returning a non-zero exit code.
> ```

Following these steps I see the same error. But the cause is not the
nested git repositories. `bitbake -c cleanall ...` has deleted the
sources from the downloads directory, but the devtool workspace is still
referencing the deleted sources. Even a `git status` command in the
zephyr-helloworld sources directory fails:

  $ git -C workspace/sources/zephyr-helloworld status
  error: unable to normalize alternate object path: 
/home/pbarker/bitbake-builds/.bitbake-setup-downloads/git2/github.com.zephyrproject-rtos.mcuboot//objects
  error: unable to normalize alternate object path: 
/home/pbarker/bitbake-builds/.bitbake-setup-downloads/git2/github.com.zephyrproject-rtos.mcuboot//objects
  error: unable to normalize alternate object path: 
/home/pbarker/bitbake-builds/.bitbake-setup-downloads/git2/github.com.zephyrproject-rtos.mcuboot//objects
  error: unable to normalize alternate object path: 
/home/pbarker/bitbake-builds/.bitbake-setup-downloads/git2/github.com.zephyrproject-rtos.mcuboot//objects
  fatal: bad object HEAD
  fatal: 'git status --porcelain=2' failed in submodule bootloader/mcuboot

If I replace step 8 with `bitbake -c cleansstate ...` then there is no
parse error.

What we need to fix is the interaction between `devtool modify` and
`bitbake -c cleanall`. Perhaps devtool needs to detect this broken state
and tell the user how to fix it - simply running `bitbake -c fetch
zephyr-helloworld` isn't possible as the metadata can't be parsed.

Best regards,

-- 
Paul Barker

Attachment: signature.asc
Description: This is a digitally signed message part

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#237299): 
https://lists.openembedded.org/g/openembedded-core/message/237299
Mute This Topic: https://lists.openembedded.org/mt/119327122/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to