Re: ELC-E Zephyr Multiimage BoF - Bob Build Tool


Bolivar, Marti
 

"Jan Kloetzke via Lists.Zephyrproject.Org"
<jan=kloetzke.net@lists.zephyrproject.org> writes:

On Fri, Nov 01, 2019 at 09:24:59AM +0000, Bolivar, Marti wrote:
"Jan Kloetzke via Lists.Zephyrproject.Org"
<jan=kloetzke.net@lists.zephyrproject.org> writes:

Hi Kumar,

On Wed, Oct 30, 2019 at 02:05:36AM -0500, Kumar Gala wrote:

On Oct 29, 2019, at 5:08 AM, jan@kloetzke.net wrote:

Hi,

I think the https://github.com/BobBuildTool/bob-example-embedded
example is the most interesting one to the Zephyr community (even
though it's using FreeRTOS+Linux at the moment).

If you guys have a particular example that already builds multiple
dependent Zephyr images then we can try to setup some Bob recipes
that builds the same thing...

/Jan
You can take a look at the open-amp sample, it creates 2 zephyr images:

https://github.com/zephyrproject-rtos/zephyr/tree/master/samples/subsys/ipc/openamp
I'm currently preparing some recipes. It will post them with some
instructions how to build in the next days once I got it working...
Ok, here it is: https://github.com/jkloetzke/zephyr-example-recipes

There is a README.md with a short overview. Basically you just have to
clone the recipes and build it:

$ git clone https://github.com/jkloetzke/zephyr-example-recipes.git \
--recurse-submodules
$ cd zephyr-example-recipes
$ bob dev demo::zephyr -j

Make sure that you have the latest version of Bob. The demo recipes use
the "layers" feature that has not been released yet. It's best to
install Bob via:

$ pip3 install [--user] git+https://github.com/BobBuildTool/bob

Otherwise have a look at

https://bob-build-tool.readthedocs.io/en/latest/installation.html

for further options.

Note that the recipes do not use west but clone the involved
repositories directly and calls cmake itself. This has the advantage
that there is only one tool that fetches/updates sources.
Seems like zephyr.yaml is the file controlling this in a map called
checkoutSCM. (I haven't read the bob docs, but I'm sure that's covered
there.)

I made a quick hack west extension to convert the upstream zephyr
manifest into the format used there, in case it's useful:

https://github.com/mbolivar/tree/bob-the-builder

Example:

$ west gen-bob-checkout
checkoutSCM:
- commit: 07380358424edecdefeb28ed7cb43e27b530014d
dir: zephyr
scm: git
url: https://github.com/zephyrproject-rtos/zephyr
- commit: 04ff67a0826a51041e51034faf8fc4d3eeacd846
dir: modules/hal/atmel
scm: git
url: https://github.com/zephyrproject-rtos/hal_atmel
- commit: e01f3bce2a94847253369efb9a081f5c0e9ec882
dir: tools/ci-tools
scm: git
url: https://github.com/zephyrproject-rtos/ci-tools
- commit: 99129c5efc907ea613c4b73ccff07581feb58a7a
dir: modules/lib/civetweb
scm: git
url: https://github.com/zephyrproject-rtos/civetweb
[...]

Just in case it's useful to anyone who wants all the projects but
doesn't want to do the paperwork themselves.

Additionally
the OpenAMP sample was put into a dedicated repository because some
refactoring was needed, namely removing the "ExternalProject" link
between the images.

The recipes also show how a toolchain is defined in the recipes. There
is no need for the user to install a toolchain but the right one is
brought in by the recipes automatically. Usually this is done with all
involved tools to maximize reproducibility but this would have just made
the example more complicated.

Sounds great!

Please be aware of this in that case:

https://github.com/zephyrproject-rtos/zephyr/issues/19918

It would be good to see a solution that doesn't have this issue.
This is handled well by Bob. The explicit goal of Bob is to feel like
"make" even though Bob controls the build of whole packages.

Have fun.

/Jan

Join devel@lists.zephyrproject.org to automatically receive all group messages.