[libvirt] [jenkins-ci PATCH 0/3] Introduce variants and use them for MinGW

Andrea Bolognani (3): jobs: Introduce variants jobs: Tweak autotools-mingw-job template jobs: Drop autotools-mingw-job jobs/autotools.yaml | 94 ++++------------------------------------------ jobs/defaults.yaml | 17 +++++++++ jobs/generic.yaml | 16 ++++---- jobs/go.yaml | 8 ++-- jobs/perl-makemaker.yaml | 12 +++--- jobs/perl-modulebuild.yaml | 12 +++--- jobs/python-distutils.yaml | 12 +++--- projects/libvirt-glib.yaml | 12 +++++- projects/libvirt.yaml | 12 +++++- projects/virt-viewer.yaml | 12 +++++- 10 files changed, 88 insertions(+), 119 deletions(-) -- 2.14.3

This optional feature will allow us to reuse existing job templates for things like MinGW or website builds. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- jobs/autotools.yaml | 20 ++++++++++---------- jobs/defaults.yaml | 1 + jobs/generic.yaml | 16 ++++++++-------- jobs/go.yaml | 8 ++++---- jobs/perl-makemaker.yaml | 12 ++++++------ jobs/perl-modulebuild.yaml | 12 ++++++------ jobs/python-distutils.yaml | 12 ++++++------ 7 files changed, 41 insertions(+), 40 deletions(-) diff --git a/jobs/autotools.yaml b/jobs/autotools.yaml index 0c164d3..5c78e6a 100644 --- a/jobs/autotools.yaml +++ b/jobs/autotools.yaml @@ -1,11 +1,11 @@ - job-template: id: autotools-build-job - name: '{name}-{branch}-build' + name: '{name}-{branch}-build{variant}' project-type: matrix description: '{title} Build' autogen_args: '' - workspace: '{name}-{branch}' + workspace: '{name}-{branch}{variant}' child-workspace: '.' block-downstream: true block-upstream: true @@ -55,10 +55,10 @@ - job-template: id: autotools-syntax-check-job - name: '{name}-{branch}-syntax-check' + name: '{name}-{branch}-syntax-check{variant}' project-type: matrix description: '{title} Syntax Check' - workspace: '{name}-{branch}' + workspace: '{name}-{branch}{variant}' child-workspace: '.' block-downstream: true block-upstream: true @@ -94,10 +94,10 @@ - job-template: id: autotools-check-job - name: '{name}-{branch}-check' + name: '{name}-{branch}-check{variant}' project-type: matrix description: '{title} Check' - workspace: '{name}-{branch}' + workspace: '{name}-{branch}{variant}' child-workspace: '.' block-downstream: true block-upstream: true @@ -137,11 +137,11 @@ - job-template: id: autotools-rpm-job - name: '{name}-{branch}-rpm' + name: '{name}-{branch}-rpm{variant}' project-type: matrix description: '{title} RPM' archive_format: gz - workspace: '{name}-{branch}' + workspace: '{name}-{branch}{variant}' child-workspace: '.' block-downstream: true block-upstream: true @@ -182,11 +182,11 @@ - job-template: id: autotools-mingw-job - name: '{name}-{branch}-mingw' + name: '{name}-{branch}-mingw{variant}' project-type: matrix description: '{title} MinGW' autogen_args: '' - workspace: '{name}-{branch}-mingw' + workspace: '{name}-{branch}-mingw{variant}' child-workspace: '.' block-downstream: true block-upstream: true diff --git a/jobs/defaults.yaml b/jobs/defaults.yaml index 23f8555..eef92e8 100644 --- a/jobs/defaults.yaml +++ b/jobs/defaults.yaml @@ -2,6 +2,7 @@ - defaults: name: global branch: master + variant: '' node: libvirt global_env: | local_env: | diff --git a/jobs/generic.yaml b/jobs/generic.yaml index 08ab104..f64dde0 100644 --- a/jobs/generic.yaml +++ b/jobs/generic.yaml @@ -1,11 +1,11 @@ - job-template: id: generic-build-job - name: '{name}-{branch}-build' + name: '{name}-{branch}-build{variant}' project-type: matrix description: '{title} Build' autogen_args: '' - workspace: '{name}-{branch}' + workspace: '{name}-{branch}{variant}' child-workspace: '.' block-downstream: true block-upstream: true @@ -51,10 +51,10 @@ - job-template: id: generic-syntax-check-job - name: '{name}-{branch}-syntax-check' + name: '{name}-{branch}-syntax-check{variant}' project-type: matrix description: '{title} Syntax Check' - workspace: '{name}-{branch}' + workspace: '{name}-{branch}{variant}' child-workspace: '.' block-downstream: true block-upstream: true @@ -89,10 +89,10 @@ - job-template: id: generic-check-job - name: '{name}-{branch}-check' + name: '{name}-{branch}-check{variant}' project-type: matrix description: '{title} Check' - workspace: '{name}-{branch}' + workspace: '{name}-{branch}{variant}' child-workspace: '.' block-downstream: true block-upstream: true @@ -127,11 +127,11 @@ - job-template: id: generic-rpm-job - name: '{name}-{branch}-rpm' + name: '{name}-{branch}-rpm{variant}' project-type: matrix description: '{title} RPM' archive_format: gz - workspace: '{name}-{branch}' + workspace: '{name}-{branch}{variant}' child-workspace: '.' block-downstream: true block-upstream: true diff --git a/jobs/go.yaml b/jobs/go.yaml index 2634cb2..9a349ca 100644 --- a/jobs/go.yaml +++ b/jobs/go.yaml @@ -1,11 +1,11 @@ - job-template: id: go-build-job - name: '{name}-{branch}-build' + name: '{name}-{branch}-build{variant}' project-type: matrix description: '{title} Build' autogen_args: '' - workspace: '{name}-{branch}' + workspace: '{name}-{branch}{variant}' child-workspace: '.' block-downstream: true block-upstream: true @@ -56,10 +56,10 @@ - job-template: id: go-check-job - name: '{name}-{branch}-check' + name: '{name}-{branch}-check{variant}' project-type: matrix description: '{title} Check' - workspace: '{name}-{branch}' + workspace: '{name}-{branch}{variant}' child-workspace: '.' block-downstream: true block-upstream: true diff --git a/jobs/perl-makemaker.yaml b/jobs/perl-makemaker.yaml index 873ce04..84b368e 100644 --- a/jobs/perl-makemaker.yaml +++ b/jobs/perl-makemaker.yaml @@ -1,11 +1,11 @@ - job-template: id: perl-makemaker-build-job - name: '{name}-{branch}-build' + name: '{name}-{branch}-build{variant}' project-type: matrix description: '{title} Build' autogen_args: '' - workspace: '{name}-{branch}' + workspace: '{name}-{branch}{variant}' child-workspace: '.' block-downstream: true block-upstream: true @@ -55,11 +55,11 @@ - job-template: id: perl-makemaker-test-job - name: '{name}-{branch}-test' + name: '{name}-{branch}-test{variant}' project-type: matrix description: '{title} Test' test_args: '' - workspace: '{name}-{branch}' + workspace: '{name}-{branch}{variant}' child-workspace: '.' block-downstream: true block-upstream: true @@ -94,11 +94,11 @@ - job-template: id: perl-makemaker-rpm-job - name: '{name}-{branch}-rpm' + name: '{name}-{branch}-rpm{variant}' project-type: matrix description: '{title} RPM' archive_format: gz - workspace: '{name}-{branch}' + workspace: '{name}-{branch}{variant}' child-workspace: '.' block-downstream: true block-upstream: true diff --git a/jobs/perl-modulebuild.yaml b/jobs/perl-modulebuild.yaml index d256599..b159ab3 100644 --- a/jobs/perl-modulebuild.yaml +++ b/jobs/perl-modulebuild.yaml @@ -1,11 +1,11 @@ - job-template: id: perl-modulebuild-build-job - name: '{name}-{branch}-build' + name: '{name}-{branch}-build{variant}' project-type: matrix description: '{title} Build' autogen_args: '' - workspace: '{name}-{branch}' + workspace: '{name}-{branch}{variant}' child-workspace: '.' block-downstream: true block-upstream: true @@ -55,10 +55,10 @@ - job-template: id: perl-modulebuild-test-job - name: '{name}-{branch}-test' + name: '{name}-{branch}-test{variant}' project-type: matrix description: '{title} Test' - workspace: '{name}-{branch}' + workspace: '{name}-{branch}{variant}' child-workspace: '.' block-downstream: true block-upstream: true @@ -93,11 +93,11 @@ - job-template: id: perl-modulebuild-rpm-job - name: '{name}-{branch}-rpm' + name: '{name}-{branch}-rpm{variant}' project-type: matrix description: '{title} RPM' archive_format: gz - workspace: '{name}-{branch}' + workspace: '{name}-{branch}{variant}' child-workspace: '.' block-downstream: true block-upstream: true diff --git a/jobs/python-distutils.yaml b/jobs/python-distutils.yaml index bfa0715..c075245 100644 --- a/jobs/python-distutils.yaml +++ b/jobs/python-distutils.yaml @@ -1,11 +1,11 @@ - job-template: id: python-distutils-build-job - name: '{name}-{branch}-build' + name: '{name}-{branch}-build{variant}' project-type: matrix description: '{title} Build' command_pre_build: '' - workspace: '{name}-{branch}' + workspace: '{name}-{branch}{variant}' child-workspace: '.' block-downstream: true block-upstream: true @@ -54,10 +54,10 @@ - job-template: id: python-distutils-check-job - name: '{name}-{branch}-check' + name: '{name}-{branch}-check{variant}' project-type: matrix description: '{title} Check' - workspace: '{name}-{branch}' + workspace: '{name}-{branch}{variant}' child-workspace: '.' block-downstream: true block-upstream: true @@ -92,10 +92,10 @@ - job-template: id: python-distutils-rpm-job - name: '{name}-{branch}-rpm' + name: '{name}-{branch}-rpm{variant}' project-type: matrix description: '{title} RPM' - workspace: '{name}-{branch}' + workspace: '{name}-{branch}{variant}' child-workspace: '.' block-downstream: true block-upstream: true -- 2.14.3

