element-hq / element-hq/synapse
Synapse debian packages fail `lintian` linting tool checks
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 600
- Avg merge
- 5d 22h
- Merged PRs (30d)
- 51
Description
Out of curiosity, I ran the [lintian](https://lintian.debian.org) Debian package linting tool on one of our latest debian packages, and got the following results:
```
➜ lintian ~/Downloads/matrix-synapse-py3_1.138.2+trixie1_amd64.deb
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "",
LC_ALL = (unset),
LC_TIME = "en_GB.UTF-8",
LC_MONETARY = "en_GB.UTF-8",
LC_ADDRESS = "en_GB.UTF-8",
LC_TELEPHONE = "en_GB.UTF-8",
LC_NAME = "en_GB.UTF-8",
LC_MEASUREMENT = "en_GB.UTF-8",
LC_IDENTIFICATION = "en_GB.UTF-8",
LC_NUMERIC = "en_GB.UTF-8",
LC_PAPER = "en_GB.UTF-8",
LANG = "en_GB.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
E: matrix-synapse-py3: dir-or-file-in-opt [opt/venvs/]
E: matrix-synapse-py3: dir-or-file-in-opt [opt/venvs/matrix-synapse/.gitignore]
E: matrix-synapse-py3: dir-or-file-in-opt [opt/venvs/matrix-synapse/]
E: matrix-synapse-py3: dir-or-file-in-opt ... use "--tag-display-limit 0" to see all (or pipe to a file/program)
E: matrix-synapse-py3: embedded-library bzip2 [opt/venvs/matrix-synapse/lib/python3.13/site-packages/pillow.libs/libfreetype-083ff72c.so.6.20.2]
E: matrix-synapse-py3: embedded-library freetype [opt/venvs/matrix-synapse/lib/python3.13/site-packages/pillow.libs/libfreetype-083ff72c.so.6.20.2]
E: matrix-synapse-py3: embedded-library lcms2 [opt/venvs/matrix-synapse/lib/python3.13/site-packages/pillow.libs/liblcms2-cc10e42f.so.2.0.17]
E: matrix-synapse-py3: embedded-library ... use "--tag-display-limit 0" to see all (or pipe to a file/program)
E: matrix-synapse-py3: package-installs-ieee-data [opt/venvs/matrix-synapse/lib/python3.13/site-packages/netaddr/eui/iab.idx]
E: matrix-synapse-py3: package-installs-ieee-data [opt/venvs/matrix-synapse/lib/python3.13/site-packages/netaddr/eui/iab.txt]
E: matrix-synapse-py3: package-installs-ieee-data [opt/venvs/matrix-synapse/lib/python3.13/site-packages/netaddr/eui/oui.idx]
E: matrix-synapse-py3: package-installs-ieee-data ... use "--tag-display-limit 0" to see all (or pipe to a file/program)
E: matrix-synapse-py3: package-installs-python-pycache-dir [opt/venvs/matrix-synapse/lib/python3.13/site-packages/OpenSSL/__pycache__/]
E: matrix-synapse-py3: package-installs-python-pycache-dir [opt/venvs/matrix-synapse/lib/python3.13/site-packages/PIL/__pycache__/]
E: matrix-synapse-py3: package-installs-python-pycache-dir [opt/venvs/matrix-synapse/lib/python3.13/site-packages/__pycache__/]
E: matrix-synapse-py3: package-installs-python-pycache-dir ... use "--tag-display-limit 0" to see all (or pipe to a file/program)
E: matrix-synapse-py3: privacy-breach-logo (https://static.element.io/images/email-logo.png) [opt/venvs/matrix-synapse/lib/python3.13/site-packages/synapse/res/templates/_base.html]
E: matrix-synapse-py3: privacy-breach-logo (https://static.element.io/images/email-logo.png) [opt/venvs/matrix-synapse/lib/python3.13/site-packages/synapse/res/templates/notice_expiry.html]
E: matrix-synapse-py3: privacy-breach-logo (https://static.element.io/images/email-logo.png) [opt/venvs/matrix-synapse/lib/python3.13/site-packages/synapse/res/templates/notif_mail.html]
E: matrix-synapse-py3: python3-script-but-no-python3-dep python3 (does not satisfy python3:any | python3-minimal:any) [opt/venvs/matrix-synapse/lib/python3.13/site-packages/synapse/_scripts/generate_config.py]
E: matrix-synapse-py3: python3-script-but-no-python3-dep python3 (does not satisfy python3:any | python3-minimal:any) [opt/venvs/matrix-synapse/lib/python3.13/site-packages/synapse/_scripts/generate_log_config.py]
E: matrix-synapse-py3: unstripped-binary-or-object [opt/venvs/matrix-synapse/lib/python3.13/site-packages/5bae8a57b5ef85818b48__mypyc.cpython-313-x86_64-linux-gnu.so]
E: matrix-synapse-py3: unstripped-binary-or-object [opt/venvs/matrix-synapse/lib/python3.13/site-packages/PIL/_avif.cpython-313-x86_64-linux-gnu.so]
E: matrix-synapse-py3: unstripped-binary-or-object [opt/venvs/matrix-synapse/lib/python3.13/site-packages/PIL/_imaging.cpython-313-x86_64-linux-gnu.so]
E: matrix-synapse-py3: unstripped-binary-or-object ... use "--tag-display-limit 0" to see all (or pipe to a file/program)
W: matrix-synapse-py3: debconf-is-not-a-registry [opt/venvs/matrix-synapse/lib/manage_debconf.pl:16]
W: matrix-synapse-py3: embedded-javascript-library please use libjs-jquery [opt/venvs/matrix-synapse/lib/python3.13/site-packages/synapse/static/client/login/js/jquery-3.4.1.min.js]
W: matrix-synapse-py3: executable-not-elf-or-script [opt/venvs/matrix-synapse/lib/python3.13/site-packages/twisted/plugins/dropin.cache]
W: matrix-synapse-py3: no-manual-page [usr/bin/update_synapse_database]
W: matrix-synapse-py3: package-contains-vcs-control-file [opt/venvs/matrix-synapse/.gitignore]
W: matrix-synapse-py3: package-contains-vcs-control-file [opt/venvs/matrix-synapse/lib/python3.13/site-packages/twisted/conch/newsfragments/.gitignore]
W: matrix-synapse-py3: package-contains-vcs-control-file [opt/venvs/matrix-synapse/lib/python3.13/site-packages/twisted/mail/newsfragments/.gitignore]
W: matrix-synapse-py3: package-contains-vcs-control-file ... use "--tag-display-limit 0" to see all (or pipe to a file/program)
W: matrix-synapse-py3: package-has-unnecessary-activation-of-ldconfig-trigger
W: matrix-synapse-py3: priority-extra-is-replaced-by-priority-optional
W: matrix-synapse-py3: privacy-breach-generic [
] (https://riot.im/img/external/avatar-1.png) [opt/venvs/matrix-synapse/lib/python3.13/site-packages/synapse/res/templates/room.html]
W: matrix-synapse-py3: privacy-breach-generic [
] (https://riot.im/img/external/avatar-2.png) [opt/venvs/matrix-synapse/lib/python3.13/site-packages/synapse/res/templates/room.html]
W: matrix-synapse-py3: privacy-breach-generic [
] (https://riot.im/img/external/avatar-3.png) [opt/venvs/matrix-synapse/lib/python3.13/site-packages/synapse/res/templates/room.html]
W: matrix-synapse-py3: privacy-breach-generic ... use "--tag-display-limit 0" to see all (or pipe to a file/program)
W: matrix-synapse-py3: script-not-executable [opt/venvs/matrix-synapse/lib/python3.13/site-packages/netaddr/cli.py]
W: matrix-synapse-py3: script-not-executable [opt/venvs/matrix-synapse/lib/python3.13/site-packages/netaddr/eui/ieee.py]
W: matrix-synapse-py3: script-not-executable [opt/venvs/matrix-synapse/lib/python3.13/site-packages/netaddr/ip/iana.py]
W: matrix-synapse-py3: script-not-executable ... use "--tag-display-limit 0" to see all (or pipe to a file/program)
W: matrix-synapse-py3: unusual-interpreter /opt/venvs/matrix-synapse/bin/python [opt/venvs/matrix-synapse/bin/automat-visualize]
W: matrix-synapse-py3: unusual-interpreter /opt/venvs/matrix-synapse/bin/python [opt/venvs/matrix-synapse/bin/cftp]
W: matrix-synapse-py3: unusual-interpreter /opt/venvs/matrix-synapse/bin/python [opt/venvs/matrix-synapse/bin/ckeygen]
W: matrix-synapse-py3: unusual-interpreter ... use "--tag-display-limit 0" to see all (or pipe to a file/program)
W: matrix-synapse-py3: uses-implicit-await-trigger interest [triggers:3]
```
To see a description of each error tag, go to e.g. https://lintian.debian.org/tags/package-installs-python-pycache-dir.
Most of these are fairly benign, and not entirely within our control (i.e. `script-not-executable [opt/venvs/matrix-synapse/lib/python3.13/site-packages/netaddr/cli.py]`). The `privacy-breach-generic` ones are external images that are sent in email notifications.
Changes we could make from this:
* Clear any `__pycache__` directories.
* Avoid shipping our own `.gitignore`
* Update/remove our embedded jquery library.
* Investigate why we create `opt/venvs/matrix-synapse/`, and if that is only for `.gitignore` (edit: related [matrix-synapse-py3.links](https://github.com/element-hq/synapse/blob/develop/debian/matrix-synapse-py3.links))
* Look into the `unusual-interpreter` errors. Do we need to be including these binaries? (Don't worry, `ckeygen` is [a unix tool for connecting to SSH servers](https://linux.die.net/man/1/ckeygen)).
* The `uses-implicit-await-trigger` tag is a result of [this code](https://github.com/element-hq/synapse/blob/6ff181dbc7825f9dcb4eef0e6506b616b27a1d2f/debian/build_virtualenv#L126-L136) having a vague `interest` trigger, which defaults to `interest-await`. We should make it explicit by either specifying `interest-await` or `interest-noawait`, and justify the choice either way (`dh-virtualenv-interpreter-update` does not need await, so I would choose `interest-noawait`.)
Contributor guide
Assessment
This issue has not been assessed yet.