From 9c9848f955fd2b42e7f258b945cd90aacd2c114e Mon Sep 17 00:00:00 2001 From: Erik Skultety Date: Wed, 1 Feb 2023 15:22:59 +0100 Subject: [PATCH] ci: build.sh: Join MESON_ARGS and MESON_OPTS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is quite confusing seeing these two in a call like this one: $ meson build $MESON_OPTS $MESON_ARGS One has to ask 'how are they different' and 'shouldn't these be merged'. In fact, these variables hold very different things and we should make it more obvious. The problem is that renaming MESON_OPTS to something more meaningful, like 'MESON_CROSS_OPTS' which is what MESON_OPTS really does would require changes to lcitool and would impact Dockerfile generation which in turn might have an impact on other projects which rely on this lcitool functionality which is risky. Instead, provide a docstring for the former to supplement the latter and join the two variables in a single one MESON_ARGS which is then passed to meson's command line so it's a little less confusing. Signed-off-by: Erik Skultety Reviewed-by: Daniel P. Berrangé --- ci/build.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ci/build.sh b/ci/build.sh index 9489c4ab2f..ed9b1f4473 100644 --- a/ci/build.sh +++ b/ci/build.sh @@ -7,8 +7,15 @@ export VIR_TEST_DEBUG=1 # $MESON_OPTS is an env that can optionally be set in the container, # populated at build time from the Dockerfile. A typical use case would # be to pass options to trigger cross-compilation +# +# $MESON_ARGS correspond to meson's setup args, i.e. configure args. It's +# populated either from a GitLab's job configuration or from command line as +# `$ helper build --meson-configure-args=-Dopt1 -Dopt2` when run in a local +# containerized environment -meson setup build --werror -Dsystem=true $MESON_OPTS $MESON_ARGS || \ +MESON_ARGS="$MESON_ARGS $MESON_OPTS" + +meson setup build --werror -Dsystem=true $MESON_ARGS || \ (cat build/meson-logs/meson-log.txt && exit 1) ninja -C build $NINJA_ARGS