Torizon OS image fails to build

I have tried to build the latest TorizonOS (6.5.0) but it fails.

Here are the steps I followed.

export LANG=en_US.UTF-8
repo init -u git://git.toradex.com/toradex-manifest.git -b refs/tags/6.5.0 -m torizoncore/default.xml
repo sync --no-clone-bundle
MACHINE=verdin-imx8mp source setup-environment build
bitbake torizon-core-docker

After the last bitbake torizon-core-docker command, the build fails with the following error.
Does anyone know the cause of this?

imx8@c5e6ff0864a2:/home/share/imx8mp_dir/bitbake_torizon/build$ bitbake torizon-core-docker
Loading cache: 100% |####################################################################################################################################| Time: 0:00:00
Loaded 4727 entries from dependency cache.
Parsing recipes: 100% |##################################################################################################################################| Time: 0:00:01
Parsing of 3138 .bb files complete (3137 cached, 1 parsed). 4728 targets, 643 skipped, 11 masked, 0 errors.
WARNING: No recipes in default available for:
  /home/share/imx8mp_dir/bitbake_torizon/build/conf/../../layers/meta-toradex-nxp/recipes-bsp/imx-mkimage/imx-mkimage_1.0.bbappend
  /home/share/imx8mp_dir/bitbake_torizon/build/conf/../../layers/meta-toradex-nxp/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.20.0.imx.bbappend
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION           = "2.0.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "universal"
TARGET_SYS           = "aarch64-tdx-linux"
MACHINE              = "verdin-imx8mp"
DISTRO               = "torizon"
DISTRO_VERSION       = "6.5.0-devel-20240124134046+build.0"
TUNE_FEATURES        = "aarch64 armv8a crc cortexa53"
TARGET_FPU           = ""
meta-toradex-torizon = "HEAD:bb713b949d54f7c74cd3d6026ec7ae006837b3b7"
meta-toradex-security = "HEAD:1f9340dc9a90e6454e1517a45fb359899192e1b5"
meta-toradex-distro  = "HEAD:946425761f7aa044dd3721c0ef604490814be1aa"
meta-toradex-bsp-common = "HEAD:a69aa18b7792c102ffcf339ccd0e8b7aa3a43076"
meta-oe              
meta-networking      
meta-filesystems     
meta-python          
meta-perl            = "HEAD:402affcc073db39f782c1ebfd718edd5f11eed4c"
meta-virtualization  = "HEAD:88327090d26955a678c6f8bd2585aad4d802f6c4"
meta-updater         = "HEAD:9f7fe77932671751f3c7201d164ffbabd0cb2faf"
meta-toradex-nxp     = "HEAD:654e95a4c868fa717d213dcd668dffcc6241ced5"
meta-freescale       = "HEAD:47e0b467d8555e38a996b731977d9eed9ab02051"
meta-freescale-3rdparty = "HEAD:9e94b64bdfebcf7bfdf2af6447cec866a4efa814"
meta-yocto-bsp       
meta-poky            = "HEAD:77c2830ae0c3e7370f7c816796981932ba0ec99a"
meta-security        = "HEAD:1a3e42cedbd94ca73be45800d0e902fec35d0f0f"
meta-toradex-ti      = "HEAD:e3713897eaa255112f543f39596350c6b0a2a383"
meta-arm-toolchain   
meta-arm             = "HEAD:b187fb9232ca0a6b5f8f90b4715958546fc41d73"
meta-ti-bsp          
meta-ti-extras       = "HEAD:5769fcfb036661a3ceaeb8f90d8a9928e3d29199"
meta                 = "HEAD:2afd9a6002cba2a23dd62a1805b4be04083c041b"

Initialising tasks: 100% |###############################################################################################################################| Time: 0:00:03
Sstate summary: Wanted 2225 Local 0 Mirrors 0 Missed 2225 Current 208 (0% match, 8% complete)
NOTE: Executing Tasks
ERROR: perl-native-5.34.3-r0 do_compile: oe_runmake failed
ERROR: perl-native-5.34.3-r0 do_compile: ExecutionError('/home/share/imx8mp_dir/bitbake_torizon/build/tmp/work/x86_64-linux/perl-native/5.34.3-r0/temp/run.do_compile.29836', 1, None, None)
ERROR: Logfile of failure stored in: /home/share/imx8mp_dir/bitbake_torizon/build/tmp/work/x86_64-linux/perl-native/5.34.3-r0/temp/log.do_compile.29836
Log data follows:
| DEBUG: Executing shell function do_compile
| NOTE: make -j 16
| make: find: Operation not permitted
| make: find: Operation not permitted
| make: find: Operation not permitted
| make: /bin/sh: Operation not permitted
| make: /bin/sh: Operation not permitted
| make crosspatch
| make: make: Operation not permitted
| make: *** [Makefile:84: all] Error 127
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.
ERROR: Task (virtual:native:/home/share/imx8mp_dir/bitbake_torizon/build/conf/../../layers/openembedded-core/meta/recipes-devtools/perl/perl_5.34.3.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 735 tasks of which 719 didn't need to be rerun and 1 failed.
NOTE: Writing buildhistory
NOTE: Writing buildhistory took: 5 seconds

Summary: 1 task failed:
  virtual:native:/home/share/imx8mp_dir/bitbake_torizon/build/conf/../../layers/openembedded-core/meta/recipes-devtools/perl/perl_5.34.3.bb:do_compile
Summary: There was 1 WARNING message.
Summary: There were 2 ERROR messages, returning a non-zero exit code.
imx8@c5e6ff0864a2:/home/share/imx8mp_dir/bitbake_torizon/build$ 

Greetings @p-uchi,

Looks like some permissions issues with make:

| make: find: Operation not permitted
| make: find: Operation not permitted
| make: find: Operation not permitted
| make: /bin/sh: Operation not permitted
| make: /bin/sh: Operation not permitted
| make crosspatch
| make: make: Operation not permitted
| make: *** [Makefile:84: all] Error 127
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.

Seems like either some dependencies are missing from this build environment. Or for some reason the build does not have permissions to use the required tools (i.e. make).

Also looking at the command-line:

imx8@c5e6ff0864a2:/home/share/imx8mp_dir/bitbake_torizon/build$

Where is this build running? On an imx8?

Best Regards,
Jeremias

Thank you, @jeremias.tx,

Seems like either some dependencies are missing from this build environment. Or for some reason the build does not have permissions to use the required tools (i.e. make).

Ok, I’ll revisit the build environment.

Where is this build running? On an imx8?
No. I’m running it on the host’s desktop PC, not on the imx8 board.

Please let us know if you uncover something. I have not experienced this particular issue myself so it would be good to know what causes it.

Best Regards,
Jeremias

Greetings @jeremias.tx,

I found the cause.
I added the --privileged option to the docker run command, referring to the discussion below.
That worked!

Perl-native yocto error - Technical Support - Toradex Community

I see, I didn’t know you were using a Docker container to build your image. This makes sense now. Glad you were able to find the solution here.

Best Regards,
Jeremias