Linux-toradex task fails while compiling using Yocto project

Following instructions in https://developer.toradex.com/torizon/in-depth/build-torizoncore-from-source-with-yocto-projectopenembedded/, I am trying to build Torizon OS using Yocto project:-
Machine name: colibri-imx7-emmc
Distro: torizon
Image: torizon-minimal

I am constantly getting error while baking “linux-toradex”. I have run several times by clearing tmp folder but still getting the following error:-

ERROR: Task (/home/testing/YoctoProject/Toradex/build/conf/…/…/layers/meta-freescale-3rdparty/recipes-kernel/linux/linux-toradex_5.4-2.3.x.bb:do_compile) failed with exit code ‘1’

I am attaching the error logfile here.
log.do_compile.65414 (131.5 KB)

Please help urgently.

Greetings @rajdeepteck123,

Your build environment here is not making sense to me. You say you’re building for colibri-imx7-emmc, but then you list the DISTRO as torizon. The only valid DISTRO for this machine in Torizon OS is torizon-upstream.

Next, you say you are building the torizon-minimal image. But according to your logs you’re building the “5.4-2.3” linux-toradex kernel. This version of the kernel was for versions 5.X of the OS. But, if you are building for 5.X then this does not make sense. The image name torizon-minimal did not exist back in 5.X, the name was different back then as seen here: meta-toradex-torizon/recipes-images/images/torizon-core-lite.bb at dunfell-5.x.y · torizon/meta-toradex-torizon · GitHub

It looks like to me you setup your build environment very strangely and this may be the cause of the issues you are seeing.

Best Regards,
Jeremias

Thanks @jeremias.tx
I changed the DISTRO to torizon-upstream and was able to build torizon-minimal image.

Is it possible to install a GUI framework like GTK on torizon-minimal?

I changed the DISTRO to torizon-upstream and was able to build torizon-minimal image.

That’s good to hear.

Is it possible to install a GUI framework like GTK on torizon-minimal?

Most things in Yocto should be possible, it’s just a matter of figuring it out. That said I’ve never tried adding GTK in Yocto so this is something you’ll need to experiment with.

Best Regards,
Jeremias

@jeremias.tx I followed the steps required to create a recipe to add a python package from pypi.org as mentioned here: https://developer.toradex.com/linux-bsp/application-development/programming-languages/python-in-linux

While trying to bake the recipe I get the following error:-

ParseError at /home/testing/YoctoProject/Toradex2/build/conf/…/…/layers/meta-teckinsoft/recipes-devtools/python-tinydb/python-tinydb_4.8.0.bb:1: Could not inherit file classes/setuptools.bbclass

Please help. Basically, I want to install pip which will help to install python packages as required later.

Basically, I want to install pip which will help to install python packages as required later.

Then why not just include the python3-pip recipe that is readily available in openembedded-core?: python3-pip_22.0.3.bb « python « recipes-devtools « meta - openembedded-core - OpenEmbedded Core layer

Also if you don’t mind me asking. Is there a reason you’re trying to build Torizon with Yocto like this? Rather than use it the “recommended” way using containers and such? It does not seem like you have much Yocto experience. While we can support you a bit on this, we don’t have the capacity to teach you how to use Yocto.

Best Regards,
Jeremias

@jeremias.tx Yes, you are right, I do not have much Yocto experience. But I found using containers a bit awkward especially coming from an embedded programming background.

The recipe available in openembedded-core doesn’t do much but installs patches. However, I found some excellent tools: (a) pipoe (b) pip2bitbake which help in creating recipes for installing any package from pypi.

With the help of these tools, I could get pip in torizon-minimal image.

Thanks for your time and help.

The recipe available in openembedded-core doesn’t do much but installs patches.

The recipe does install pip. Did you actually try using it and confirm such?

However, I found some excellent tools: (a) pipoe (b) pip2bitbake which help in creating recipes for installing any package from pypi.

I’m glad you were able to find someway to move on.

Yes, you are right, I do not have much Yocto experience. But I found using containers a bit awkward especially coming from an embedded programming background.

Could you share what you found awkward about using containers? It would be helpful feedback for us.

Best Regards,
Jeremias

Hi @jeremias.tx, sorry for the delayed reply.

The recipe does install pip. Did you actually try using it and confirm such?

Yes, I did use that at first but after uploading the image on the target, I got “pip: command not found”. Also, there was no pip in the bin folder.

Could you share what you found awkward about using containers? It would be helpful feedback for us.

Well mainly two reasons: (1) we are working on real-time system for our application and the presence of a container layer does reduce performance and increase jitter in out application.
(2) Writing a Dockerfile is something our application team has no experience and finds it really complicated. They are more familiar with use of libraries/modules which are pre-installed in the target system. May be in due course of time, we will pick up this skill!

Yes, I did use that at first but after uploading the image on the target, I got “pip: command not found”. Also, there was no pip in the bin folder.

Really? It worked fine for me.

Well mainly two reasons: (1) we are working on real-time system for our application and the presence of a container layer does reduce performance and increase jitter in out application.

Did you run some tests to observe this performance/jitter? Was it off by a lot compared to a non-container application?

Best Regards,
Jeremias

Did you run some tests to observe this performance/jitter? Was it off by a lot compared to a non-container application?

We ran stress-test and real-time cyclictest in both scenarios: with and without docker.

  1. Average latencies were double in the case with Docker (20us without docker and 40us with docker)
  2. But max latencies were vastly different (~200us without docker and ~42ms with docker)

Interesting, thank you for sharing the results. For context are these latencies from running stress-test/cylictest on the host? or in a container? Obviously the cases without Docker are on the host, but the testcases with Dcoker, where are the tests being executed? In or out of the container?

Also what are your requirements in terms of latencies?

Best Regards,
Jeremias