[libvirt PATCH 0/2] ci: Some build.sh fixes

Initially reported in https://listman.redhat.com/archives/libvir-list/2023-August/241307.html Andrea Bolognani (2): ci: Fix precedence between arguments passed to meson ci: Fix quoting and option name ci/build.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) -- 2.41.0

Commit 9c9848f955fd merged $MESON_OPTS into $MESON_ARGS, and while doing so changed their behavior: while until then the contents of $MESON_ARGS had precedence over those of $MESON_OPTS, now the opposite is true. Restore the original behavior and document it. The argument for merging the two variables in the first place was that having both present on the meson command line could be confusing; however, that should no longer be the case now that we have reasonably extensive comments explaining the role of each of the variables and how they interact with each other, so return the meson command line to its original form. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- ci/build.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ci/build.sh b/ci/build.sh index ed9b1f4473..0e07b2e59d 100644 --- a/ci/build.sh +++ b/ci/build.sh @@ -12,10 +12,12 @@ export VIR_TEST_DEBUG=1 # 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 +# +# The contents of $MESON_ARGS (defined locally) should take precedence over +# those of $MESON_OPTS (defined when the container was built), so they're +# passed to meson after them -MESON_ARGS="$MESON_ARGS $MESON_OPTS" - -meson setup build --werror -Dsystem=true $MESON_ARGS || \ +meson setup build --werror -Dsystem=true $MESON_OPTS $MESON_ARGS || \ (cat build/meson-logs/meson-log.txt && exit 1) ninja -C build $NINJA_ARGS -- 2.41.0

Multiple values passed to --meson-args need to be quoted so that the shell will interpret them correctly. The option's name was also reported incorrectly, so fix that as well. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- ci/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build.sh b/ci/build.sh index 0e07b2e59d..d5ed8ad104 100644 --- a/ci/build.sh +++ b/ci/build.sh @@ -10,7 +10,7 @@ export VIR_TEST_DEBUG=1 # # $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 +# `$ helper build --meson-args='-Dopt1 -Dopt2'` when run in a local # containerized environment # # The contents of $MESON_ARGS (defined locally) should take precedence over -- 2.41.0

On a Thursday in 2023, Andrea Bolognani wrote:
Initially reported in
https://listman.redhat.com/archives/libvir-list/2023-August/241307.html
Andrea Bolognani (2): ci: Fix precedence between arguments passed to meson ci: Fix quoting and option name
ci/build.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano
participants (2)
-
Andrea Bolognani
-
Ján Tomko