Bug 15486

Summary: Meson broken in eSDK
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Ross Burton <ross.burton>
Component: devtools / tool chainAssignee: Ross Burton <ross.burton>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: meta.mr.watcher, meta.watcher, randy.macleod
Version: 5.0   
Target Milestone: 5.3 M2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Ross Burton 2024-05-17 16:28:40 UTC
Meson is broken in an eSDK.

Once a eSDK has been built/installed, you need to install meson itself:

$ devtool sdk-install meson-native

But then running 'meson' doesn't actually inject the cross variables as it does with a normal SDK:

$ meson build
The Meson build system
Version: 1.3.1
Source dir: /home/rosbur01/Mess/libepoxy-1.5.3
Build dir: /home/rosbur01/Mess/libepoxy-1.5.3/build
Build type: native build
Project name: libepoxy
Project version: 1.5.3

meson.build:1:0: ERROR: Could not invoke sanity test executable: [Errno 8] Exec format error: '/home/rosbur01/Mess/libepoxy-1.5.3/build/meson-private/sanitycheckc.exe'.

Note how it thinks its doing a native build, but is using the cross compiler.

This is because the wrapper script only redirects if OECORE_NATIVE_SYSROOT is set, and it is not inside an eSDK.  We can manually set it for testing:

$ export OECORE_NATIVE_SYSROOT=/home/rosbur01/esdk/tmp/sysroots/aarch64
$ meson setup build
meson-wrapper: Running meson with setup options: " --cross-file=/home/rosbur01/esdk/tmp/sysroots/aarch64/usr/share/meson/i686-poky-linux-meson.cross --native-file=/home/rosbur01/esdk/tmp/sysroots/aarch64/usr/share/meson/meson.native "
Could not find any valid candidate for cross files: /home/rosbur01/esdk/tmp/sysroots/aarch64/usr/share/meson/i686-poky-linux-meson.cross

ERROR: Cannot find specified cross file: /home/rosbur01/esdk/tmp/sysroots/aarch64/usr/share/meson/i686-poky-linux-meson.cross

The meson.cross file doesn't exist because it is meant to be generated by the meson-setup.py as part of the relocation process, which is done totally differently in eSDK.
Comment 1 Ross Burton 2025-08-21 14:47:51 UTC
Fixed proper eSDK, minimal eSDK still broken (https://bugzilla.yoctoproject.org/show_bug.cgi?id=15854).