Skip to content

Commit c0ace64

Browse files
richvdhphil-flex
authored andcommitted
Fix the debian build in a better way. (matrix-org#7212)
1 parent 95c4645 commit c0ace64

File tree

4 files changed

+36
-9
lines changed

4 files changed

+36
-9
lines changed

changelog.d/7212.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Roll back the pin to Pillow 7.0 which was introduced in Synapse 1.12.2.

debian/changelog

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
matrix-synapse-py3 (1.12.2ubuntu1) UNRELEASED; urgency=medium
2+
3+
* Update the Debian build scripts to handle the new installation paths
4+
for the support libraries introduced by Pillow 7.1.1.
5+
6+
-- Richard van der Hoff <richard@matrix.org> Thu, 02 Apr 2020 23:18:52 +0100
7+
18
matrix-synapse-py3 (1.12.2) stable; urgency=medium
29

310
* New synapse release 1.12.2.

debian/rules

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,38 @@ override_dh_installinit:
1515
# we don't really want to strip the symbols from our object files.
1616
override_dh_strip:
1717

18+
# dh_shlibdeps calls dpkg-shlibdeps, which finds all the binary files
19+
# (executables and shared libs) in the package, and looks for the shared
20+
# libraries that they depend on. It then adds a dependency on the package that
21+
# contains that library to the package.
22+
#
23+
# We make two modifications to that process...
24+
#
1825
override_dh_shlibdeps:
19-
# make the postgres package's dependencies a recommendation
20-
# rather than a hard dependency.
26+
# Firstly, postgres is not a hard dependency for us, so we want to make
27+
# the things that psycopg2 depends on (such as libpq) be
28+
# recommendations rather than hard dependencies. We do so by
29+
# running dpkg-shlibdeps manually on psycopg2's libs.
30+
#
2131
find debian/$(PACKAGE_NAME)/ -path '*/site-packages/psycopg2/*.so' | \
2232
xargs dpkg-shlibdeps -Tdebian/$(PACKAGE_NAME).substvars \
2333
-pshlibs1 -dRecommends
2434

25-
# all the other dependencies can be normal 'Depends' requirements,
26-
# except for PIL's, which is self-contained and which confuses
27-
# dpkg-shlibdeps.
28-
dh_shlibdeps -X site-packages/PIL/.libs -X site-packages/psycopg2
35+
# secondly, we exclude PIL's libraries from the process. They are known
36+
# to be self-contained, but they have interdependencies and
37+
# dpkg-shlibdeps doesn't know how to resolve them.
38+
#
39+
# As of Pillow 7.1.0, these libraries are in
40+
# site-packages/Pillow.libs. Previously, they were in
41+
# site-packages/PIL/.libs.
42+
#
43+
# (we also need to exclude psycopg2, of course, since we've already
44+
# dealt with that.)
45+
#
46+
dh_shlibdeps \
47+
-X site-packages/PIL/.libs \
48+
-X site-packages/Pillow.libs \
49+
-X site-packages/psycopg2
2950

3051
override_dh_virtualenv:
3152
./debian/build_virtualenv

synapse/python_dependencies.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,7 @@
6161
"pyasn1-modules>=0.0.7",
6262
"daemonize>=2.3.1",
6363
"bcrypt>=3.1.0",
64-
# Pillow 7.1.0 causes the following issue on debian buster:
65-
# https://github.com/python-pillow/Pillow/issues/2377
66-
"pillow>=4.3.0,<7.1.0",
64+
"pillow>=4.3.0",
6765
"sortedcontainers>=1.4.4",
6866
"pymacaroons>=0.13.0",
6967
"msgpack>=0.5.2",

0 commit comments

Comments
 (0)