[libvirt] [jenkins-ci PATCH 1/7] jobs: add a template for Meson

Andrea Bolognani abologna at redhat.com
Mon Aug 26 08:21:07 UTC 2019


On Tue, 2019-08-20 at 22:07 +0200, Fabiano Fidêncio wrote:
> jobs: add a template for Meson

Change this to

  jenkins: Add Meson jobs

> +++ b/jenkins/jobs/defaults.yaml
>        export PKG_CONFIG_PATH="$VIRT_PREFIX/lib/pkgconfig"
>        export PKG_CONFIG_LIBDIR="/usr/i686-w64-mingw32/sys-root/mingw/lib/pkgconfig:/usr/i686-w64-mingw32/sys-root/mingw/share/pkgconfig"
>      mingw32_autogen_args: --host=i686-w64-mingw32
> +    mingw32_meson_args: --cross-file="/usr/share/mingw/toolchain-mingw32.meson"
> +    mingw64_meson_args: --cross-file="/usr/share/mingw/toolchain-mingw64.meson"

Quoting the path seems unnecessary.

> +++ b/jenkins/jobs/meson.yaml
> @@ -0,0 +1,174 @@
> +---
> +- job-template:
> +    id: meson-build-job
> +    builders:
> +      - shell: |
> +          {global_env}
> +          {local_env}
> +          rm -rf build
> +          meson build --prefix=$VIRT_PREFIX {meson_args}
> +          ninja -C build
> +          ninja -C build install

I would keep this closer to the autotools version, which looks like

  rm -rf build
  mkdir build
  cd build
  ../autogen.sh --prefix=$VIRT_PREFIX {autogen_args}
  $MAKE
  $MAKE install

by doing

  rm -rf build
  mkdir build
  cd build
  meson .. . --prefix=$VIRT_PREFIX {meson_args}
  ninja
  ninja install

> +- job-template:
> +    id: meson-syntax-check-job
> +    builders:
> +      - shell: |
> +          {global_env}
> +          {local_env}
> +          ninja -C build syntax-check

Same here:

  cd build
  ninja syntax-check

> +- job-template:
> +    id: meson-test-job
> +    builders:
> +      - shell: |
> +          {global_env}
> +          {local_env}
> +          if ! ninja -C build test
> +          then
> +              cat build/meson-logs/testlog.txt || true
> +              exit 1
> +          fi

And here:

  cd build
  if ! ninja test
  then
      cat meson-logs/testlog.txt || true
      exit 1
  fi

> +- job-template:
> +    id: meson-rpm-job
> +    builders:
> +      - shell: |
> +          {global_env}
> +          {local_env}
> +          cd build
> +          {strip_buildrequires}
> +          rm -f meson-dist/*.tar.{archive_format}
> +          ninja dist
> +          rpmbuild --clean --define "_topdir `pwd`/rpmbuild" -ta meson-dist/*.tar.{archive_format}

This one already looks good :)


With the above changed,

  Reviewed-by: Andrea Bolognani <abologna at redhat.com>

-- 
Andrea Bolognani / Red Hat / Virtualization




More information about the libvir-list mailing list