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

2019-08-26 Thread Andrea Bolognani
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 

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

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

2019-08-20 Thread Fabiano FidĂȘncio
Add a template for projects using the Meson framework.

Signed-off-by: Fabiano FidĂȘncio 
---
 jenkins/jobs/defaults.yaml |   3 +
 jenkins/jobs/meson.yaml| 174 +
 2 files changed, 177 insertions(+)
 create mode 100644 jenkins/jobs/meson.yaml

diff --git a/jenkins/jobs/defaults.yaml b/jenkins/jobs/defaults.yaml
index 050c7b5..af78714 100644
--- a/jenkins/jobs/defaults.yaml
+++ b/jenkins/jobs/defaults.yaml
@@ -21,6 +21,7 @@
 global_env: ''
 local_env: ''
 autogen_args: ''
+meson_args: ''
 command: ''
 command_pre_build: ''
 strip_buildrequires: |
@@ -33,11 +34,13 @@
   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_local_env: |
   export VIRT_PREFIX="$VIRT_PREFIX/x86_64-w64-mingw32/sys-root/mingw"
   export PKG_CONFIG_PATH="$VIRT_PREFIX/lib/pkgconfig"
   export 
PKG_CONFIG_LIBDIR="/usr/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig:/usr/x86_64-w64-mingw32/sys-root/mingw/share/pkgconfig"
 mingw64_autogen_args: --host=x86_64-w64-mingw32
+mingw64_meson_args: --cross-file="/usr/share/mingw/toolchain-mingw64.meson"
 git_urls:
   libosinfo:
 default: https://gitlab.com/libosinfo/libosinfo.git
diff --git a/jenkins/jobs/meson.yaml b/jenkins/jobs/meson.yaml
new file mode 100644
index 000..5c0be01
--- /dev/null
+++ b/jenkins/jobs/meson.yaml
@@ -0,0 +1,174 @@
+---
+- job-template:
+id: meson-build-job
+name: '{name}-build'
+project-type: matrix
+description: '{title} Build'
+workspace: '{name}'
+child-workspace: '.'
+block-downstream: true
+block-upstream: true
+wrappers:
+  - timeout:
+  abort: true
+  type: absolute
+  timeout: 90
+  write-description: 'Aborted build after 90 minutes'
+properties:
+  - build-discarder:
+  days-to-keep: 30
+  num-to-keep: 1000
+scm:
+  - git:
+  url: '{git_url}'
+  branches:
+- origin/master
+  clean:
+after: true
+  skip-tag: true
+  wipe-workspace: false
+triggers:
+  - reverse:
+  jobs: '{obj:parent_jobs}'
+  - pollscm:
+  cron: "H/20 * * * *"
+axes:
+  - axis:
+  name: systems
+  type: slave
+  values: '{obj:machines}'
+builders:
+  - shell: |
+  {global_env}
+  {local_env}
+  rm -rf build
+  meson build --prefix=$VIRT_PREFIX {meson_args}
+  ninja -C build
+  ninja -C build install
+publishers:
+  - email:
+  recipients: '{obj:spam}'
+  notify-every-unstable-build: false
+  send-to-individuals: false
+
+- job-template:
+id: meson-syntax-check-job
+name: '{name}-syntax-check'
+project-type: matrix
+description: '{title} Syntax Check'
+workspace: '{name}'
+child-workspace: '.'
+block-downstream: true
+block-upstream: true
+wrappers:
+  - timeout:
+  abort: true
+  type: absolute
+  timeout: 90
+  write-description: 'Aborted build after 90 minutes'
+properties:
+  - build-discarder:
+  days-to-keep: 30
+  num-to-keep: 1000
+triggers:
+  - reverse:
+  jobs: '{obj:parent_jobs}'
+axes:
+  - axis:
+  name: systems
+  type: slave
+  values: '{obj:machines}'
+builders:
+  - shell: |
+  {global_env}
+  {local_env}
+  ninja -C build syntax-check
+publishers:
+  - email:
+  recipients: '{obj:spam}'
+  notify-every-unstable-build: false
+  send-to-individuals: false
+
+- job-template:
+id: meson-test-job
+name: '{name}-check'
+project-type: matrix
+description: '{title} Check'
+workspace: '{name}'
+child-workspace: '.'
+block-downstream: true
+block-upstream: true
+wrappers:
+  - timeout:
+  abort: true
+  type: absolute
+  timeout: 90
+  write-description: 'Aborted build after 90 minutes'
+properties:
+  - build-discarder:
+  days-to-keep: 30
+  num-to-keep: 1000
+triggers:
+  - reverse:
+  jobs: '{obj:parent_jobs}'
+axes:
+  - axis:
+  name: systems
+  type: slave
+  values: '{obj:machines}'
+builders:
+  - shell: |
+  {global_env}
+  {local_env}
+  if ! ninja -C build test
+  then
+  cat build/meson-logs/testlog.txt || true
+  exit 1
+  fi
+publishers:
+  - email:
+  recipients: '{obj:spam}'
+  notify-every-unstable-build: false
+