summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2022-09-05 14:32:10 +0100
committerSimon McVittie <smcv@collabora.com>2022-09-05 17:35:57 +0100
commit5566ffcd102f121e65d3fa7ef90d9243186c1328 (patch)
treee9c0a29f4091822d14a091be6a2af2161d1fc7e7
parentfdab4745424c7477e5257a4fc0fff4e14ef664ef (diff)
downloaddbus-python-5566ffcd102f121e65d3fa7ef90d9243186c1328.tar.gz
CI: Exercise Meson build
Signed-off-by: Simon McVittie <smcv@collabora.com>
-rw-r--r--.gitignore2
-rw-r--r--.gitlab-ci.yml1
-rwxr-xr-xtools/ci-build.sh38
-rwxr-xr-xtools/ci-install.sh81
4 files changed, 78 insertions, 44 deletions
diff --git a/.gitignore b/.gitignore
index b42dd58..7a98a95 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,6 +14,8 @@
.dirstamp
.libs/
/_autotools/
+/_meson-build/
+/_meson-source/
/INSTALL
/aclocal.m4
/api/
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 1f607f1..e6ae8ec 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -44,7 +44,6 @@ variables:
artifacts: &artifacts
paths:
- _autotools/*.log
- - _meson-build/meson-logs/*.txt
when: always
build:python3.5:
diff --git a/tools/ci-build.sh b/tools/ci-build.sh
index d17b190..23392f6 100755
--- a/tools/ci-build.sh
+++ b/tools/ci-build.sh
@@ -59,6 +59,8 @@ if [ -n "$dbus_ci_system_python" ]; then
export PYTHON="$(command -v "$dbus_ci_system_python")"
fi
+export PATH="$HOME/.local/bin:$PATH"
+
NOCONFIGURE=1 ./autogen.sh
e=0
@@ -91,9 +93,41 @@ $make -C _autotools install
gnome-desktop-testing-runner dbus-python
)
+# Do a Meson build from the Autotools dist tarball, to check that can work
+mkdir _meson-source
+tar -C _meson-source --strip-components=1 -xf _autotools/dbus-python-*.tar.gz
+meson setup \
+ --prefix="$prefix" \
+ -Ddoc=true \
+ -Dinstalled_tests=true \
+ -Dpython="${PYTHON:-python3}" \
+ _meson-source _meson-build
+meson compile -C _meson-build
+meson test -C _meson-build
+rm -fr "$prefix"
+meson install -C _meson-build
+( cd "$prefix" && find . -ls )
+
+case "${PYTHON:-python3}" in
+ (*3.[0-8]-dbg)
+ # -dbg builds with Meson don't set the right ABI suffix in older Pythons
+ test_meson=
+ ;;
+ (*)
+ test_meson=yes
+ ;;
+esac
+
+if [ -n "$test_meson" ]; then (
+ dbus_ci_pyversion="$(${PYTHON:-python3} -c 'import sysconfig; print(sysconfig.get_config_var("VERSION"))')"
+ export PYTHONPATH="$prefix/lib/python$dbus_ci_pyversion/site-packages:$prefix/lib/python3/dist-packages:$PYTHONPATH"
+ export XDG_DATA_DIRS="$prefix/share:/usr/local/share:/usr/share"
+ gnome-desktop-testing-runner dbus-python
+); fi
+
# re-run the tests with dbus-python only installed via pip
${PYTHON:-python3} -m virtualenv --python="${PYTHON:-python3}" _venv
-(
+if [ -n "$test_meson" ]; then (
. _venv/bin/activate
export PYTHON="$(pwd)/_venv/bin/python3"
"$PYTHON" -m pip install -vvv _autotools/dbus-python-*.tar.gz
@@ -106,4 +140,4 @@ ${PYTHON:-python3} -m virtualenv --python="${PYTHON:-python3}" _venv
rm -f "$prefix/venv-meta/installed-tests/dbus-python/test-import-repeatedly.test"
export XDG_DATA_DIRS="$prefix/venv-meta:/usr/local/share:/usr/share"
gnome-desktop-testing-runner dbus-python
-)
+); fi
diff --git a/tools/ci-install.sh b/tools/ci-install.sh
index 2a03179..93c7c4d 100755
--- a/tools/ci-install.sh
+++ b/tools/ci-install.sh
@@ -32,7 +32,7 @@ NULL=
# ci_distro:
# OS distribution in which we are testing
# Typical values: ubuntu, debian; maybe fedora in future
-: "${ci_distro:=ubuntu}"
+: "${ci_distro:=debian}"
# ci_docker:
# If non-empty, this is the name of a Docker image. ci-install.sh will
@@ -54,7 +54,7 @@ NULL=
# OS suite (release, branch) in which we are testing.
# Typical values for ci_distro=debian: sid, buster
# Typical values for ci_distro=fedora might be 25, rawhide
-: "${ci_suite:=xenial}"
+: "${ci_suite:=bookworm}"
if [ $(id -u) = 0 ]; then
sudo=
@@ -62,6 +62,7 @@ else
sudo=sudo
fi
+have_system_meson=
have_system_sphinx=
have_system_tappy=
@@ -106,7 +107,6 @@ case "$ci_distro" in
automake \
autotools-dev \
ccache \
- dbus \
debhelper \
dh-autoreconf \
docbook-xml \
@@ -118,6 +118,7 @@ case "$ci_distro" in
libtool \
make \
sudo \
+ virtualenv \
wget \
xmlto \
${NULL}
@@ -130,24 +131,11 @@ case "$ci_distro" in
python3-gi${dbus_ci_system_python_module_suffix} \
python3-pip \
python3-setuptools \
+ python3-tap \
${NULL}
- if [ "$dbus_ci_system_python" = python ]; then
- sudo apt-get -qq -y install python-gobject-2
- fi
-
- case "$ci_suite" in
- (jessie|xenial)
- ;;
-
- (*)
- $sudo apt-get -qq -y install python3-tap
- have_system_tappy=yes
- ;;
- esac
-
case "$ci_suite" in
- (jessie|xenial|stretch|bionic)
+ (stretch|bionic)
;;
(*)
@@ -169,12 +157,22 @@ case "$ci_distro" in
fi
case "$ci_suite" in
- (xenial)
- # autoconf-archive in 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|bionic|buster|focal|bullseye)
+ $sudo apt-get -qq -y install dbus
+ ;;
+
+ (*)
+ $sudo apt-get -qq -y install dbus-daemon
+ ;;
+ esac
+
+ case "$ci_suite" in
+ (stretch|bionic|buster|focal)
+ ;;
+
+ (*)
+ $sudo apt-get -qq -y install meson
+ have_system_meson=true
;;
esac
;;
@@ -185,32 +183,33 @@ case "$ci_distro" in
;;
esac
-if [ -n "$have_system_sphinx" ]; then
+if [ -n "$have_system_meson" ]; then
:
elif [ -n "${dbus_ci_system_python-}" ]; then
- "$dbus_ci_system_python" -m pip install --user \
- sphinx \
- sphinx_rtd_theme \
- ${NULL}
+ case "$ci_suite" in
+ (stretch|xenial|bionic)
+ # 0.56.2 is the last version that supported Python 3.5
+ runuser -u user -- "$dbus_ci_system_python" -m pip install --user meson==0.56.2 ninja
+ ;;
+ (*)
+ runuser -u user -- "$dbus_ci_system_python" -m pip install --user meson ninja
+ ;;
+ esac
else
- pip install \
- sphinx \
- sphinx_rtd_theme \
- ${NULL}
+ runuser -u user -- pip install meson ninja
fi
-if [ -n "$have_system_tappy" ]; then
- :
-elif "${PYTHON:-${dbus_ci_system_python-false}}" -c 'import sys; exit(sys.version_info[0] > 2)'; then
- # Don't install tap.py for Python 2
+if [ -n "$have_system_sphinx" ]; then
:
elif [ -n "${dbus_ci_system_python-}" ]; then
- "$dbus_ci_system_python" -m pip install --user \
- tap.py \
+ runuser -u user -- "$dbus_ci_system_python" -m pip install --user \
+ sphinx \
+ sphinx_rtd_theme \
${NULL}
else
- pip install \
- tap.py \
+ runuser -u user -- pip install \
+ sphinx \
+ sphinx_rtd_theme \
${NULL}
fi