summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2022-02-25 14:56:51 +0000
committerSimon McVittie <smcv@collabora.com>2022-02-25 14:56:51 +0000
commite5922ee2714bf058ca58c4a3850023562353f869 (patch)
tree938af096827f7008596f35f6939e202a22d08561
parent9c1c57304147ee34ce33e0db2a80e2e25fd18173 (diff)
parent5c46e9706873caf51f09972e7910e35091bd007f (diff)
downloaddbus-e5922ee2714bf058ca58c4a3850023562353f869.tar.gz
Merge branch '1.12-ci' into 'dbus-1.12'
[1.12.x] CI: Partially catch up with 1.13.x See merge request dbus/dbus!259
-rw-r--r--.gitlab-ci.yml72
-rw-r--r--.travis.yml3
-rwxr-xr-xtools/ci-build.sh102
-rwxr-xr-xtools/ci-install.sh185
4 files changed, 195 insertions, 167 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 5c88527a..dd7c4c6b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -20,7 +20,7 @@
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
-image: debian:stretch-slim
+image: debian:buster-slim
stages:
- build
@@ -41,107 +41,83 @@ cache:
variables:
ci_in_docker: "yes"
+ ci_local_packages: "yes"
ci_parallel: "2"
ci_sudo: "yes"
ci_distro: "debian"
- ci_suite: "stretch"
+ ci_suite: "buster"
-build:production:
+production:
stage: build
- image: "debian:stretch-slim"
+ image: "debian:buster-slim"
variables:
ci_variant: "production"
script: &script
- chown -R user .
- runuser -u user ./tools/ci-build.sh
-build:debug:
+debug:
stage: build
- image: "debian:stretch-slim"
+ image: "debian:buster-slim"
variables:
ci_variant: "debug"
script: *script
-build:reduced:
+reduced:
stage: build
when: manual
- image: "debian:stretch-slim"
+ image: "debian:buster-slim"
variables:
ci_variant: "reduced"
script: *script
-build:legacy:
+legacy:
stage: build
when: manual
- image: "debian:stretch-slim"
+ image: "debian:buster-slim"
variables:
ci_variant: "legacy"
script: *script
-build:cmake:
+cmake:
stage: build
- image: "debian:stretch-slim"
+ image: "debian:buster-slim"
variables:
- ci_buildsys: "cmake"
+ ci_buildsys: "cmake-dist"
script: *script
-build:i686-w64-mingw32-debug:
+i686-w64-mingw32-debug:
stage: build
- image: "debian:stretch-slim"
+ image: "debian:buster-slim"
variables:
ci_host: "i686-w64-mingw32"
ci_variant: "debug"
script: *script
-build:i686-w64-mingw32-cmake:
+i686-w64-mingw32-cmake:
stage: build
when: manual
- image: "debian:stretch-slim"
+ image: "debian:buster-slim"
variables:
ci_buildsys: "cmake"
ci_host: "i686-w64-mingw32"
script: *script
-build:x86_64-w64-mingw32:
+x86_64-w64-mingw32:
stage: build
- image: "debian:stretch-slim"
+ image: "debian:buster-slim"
variables:
- ci_host: "i686-w64-mingw32"
+ ci_host: "x86_64-w64-mingw32"
script: *script
-build:x86_64-w64-mingw32-cmake-debug:
+x86_64-w64-mingw32-cmake-debug:
stage: build
when: manual
- image: "debian:stretch-slim"
+ image: "debian:buster-slim"
variables:
ci_buildsys: "cmake"
- ci_host: "i686-w64-mingw32"
+ ci_host: "x86_64-w64-mingw32"
ci_variant: "debug"
script: *script
-build:jessie:
- when: manual
- stage: build
- image: "debian:jessie-slim"
- variables:
- ci_suite: "jessie"
- script: *script
-
-build:buster:
- when: manual
- stage: build
- image: "debian:buster-slim"
- variables:
- ci_suite: "buster"
- script: *script
-
-build:xenial:
- when: manual
- stage: build
- image: "ubuntu:xenial"
- variables:
- ci_distro: "ubuntu"
- ci_suite: "xenial"
- script: *script
-
# vim:set sw=2 sts=2 et:
diff --git a/.travis.yml b/.travis.yml
index 9e68d013..05aed5de 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -34,12 +34,11 @@ env:
- ci_variant=debug
- ci_variant=reduced
- ci_variant=legacy
- - ci_buildsys=cmake
+ - ci_buildsys=cmake-dist
- ci_host=i686-w64-mingw32
- ci_host=i686-w64-mingw32 ci_buildsys=cmake ci_variant=debug
- ci_host=x86_64-w64-mingw32 ci_variant=debug
- ci_host=x86_64-w64-mingw32 ci_buildsys=cmake
- - ci_docker=debian:jessie-slim ci_distro=debian ci_suite=jessie
- ci_docker=debian:stretch-slim ci_distro=debian ci_suite=stretch
- ci_docker=debian:buster-slim ci_distro=debian ci_suite=buster
diff --git a/tools/ci-build.sh b/tools/ci-build.sh
index cb19f4a7..0ca33d96 100755
--- a/tools/ci-build.sh
+++ b/tools/ci-build.sh
@@ -49,6 +49,11 @@ NULL=
# See ci-install.sh
: "${ci_host:=native}"
+# ci_local_packages:
+# prefer local packages instead of distribution
+# See ci-install.sh
+: "${ci_local_packages:=yes}"
+
# ci_parallel:
# A number of parallel jobs, passed to make -j
: "${ci_parallel:=1}"
@@ -98,41 +103,58 @@ maybe_fail_tests () {
NOCONFIGURE=1 ./autogen.sh
-srcdir="$(pwd)"
-mkdir ci-build-${ci_variant}-${ci_host}
-cd ci-build-${ci_variant}-${ci_host}
-
-make="make -j${ci_parallel} V=1 VERBOSE=1"
+case "$ci_buildsys" in
+ (cmake-dist)
+ # clean up directories from possible previous builds
+ rm -rf ci-build-dist
+ # Do an Autotools `make dist`, then build *that* with CMake,
+ # to assert that our official release tarballs will be enough
+ # to build with CMake.
+ mkdir -p ci-build-dist
+ ( cd ci-build-dist; ../configure PYTHON=python3 )
+ make -C ci-build-dist dist
+ tar -zxvf ci-build-dist/dbus-1.*.tar.gz
+ cd dbus-1.*/
+ ;;
+esac
+#
+# cross compile setup
+#
case "$ci_host" in
(*-w64-mingw32)
- mirror=http://repo.msys2.org/mingw/${ci_host%%-*}
- if [ "${ci_host%%-*}" = i686 ]; then
- mingw="$(pwd)/mingw32"
+ if [ "$ci_local_packages" = yes ]; then
+ dep_prefix=$(pwd)/${ci_host}-prefix
else
- mingw="$(pwd)/mingw64"
+ # assume the compiler was configured with a sysroot (e.g. openSUSE)
+ sysroot=$("${ci_host}-gcc" --print-sysroot)
+ # check if the prefix is a subdir of sysroot (e.g. openSUSE)
+ if [ -d "${sysroot}/${ci_host}" ]; then
+ dep_prefix="${sysroot}/${ci_host}"
+ else
+ # fallback: assume the dependency libraries were built with --prefix=/${ci_host}
+ dep_prefix="/${ci_host}"
+ export PKG_CONFIG_SYSROOT_DIR="${sysroot}"
+ fi
fi
- install -d "${mingw}"
- export PKG_CONFIG_LIBDIR="${mingw}/lib/pkgconfig"
+
+ export PKG_CONFIG_LIBDIR="${dep_prefix}/lib/pkgconfig"
export PKG_CONFIG_PATH=
- export PKG_CONFIG="pkg-config --define-variable=prefix=${mingw}"
+ export PKG_CONFIG="pkg-config --define-variable=prefix=${dep_prefix}"
unset CC
unset CXX
- for pkg in \
- expat-2.1.0-6 \
- gcc-libs-5.2.0-4 \
- gettext-0.19.6-1 \
- glib2-2.46.1-1 \
- libffi-3.2.1-3 \
- zlib-1.2.8-9 \
- ; do
- wget ${mirror}/mingw-w64-${ci_host%%-*}-${pkg}-any.pkg.tar.xz
- tar -xvf mingw-w64-${ci_host%%-*}-${pkg}-any.pkg.tar.xz
- done
export TMPDIR=/tmp
;;
esac
+srcdir="$(pwd)"
+# clean up directories from possible previous builds
+rm -rf ci-build-${ci_variant}-${ci_host}
+mkdir -p ci-build-${ci_variant}-${ci_host}
+cd ci-build-${ci_variant}-${ci_host}
+
+make="make -j${ci_parallel} V=1 VERBOSE=1"
+
case "$ci_buildsys" in
(autotools)
case "$ci_variant" in
@@ -234,6 +256,7 @@ case "$ci_buildsys" in
--enable-installed-tests \
--enable-maintainer-mode \
--enable-modular-tests \
+ PYTHON=python3 \
"$@"
${make}
@@ -244,18 +267,9 @@ case "$ci_buildsys" in
${make} install DESTDIR=$(pwd)/DESTDIR
( cd DESTDIR && find . -ls )
- case "$ci_suite" in
- (jessie|xenial|stretch)
- # these are too old for maintainer-upload-docs
- ;;
-
- (*)
- # assume Ubuntu 18.04 'bionic', Debian 10 'buster' or newer
- ${make} -C doc dbus-docs.tar.xz
- tar -C $(pwd)/DESTDIR -xf doc/dbus-docs.tar.xz
- ( cd DESTDIR/dbus-docs && find . -ls )
- ;;
- esac
+ ${make} -C doc dbus-docs.tar.gz
+ tar -C $(pwd)/DESTDIR -xf doc/dbus-docs.tar.gz
+ ( cd DESTDIR/dbus-docs && find . -ls )
if [ "$ci_sudo" = yes ] && [ "$ci_test" = yes ]; then
sudo ${make} install
@@ -281,18 +295,20 @@ case "$ci_buildsys" in
fi
;;
- (cmake)
+ (cmake|cmake-dist)
case "$ci_host" in
(*-w64-mingw32)
set _ "$@"
set "$@" -D CMAKE_TOOLCHAIN_FILE="${srcdir}/cmake/${ci_host}.cmake"
- set "$@" -D CMAKE_PREFIX_PATH="${mingw}"
- set "$@" -D CMAKE_INCLUDE_PATH="${mingw}/include"
- set "$@" -D CMAKE_LIBRARY_PATH="${mingw}/lib"
- set "$@" -D EXPAT_LIBRARY="${mingw}/lib/libexpat.dll.a"
- set "$@" -D GLIB2_LIBRARIES="${mingw}/lib/libglib-2.0.dll.a"
- set "$@" -D GOBJECT_LIBRARIES="${mingw}/lib/libgobject-2.0.dll.a"
- set "$@" -D GIO_LIBRARIES="${mingw}/lib/libgio-2.0.dll.a"
+ set "$@" -D CMAKE_PREFIX_PATH="${dep_prefix}"
+ if [ "$ci_local_packages" = yes ]; then
+ set "$@" -D CMAKE_INCLUDE_PATH="${dep_prefix}/include"
+ set "$@" -D CMAKE_LIBRARY_PATH="${dep_prefix}/lib"
+ set "$@" -D EXPAT_LIBRARY="${dep_prefix}/lib/libexpat.dll.a"
+ set "$@" -D GLIB2_LIBRARIES="${dep_prefix}/lib/libglib-2.0.dll.a"
+ set "$@" -D GOBJECT_LIBRARIES="${dep_prefix}/lib/libgobject-2.0.dll.a"
+ set "$@" -D GIO_LIBRARIES="${dep_prefix}/lib/libgio-2.0.dll.a"
+ fi
shift
# don't run tests yet, Wine needs Xvfb and more
# msys2 libraries
diff --git a/tools/ci-install.sh b/tools/ci-install.sh
index 1c2e3b64..21548cf5 100755
--- a/tools/ci-install.sh
+++ b/tools/ci-install.sh
@@ -48,11 +48,19 @@ NULL=
# (ci_docker is empty in this case).
: "${ci_in_docker:=no}"
+# ci_local_packages:
+# prefer local packages instead of distribution
+: "${ci_local_packages:=yes}"
+
# ci_suite:
# OS suite (release, branch) in which we are testing.
-# Typical values for ci_distro=debian: sid, jessie
+# Typical values for ci_distro=debian: sid, bullseye
# Typical values for ci_distro=fedora might be 25, rawhide
-: "${ci_suite:=xenial}"
+: "${ci_suite:=bullseye}"
+
+# ci_variant:
+# One of debug, reduced, legacy, production
+: "${ci_variant:=production}"
if [ $(id -u) = 0 ]; then
sudo=
@@ -79,18 +87,6 @@ case "$ci_distro" in
$sudo sed -i -e 's/httpredir\.debian\.org/deb.debian.org/g' \
/etc/apt/sources.list
- case "$ci_suite" in
- (xenial)
- # Ubuntu 16.04 didn't have the wine32, wine64 packages
- wine32=wine:i386
- wine64=wine:amd64
- ;;
- (*)
- wine32=wine32
- wine64=wine64
- ;;
- esac
-
case "$ci_host" in
(i686-w64-mingw32)
$sudo dpkg --add-architecture i386
@@ -101,82 +97,91 @@ case "$ci_distro" in
esac
$sudo apt-get -qq -y update
+ packages=()
case "$ci_host" in
(i686-w64-mingw32)
- $sudo apt-get -qq -y install \
- binutils-mingw-w64-i686 \
- g++-mingw-w64-i686 \
- $wine32 \
- ${NULL}
+ packages=(
+ "${packages[@]}"
+ binutils-mingw-w64-i686
+ g++-mingw-w64-i686
+ wine32 wine
+ )
;;
(x86_64-w64-mingw32)
- $sudo apt-get -qq -y install \
- binutils-mingw-w64-x86-64\
- g++-mingw-w64-x86-64 \
- $wine64 \
- ${NULL}
+ packages=(
+ "${packages[@]}"
+ binutils-mingw-w64-x86-64
+ g++-mingw-w64-x86-64
+ wine64 wine
+ )
;;
esac
- $sudo apt-get -qq -y install \
- autoconf-archive \
- automake \
- autotools-dev \
- ccache \
- cmake \
- debhelper \
- dh-autoreconf \
- dh-exec \
- doxygen \
- dpkg-dev \
- gnome-desktop-testing \
- libapparmor-dev \
- libaudit-dev \
- libcap-ng-dev \
- libexpat-dev \
- libglib2.0-dev \
- libselinux1-dev \
- libsystemd-dev \
- libx11-dev \
- python \
- python-dbus \
- python-gi \
- valgrind \
- wget \
- xauth \
- xmlto \
- xsltproc \
- xvfb \
- ${NULL}
+ if [ "$ci_host/$ci_variant/$ci_suite" = "native/production/buster" ]; then
+ packages=(
+ "${packages[@]}"
+ qttools5-dev-tools
+ qt5-default
+ )
+ fi
+
+ packages=(
+ "${packages[@]}"
+ adduser
+ autoconf-archive
+ automake
+ autotools-dev
+ ca-certificates
+ ccache
+ cmake
+ debhelper
+ dh-autoreconf
+ dh-exec
+ docbook-xml
+ docbook-xsl
+ doxygen
+ dpkg-dev
+ ducktype
+ g++
+ gcc
+ gnome-desktop-testing
+ libapparmor-dev
+ libaudit-dev
+ libcap-ng-dev
+ libexpat-dev
+ libglib2.0-dev
+ libselinux1-dev
+ libsystemd-dev
+ libx11-dev
+ python3
+ python3-dbus
+ python3-gi
+ sudo
+ valgrind
+ wget
+ xauth
+ xmlto
+ xsltproc
+ xvfb
+ yelp-tools
+ zstd
+ )
+
+ $sudo apt-get -qq -y --no-install-recommends install "${packages[@]}"
if [ "$ci_in_docker" = yes ]; then
# Add the user that we will use to do the build inside the
# Docker container, and let them use sudo
- adduser --disabled-password user </dev/null
- apt-get -y install sudo
+ adduser --disabled-password --gecos "" user
echo "user ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/nopasswd
chmod 0440 /etc/sudoers.d/nopasswd
fi
- case "$ci_suite" in
- (jessie|xenial)
- # autoconf-archive in Debian 8 and Ubuntu 16.04 is too old,
- # use the one from Debian 9 instead
- wget http://deb.debian.org/debian/pool/main/a/autoconf-archive/autoconf-archive_20160916-1_all.deb
- $sudo dpkg -i autoconf-archive_*_all.deb
- rm autoconf-archive_*_all.deb
- ;;
-
- (stretch)
- # Debian 9 'stretch' didn't have the ducktype package
- ;;
-
- (*)
- # assume Ubuntu 18.04 'bionic', Debian 10 'buster' or newer
- $sudo apt-get -qq -y install ducktype
- ;;
- esac
+ # Make sure we have a messagebus user, even if the dbus package
+ # isn't installed
+ $sudo adduser --system --quiet --home /nonexistent --no-create-home \
+ --disabled-password --group messagebus
;;
(*)
@@ -185,4 +190,36 @@ case "$ci_distro" in
;;
esac
+if [ "$ci_local_packages" = yes ]; then
+ case "$ci_host" in
+ (*-w64-mingw32)
+ mirror=https://repo.msys2.org/mingw/${ci_host%%-*}
+ dep_prefix=$(pwd)/${ci_host}-prefix
+ install -d "${dep_prefix}"
+ packages=(
+ bzip2-1.0.8-2
+ expat-2.2.10-1
+ gcc-libs-10.2.0-6
+ gettext-0.19.8.1-10
+ glib2-2.66.4-1
+ iconv-1.16-2
+ libffi-3.3-2
+ libiconv-1.16-2
+ libwinpthread-git-8.0.0.5906.c9a21571-1
+ pcre-8.44-2
+ zlib-1.2.11-8
+ )
+ for pkg in "${packages[@]}" ; do
+ wget ${mirror}/mingw-w64-${ci_host%%-*}-${pkg}-any.pkg.tar.zst
+ tar -C ${dep_prefix} --strip-components=1 -xvf mingw-w64-${ci_host%%-*}-${pkg}-any.pkg.tar.zst
+ done
+
+ # limit access rights
+ if [ "$ci_in_docker" = yes ]; then
+ chown -R user "${dep_prefix}"
+ fi
+ ;;
+ esac
+fi
+
# vim:set sw=4 sts=4 et: