[libvirt PATCH v2 1/2] ci: Switch to meson build system

Andrea Bolognani abologna at redhat.com
Fri Nov 20 15:29:18 UTC 2020


On Mon, 2020-11-09 at 12:20 +0100, Erik Skultety wrote:
> First add the meson required bits to be able to run the build.
> NOTE: inspired by our gitlab-ci.yml

This note seems unnecessary.

> +++ b/ci/Makefile
> @@ -227,6 +230,8 @@ ci-run-command@%: ci-prepare-tree
>  		  CI_CONFIGURE="$(CI_CONFIGURE)" \
>  		  CI_CONFIGURE_ARGS="$(CI_CONFIGURE_ARGS)" \
>  		  CI_MAKE_ARGS="$(CI_MAKE_ARGS)" \
> +		  MESON_OPTS="$$MESON_OPTS" \

Please keep this right after CONFIGURE_OPTS and before all the CI_*
variables.

> +++ b/ci/build.sh
> -mkdir -p "$CI_CONT_BUILDDIR" || exit 1
> -cd "$CI_CONT_BUILDDIR"
> +mkdir -p "$CI_CONT_SRCDIR" || exit 1
> +cd "$CI_CONT_SRCDIR"

$CI_CONT_SRCDIR is the source directory, which is guaranteed to exist
because we mount it inside the container as a volume. So you can drop
the first line altogether.

> +meson build --werror $MESON_OPTS || (cat build/meson-logs/meson-log.txt && exit 1)
> +ninja -C build $CI_NINJA_ARGS

We enable -Werror automatically when building from a git clone, which
is always going to be the case when using this scaffoling, so I think
you can leave that option out. I see it's used in the GitLab CI
configuration, so you can maybe keep it in right now and then
consider removing it from both places at the same time.

>  find -name test-suite.log -delete

This should be updated to look for testlog.txt instead, but actually
you might be able to leave it out completely since meson seems to do
a good job at displaying the relevant part of the log if a test
fails? We don't have anything like this in the GitLab CI
configuration, so either it's not needed here either or we should add
it there as well.

Either way, removing the log files right after they've been created
by calling ninja is most likely not what you wanted :)

>  if test $? != 0; then \
>      LOGS=$(find -name test-suite.log)
>      if test "$LOGS"; then

If we determine showing the logs manually is not necessary, this
entire hunk can go.

-- 
Andrea Bolognani / Red Hat / Virtualization




More information about the libvir-list mailing list