]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
classes/meson: dump the end of the meson-log.txt on failure
authorRoss Burton <ross.burton@arm.com>
Fri, 28 Nov 2025 13:13:40 +0000 (13:13 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 8 Dec 2025 14:45:36 +0000 (14:45 +0000)
When 'meson setup' fails it just prints the summary of the failure and
leaves the full details in the meson-log.txt.

  ../sources/xorgproto-2024.1/meson.build:22:0: ERROR:
  Executables created by c compiler x86-poky-linux-gcc [...] are not runnable.

  A full log can be found at [${B}]/meson-logs/meson-log.txt
  ERROR: meson failed

In CI systems where the build tree is then thrown away this is not very
useful, so on failure also output the last ten lines of the log file:
hopefully that is enough for context without flooding the logs.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-recipe/meson.bbclass

index c8b3e1ec29a986a4c15ea4526af8fed752044b8a..45d43319f9ce353da425831704e0bc00e373bf0f 100644 (file)
@@ -174,7 +174,13 @@ meson_do_configure() {
 
     bbnote Executing meson ${EXTRA_OEMESON}...
     if ! meson setup ${MESONOPTS} "${MESON_SOURCEPATH}" "${B}" ${MESON_CROSS_FILE} ${EXTRA_OEMESON}; then
-        bbfatal_log meson failed
+        MESON_LOG=${B}/meson-logs/meson-log.txt
+        if test -f $MESON_LOG; then
+            printf "\nLast 10 lines of meson-log.txt:\n"
+            tail --lines=10 $MESON_LOG
+            printf "\n"
+        fi
+        bbfatal_log meson setup failed
     fi
 }