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

Fix failures in Debian packaging - #9079

Merged
callahad merged 5 commits into
matrix-org:release-v1.25.0from
callahad:synapse-debian
Jan 12, 2021
Merged

callahad merged 5 commits into
matrix-org:release-v1.25.0from
callahad:synapse-debian

Conversation

@callahad

@callahad callahad commented Jan 12, 2021 •

Copy link
Copy Markdown
Contributor

Debian package builds were failing for two reasons:

  1. Python versions prior to 3.7 throw exceptions when attempting to print Unicode characters under a "C" locale.

  2. We depended on dh-systemd which no longer exists in Debian Bullseye, but is necessary in Ubuntu Xenial.

Fixing the first issue is as easy as setting LANG="C.UTF-8" in the build environment. (See https://bugs.python.org/issue19846)

Fixing the second issue requires attempting to install dh-systemd, but ignoring failures when it does not exist.

Specifically, the dh-systemd package was merged with the main debhelper package as of debhelper (>= 9.20160709)` and a transitional package was left in its place.

That transitional package was removed in Debian Bullseye after being present in both Stretch and Buster. Thus, on the Debian side, just removing the dependency on dh-systemd would be sufficient.

However, Ubuntu Xenial has an old debhelper version, and thus actually needs dh-systemd. So we still try to install it on all distros, but ignore when that fails.

Once we drop support for Xenial (March 2021?) we can completely remove anything referencing dh-systemd.

Fixes #9073
Fixes #9076

Fixes matrix-org#9073

Signed-off-by: Dan Callahan <danc@element.io>
Fixes matrix-org#9076

Signed-off-by: Dan Callahan <danc@element.io>
Signed-off-by: Dan Callahan <danc@element.io>
@callahad

Copy link
Copy Markdown
Contributor Author

Cancelled CI since we don't test the Debian build scripts in CI.

Currently building all debs locally to ensure things work. Stretch completed successfully, and I expect no further failures.

@callahad
callahad requested a review from a team January 12, 2021 10:39
Comment thread debian/control Resolved
xmlsec1 \
&& ( env DEBIAN_FRONTEND=noninteractive apt-get install \
-yqq --no-install-recommends -o Dpkg::Options::=--force-unsafe-io \
dh-systemd || true )

Copy link
Copy Markdown
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.

@richvdh richvdh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks for poking at this. can you add some context to the PR about what broke and why, and how this fixes it?

Comment thread changelog.d/9079.misc Resolved
@callahad

This comment has been minimized.

Comment thread docker/Dockerfile-dhvirtualenv Resolved
Signed-off-by: Dan Callahan <danc@element.io>
Signed-off-by: Dan Callahan <danc@element.io>
Comment thread debian/changelog Resolved
@callahad
callahad merged commit fa6deb2 into matrix-org:release-v1.25.0 Jan 12, 2021
@callahad
callahad deleted the synapse-debian branch January 12, 2021 14:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants