[libvirt PATCH 04/33] ci: build.sh: Add a wrapper function over meson's setup

Erik Skultety eskultet at redhat.com
Fri Aug 25 17:55:12 UTC 2023


The reason for this wrapper is that all job functions introduced in
future patches will refer to this one instead of open-coding the same
'meson setup' invocation N times. It also prevents 'setup' to be called
multiple times as some future job functions might actually do just that
in a transitive manner.

Signed-off-by: Erik Skultety <eskultet at redhat.com>
---
 ci/build.sh | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/ci/build.sh b/ci/build.sh
index 82016ba29c..02ff1a8388 100644
--- a/ci/build.sh
+++ b/ci/build.sh
@@ -24,3 +24,20 @@ meson setup build --werror -Dsystem=true $MESON_ARGS || \
 (cat build/meson-logs/meson-log.txt && exit 1)
 
 ninja -C build $NINJA_ARGS
+
+run_meson_setup() {
+    if [ -d "${GIT_ROOT}/build/meson-private" ]; then
+        return
+    fi
+
+    local DUMP_ERR_CMD="cat ${GIT_ROOT}/build/meson-logs/meson-log.txt"
+    local SETUP_CMD="meson \
+                     setup \
+                     build \
+                     --werror \
+                     -Dsystem=true $MESON_OPTS $MESON_ARGS"
+
+    local CMD="$SETUP_CMD || ($DUMP_ERR_CMD && exit 1)"
+
+    run_cmd "$CMD"
+}
-- 
2.41.0



More information about the libvir-list mailing list