On Tue, Apr 17, 2018 at 05:43:10PM +0200, Andrea Bolognani wrote:
This optional feature will allow us to reuse existing job templates for things like MinGW or website builds.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- jobs/autotools.yaml | 20 ++++++++++---------- jobs/defaults.yaml | 1 + jobs/generic.yaml | 16 ++++++++-------- jobs/go.yaml | 8 ++++---- jobs/perl-makemaker.yaml | 12 ++++++------ jobs/perl-modulebuild.yaml | 12 ++++++------ jobs/python-distutils.yaml | 12 ++++++------ 7 files changed, 41 insertions(+), 40 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

Make it more similar to the autotools-build-job by dropping the custom $PREFIX variable and redefining the standard $VIRT_PREFIX instead, which also makes $PKG_CONFIG_PATH shorter, and moving all environment variables together. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- jobs/autotools.yaml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/jobs/autotools.yaml b/jobs/autotools.yaml index 5c78e6a..ac7099f 100644 --- a/jobs/autotools.yaml +++ b/jobs/autotools.yaml @@ -228,13 +228,14 @@ # to unset it here. export CC= + export VIRT_PREFIX="$VIRT_PREFIX/i686-w64-mingw32/sys-root/mingw" + 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" + mkdir -p build32 cd build32 - export PKG_CONFIG_LIBDIR="/usr/i686-w64-mingw32/sys-root/mingw/lib/pkgconfig:/usr/i686-w64-mingw32/sys-root/mingw/share/pkgconfig" - export PKG_CONFIG_PATH="$VIRT_PREFIX/i686-w64-mingw32/sys-root/mingw/lib/pkgconfig" \ - export PREFIX=$VIRT_PREFIX/i686-w64-mingw32/sys-root/mingw - ../autogen.sh --host=i686-w64-mingw32 --prefix=$PREFIX + ../autogen.sh --prefix=$VIRT_PREFIX --host=i686-w64-mingw32 $MAKE -j{smp} $MAKE -j{smp} install - shell: | @@ -243,13 +244,14 @@ # See above export CC= + 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" + mkdir -p build64 cd build64 - export PKG_CONFIG_LIBDIR="/usr/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig:/usr/x86_64-w64-mingw32/sys-root/mingw/share/pkgconfig" - export PKG_CONFIG_PATH="$VIRT_PREFIX/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig" \ - export PREFIX=$VIRT_PREFIX/x86_64-w64-mingw32/sys-root/mingw - ../autogen.sh --host=x86_64-w64-mingw32 --prefix=$PREFIX + ../autogen.sh --prefix=$VIRT_PREFIX --host=x86_64-w64-mingw32 $MAKE -j{smp} $MAKE -j{smp} install publishers: -- 2.14.3

