Bug 15486 - Meson broken in eSDK
Summary: Meson broken in eSDK
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: devtools / tool chain (show other bugs)
Version: 5.0
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 5.3 M2
Assignee: Ross Burton
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2024-05-17 16:28 UTC by Ross Burton
Modified: 2025-08-21 14:47 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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).