Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Fix failures in Debian packaging #9079

Merged
merged 5 commits into from
Jan 12, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/9079.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix failures when building Debian packages
callahad marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 2 additions & 2 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Section: contrib/python
Priority: extra
Maintainer: Synapse Packaging team <packages@matrix.org>
# keep this list in sync with the build dependencies in docker/Dockerfile-dhvirtualenv.
# TODO: Remove the dependency on dh-systemd after dropping support for Ubuntu xenial
Build-Depends:
debhelper (>= 9),
dh-systemd,
debhelper (>= 9.20160709) | dh-systemd,
callahad marked this conversation as resolved.
Show resolved Hide resolved
dh-virtualenv (>= 1.1),
libsystemd-dev,
libpq-dev,
Expand Down
11 changes: 9 additions & 2 deletions docker/Dockerfile-dhvirtualenv
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,21 @@ FROM ${distro}
ARG distro=""
ENV distro ${distro}

# Python < 3.7 assumes LANG="C" means ASCII-only and throws on printing unicode
# http://bugs.python.org/issue19846
ENV LANG C.UTF-8
callahad marked this conversation as resolved.
Show resolved Hide resolved

# Install the build dependencies
#
# NB: keep this list in sync with the list of build-deps in debian/control
# TODO: it would be nice to do that automatically.
# TODO: Remove the dh-systemd stanza after dropping support for Ubuntu xenial
RUN apt-get update -qq -o Acquire::Languages=none \
&& env DEBIAN_FRONTEND=noninteractive apt-get install \
-yqq --no-install-recommends -o Dpkg::Options::=--force-unsafe-io \
build-essential \
debhelper \
devscripts \
dh-systemd \
libsystemd-dev \
lsb-release \
pkg-config \
Expand All @@ -70,7 +74,10 @@ RUN apt-get update -qq -o Acquire::Languages=none \
python3-venv \
sqlite3 \
libpq-dev \
xmlsec1
xmlsec1 \
&& ( env DEBIAN_FRONTEND=noninteractive apt-get install \
-yqq --no-install-recommends -o Dpkg::Options::=--force-unsafe-io \
dh-systemd || true )
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per GitHub comment above, this basically says "try to install dh-systemd, but it's OK if it fails or doesn't exist."

dh-systemd exists as a dummy transitional package on all releases except Ubuntu xenial (sans backports), where we actually do need it. So we need to try to install it. However, the transitional package was removed in Debian Bullseye, so we have to gracefully continue even if the package does not exist.

...all this goes away when we drop Xenial support in ~2 months.


COPY --from=builder /dh-virtualenv_1.2~dev-1_all.deb /

Expand Down