On Tue, Apr 17, 2018 at 05:43:11PM +0200, Andrea Bolognani wrote:
Make it more similar to the autotools-build-job by dropping the custom $PREFIX variable and redefining the standard $VIRT_PREFIX instead, which also makes $PKG_CONFIG_PATH shorter, and moving all environment variables together.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- jobs/autotools.yaml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

Now that we have variants and we've removed all uses of custom environment variables, we can convert all jobs that use the autotools-mingw-job template to the autotools-build-job plus a few overrides. As a consequence of this, mingw32 and mingw64 builds will be split into separate jobs. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- jobs/autotools.yaml | 80 ---------------------------------------------- jobs/defaults.yaml | 16 ++++++++++ projects/libvirt-glib.yaml | 12 ++++++- projects/libvirt.yaml | 12 ++++++- projects/virt-viewer.yaml | 12 ++++++- 5 files changed, 49 insertions(+), 83 deletions(-) diff --git a/jobs/autotools.yaml b/jobs/autotools.yaml index ac7099f..9868573 100644 --- a/jobs/autotools.yaml +++ b/jobs/autotools.yaml @@ -179,83 +179,3 @@ recipients: '{obj:spam}' notify-every-unstable-build: true send-to-individuals: false - -- job-template: - id: autotools-mingw-job - name: '{name}-{branch}-mingw{variant}' - project-type: matrix - description: '{title} MinGW' - autogen_args: '' - workspace: '{name}-{branch}-mingw{variant}' - 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://n64.pufty.ci.centos.org/{name}.git - branches: - - origin/{branch} - 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} - # The MinGW build needs to use the MinGW compiler toolchain, - # while $CC is pointing to the native toolchain, so we have - # to unset it here. - export CC= - - export VIRT_PREFIX="$VIRT_PREFIX/i686-w64-mingw32/sys-root/mingw" - 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" - - mkdir -p build32 - cd build32 - - ../autogen.sh --prefix=$VIRT_PREFIX --host=i686-w64-mingw32 - $MAKE -j{smp} - $MAKE -j{smp} install - - shell: | - {global_env} - {local_env} - # See above - export CC= - - 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" - - mkdir -p build64 - cd build64 - - ../autogen.sh --prefix=$VIRT_PREFIX --host=x86_64-w64-mingw32 - $MAKE -j{smp} - $MAKE -j{smp} install - publishers: - - email: - recipients: '{obj:spam}' - notify-every-unstable-build: true - send-to-individuals: false diff --git a/jobs/defaults.yaml b/jobs/defaults.yaml index eef92e8..5527546 100644 --- a/jobs/defaults.yaml +++ b/jobs/defaults.yaml @@ -6,5 +6,21 @@ node: libvirt global_env: | local_env: | + mingw32_local_env: | + # The MinGW build needs to use the MinGW compiler toolchain, + # while $CC is pointing to the native toolchain, so we have + # to unset it here. + export CC= + export VIRT_PREFIX="$VIRT_PREFIX/i686-w64-mingw32/sys-root/mingw" + 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 + mingw64_local_env: | + # See above + export CC= + 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 smp: 3 spam: ymankad@redhat.com libvirt-ci@redhat.com diff --git a/projects/libvirt-glib.yaml b/projects/libvirt-glib.yaml index 3873c40..c56e5d3 100644 --- a/projects/libvirt-glib.yaml +++ b/projects/libvirt-glib.yaml @@ -26,7 +26,17 @@ - libvirt-fedora-26 - libvirt-fedora-27 - libvirt-fedora-rawhide - - autotools-mingw-job: + - autotools-build-job: + parent_jobs: + variant: -mingw32 + local_env: '{mingw32_local_env}' + autogen_args: '{mingw32_autogen_args}' + machines: + - libvirt-fedora-rawhide + - autotools-build-job: parent_jobs: + variant: -mingw64 + local_env: '{mingw64_local_env}' + autogen_args: '{mingw64_autogen_args}' machines: - libvirt-fedora-rawhide diff --git a/projects/libvirt.yaml b/projects/libvirt.yaml index 13f39f9..bff9ad9 100644 --- a/projects/libvirt.yaml +++ b/projects/libvirt.yaml @@ -39,7 +39,17 @@ - libvirt-fedora-26 - libvirt-fedora-27 - libvirt-fedora-rawhide - - autotools-mingw-job: + - autotools-build-job: + parent_jobs: + variant: -mingw32 + local_env: '{mingw32_local_env}' + autogen_args: '{mingw32_autogen_args}' + machines: + - libvirt-fedora-rawhide + - autotools-build-job: parent_jobs: + variant: -mingw64 + local_env: '{mingw64_local_env}' + autogen_args: '{mingw64_autogen_args}' machines: - libvirt-fedora-rawhide diff --git a/projects/virt-viewer.yaml b/projects/virt-viewer.yaml index 2d8a6f9..5a882bc 100644 --- a/projects/virt-viewer.yaml +++ b/projects/virt-viewer.yaml @@ -25,7 +25,17 @@ - libvirt-fedora-26 - libvirt-fedora-27 - libvirt-fedora-rawhide - - autotools-mingw-job: + - autotools-build-job: + parent_jobs: + variant: -mingw32 + local_env: '{mingw32_local_env}' + autogen_args: '{mingw32_autogen_args}' + machines: + - libvirt-fedora-rawhide + - autotools-build-job: parent_jobs: + variant: -mingw64 + local_env: '{mingw64_local_env}' + autogen_args: '{mingw64_autogen_args}' machines: - libvirt-fedora-rawhide -- 2.14.3

On Tue, Apr 17, 2018 at 05:43:12PM +0200, Andrea Bolognani wrote:
Now that we have variants and we've removed all uses of custom environment variables, we can convert all jobs that use the autotools-mingw-job template to the autotools-build-job plus a few overrides.
As a consequence of this, mingw32 and mingw64 builds will be split into separate jobs.
Must remember to purge the old jobs from jenkins manually and delete the workspace...
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- jobs/autotools.yaml | 80 ---------------------------------------------- jobs/defaults.yaml | 16 ++++++++++ projects/libvirt-glib.yaml | 12 ++++++- projects/libvirt.yaml | 12 ++++++- projects/virt-viewer.yaml | 12 ++++++- 5 files changed, 49 insertions(+), 83 deletions(-)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
participants (2)
-
Andrea Bolognani
-
Daniel P. Berrangé