Re: [libvirt-sandbox PATCH] gitlab: introduce CI jobs testing git master & distro libvirt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 18, 2020 at 12:01:13PM +0200, Andrea Bolognani wrote:
> On Wed, 2020-06-17 at 19:06 +0100, Daniel P. Berrangé wrote:
> [...]
> > +.script_variables: &script_variables |
> > +  export MAKEFLAGS="-j$(getconf _NPROCESSORS_ONLN)"
> > +  export SCRATCH_DIR="/tmp/scratch"
> > +  export VROOT="$SCRATCH_DIR/vroot"
> > +  export CCACHE_DIR="$PWD/ccache"
> > +  export CCACHE_MAXSIZE="500M"
> > +  export PATH="$CCACHE_WRAPPERSDIR:$VROOT/bin:$PATH"
> > +  export PKG_CONFIG_PATH="$VROOT/lib/pkgconfig"
> > +  export XDG_DATA_DIRS="$VROOT/share:/usr/share"
> > +  export GI_TYPELIB_PATH="$VROOT/lib/girepository-1.0"
> > +
> > +.git_native_build_job_template: &git_native_build_job_definition
> > +  image: $CI_REGISTRY_IMAGE/ci-$NAME:latest
> > +  stage: builds
> > +  cache:
> > +    paths:
> > +      - ccache/
> > +    key: "$CI_JOB_NAME"
> > +  before_script:
> > +    - *script_variables
> > +    - export LD_LIBRARY_PATH="$VROOT/lib"
> 
> Same as libvirt-glib, LD_LIBRARY_PATH can be part of
> script_variables without affecting the other build jobs.

Yep.

> > +  script:
> > +    - pushd "$PWD"
> > +    - mkdir -p "$SCRATCH_DIR"
> > +    - cd "$SCRATCH_DIR"
> > +    - git clone --depth 1 https://gitlab.com/libvirt/libvirt.git
> > +    - git clone --depth 1 https://gitlab.com/libvirt/libvirt-glib.git
> > +    - mkdir libvirt/build
> > +    - cd libvirt/build
> > +    - ../autogen.sh --prefix="$VROOT" --without-libvirtd
> > +    - $MAKE install
> > +    - cd ../..
> > +    - mkdir libvirt-glib/build
> > +    - cd libvirt-glib/build
> > +    - ../autogen.sh --prefix="$VROOT" --without-libvirtd
> 
> You don't need --without-libvirtd for this one ;)

Opps

> > +    - $MAKE install
> > +    - popd
> > +    - mkdir build
> > +    - cd build
> > +    - ../autogen.sh --prefix="$VROOT" --enable-gtk-doc
> > +    - $MAKE install
> > +    - $MAKE dist
> > +    - if test -x /usr/bin/rpmbuild && test "$RPM" != "skip" ; then rpmbuild --nodeps -ta libvirt-sandbox*.tar.gz ; fi
> 
> We need to run '$MAKE check' as well.

Yep will add.

> Speaking of which, I suggest that we start organizing the script for
> git builds a bit differently:
> 
>   script:
>     - mkdir -p "$SCRATCH_DIR"
>     - pushd "$SCRATCH_DIR"
>     - git clone --depth 1 https://gitlab.com/libvirt/libvirt.git
>     - mkdir libvirt/build
>     - pushd libvirt/build
>     - # ...
>     - popd
>     - git clone --depth 1 https://gitlab.com/libvirt/libvirt-glib.git
>     - mkdir libvirt-glib/build
>     - pushd libvirt-glib/build
>     - # ...
>     - popd
>     - popd
>     - mkdir build
>     - cd build
>     - # ...
> 
> This avoids the unnecessary initial pushd/cd combination, keeps
> builds for each project neatly separated, and avoids using relative
> paths for most things. What do you think?

For now I'd rather keep the consistent approach we've already used
for other repos. I think there might be better ways to deal with
the builds later, perhaps using cross-repo include files for the
deps.

> > +if ! test -x "$LCITOOL"
> > +then
> > +    echo "$LCITOOL is not executable"
> > +    exit 1
> > +fi
> > +
> > +HOSTS=$($LCITOOL hosts | grep -v -E '(freebsd|centos|opensuse)')
> 
> According to
> 
>   host_vars/libvirt-opensuse-151/main.yml
>   playbooks/build/projects/libvirt-sandbox.yml
> 
> in libvirt-ci, libvirt-sandbox can be built on openSUSE just fine;
> I just tried it locally to double-check and had no problems with it
> either. So, please don't exclude openSUSE here.

That was doing a from git build, where as this is doing a from dist
build, but I've found the missing packages for this now.

> > +for host in $HOSTS
> > +do
> > +    if test "$host" = "libvirt-ubuntu-2004"
> > +    then
> > +        $LCITOOL dockerfile $host libvirt+minimal,libvirt-glib,libvirt-sandbox > $host.Dockerfile
> > +    else
> > +        $LCITOOL dockerfile $host libvirt+dist,libvirt-glib+dist,libvirt-sandbox > $host.Dockerfile
> 
> This fails for me because libvirt-glib+dist is not know to lcitool.
> I assume you have local patches that add the project - can you please
> open a MR against libvirt-ci and mention it in the commit message, so
> that I can check everything locally during review?

Yes I have libvirt-ci changes  to submit after this is finalized.

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 :|




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux