[libvirt PATCH v2 05/35] ci: build.sh: Add a wrapper function over meson's setup

Erik Skultety posted 35 patches 1 year, 3 months ago
[libvirt PATCH v2 05/35] ci: build.sh: Add a wrapper function over meson's setup
Posted by Erik Skultety 1 year, 3 months ago
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@redhat.com>
Erik Skultety <eskultet@redhat.com>:
---
 ci/build.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/ci/build.sh b/ci/build.sh
index 5883542b45..477ccbc7d1 100644
--- a/ci/build.sh
+++ b/ci/build.sh
@@ -32,3 +32,8 @@ run_cmd() {
     printf "\e[32m[RUN COMMAND]: '%s'\e[0m\n" "$*"
     $@
 }
+
+run_meson_setup() {
+    run_cmd meson setup build --error -Dsystem=true $MESON_OPTS $MESON_ARGS || \
+    (cat "${GIT_ROOT}/build/meson-logs/meson-log.txt" && exit 1)
+}
-- 
2.41.0
Re: [libvirt PATCH v2 05/35] ci: build.sh: Add a wrapper function over meson's setup
Posted by Daniel P. Berrangé 1 year, 3 months ago
On Mon, Sep 11, 2023 at 03:43:06PM +0200, Erik Skultety wrote:
> 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@redhat.com>
> Erik Skultety <eskultet@redhat.com>:
> ---
>  ci/build.sh | 5 +++++
>  1 file changed, 5 insertions(+)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|