From 2b6477e28721071b7ba017b49ddc776083168f15d43f2fabacb37d86b4aa606c Mon Sep 17 00:00:00 2001 From: Marcus Rueckert Date: Fri, 30 Sep 2022 17:52:14 +0000 Subject: [PATCH] Accepting request 1007283 from home:darix:apps 1.68.0 OBS-URL: https://build.opensuse.org/request/show/1007283 OBS-URL: https://build.opensuse.org/package/show/network:messaging:matrix/matrix-synapse?expand=0&rev=240 --- 13952.patch | 130 ++++++++++++++++++++++++++ _service | 5 +- cargo_config | 5 + matrix-synapse-1.67.0.obscpio | 3 - matrix-synapse-1.68.0.obscpio | 3 + matrix-synapse-test.spec | 2 +- matrix-synapse.changes | 169 ++++++++++++++++++++++++++++++++++ matrix-synapse.obsinfo | 6 +- matrix-synapse.spec | 21 +++-- vendor.tar.xz | 3 + 10 files changed, 331 insertions(+), 16 deletions(-) create mode 100644 13952.patch create mode 100644 cargo_config delete mode 100644 matrix-synapse-1.67.0.obscpio create mode 100644 matrix-synapse-1.68.0.obscpio create mode 100644 vendor.tar.xz diff --git a/13952.patch b/13952.patch new file mode 100644 index 0000000..687d729 --- /dev/null +++ b/13952.patch @@ -0,0 +1,130 @@ +From ceff48c7bfc5ff9b738c539d02b4590e4ec26d24 Mon Sep 17 00:00:00 2001 +From: David Robertson +Date: Thu, 29 Sep 2022 19:26:15 +0100 +Subject: [PATCH 1/3] Don't require `setuptools_rust` at runtime + +--- + synapse/util/check_dependencies.py | 13 ++++++++++++- + tests/util/test_check_dependencies.py | 20 ++++++++++++++++++-- + 2 files changed, 30 insertions(+), 3 deletions(-) + +diff --git a/synapse/util/check_dependencies.py b/synapse/util/check_dependencies.py +index 66f1da75028..0fb1a8fb72a 100644 +--- a/synapse/util/check_dependencies.py ++++ b/synapse/util/check_dependencies.py +@@ -66,6 +66,17 @@ def _is_dev_dependency(req: Requirement) -> bool: + ) + + ++def _should_ignore_runtime_requirement(req: Requirement) -> bool: ++ # This is a build-time dependency. Irritatingly, `poetry build` ignores the ++ # requirements listed in the [build-system] section of pyproject.toml, so in order ++ # to support `poetry install --no-dev` we have to mark it as a runtime dependency. ++ # Workaround this by ignoring it here. (It might be slightly cleaner to put ++ # `setuptools_rust` in a `build` extra or similar, but . But for now I' ++ if req.name == "setuptools_rust": ++ return True ++ return False ++ ++ + class Dependency(NamedTuple): + requirement: Requirement + must_be_installed: bool +@@ -77,7 +88,7 @@ def _generic_dependencies() -> Iterable[Dependency]: + assert requirements is not None + for raw_requirement in requirements: + req = Requirement(raw_requirement) +- if _is_dev_dependency(req): ++ if _is_dev_dependency(req) or _should_ignore_runtime_requirement(req): + continue + + # https://packaging.pypa.io/en/latest/markers.html#usage notes that +diff --git a/tests/util/test_check_dependencies.py b/tests/util/test_check_dependencies.py +index 5d1aa025d12..6913de24b9c 100644 +--- a/tests/util/test_check_dependencies.py ++++ b/tests/util/test_check_dependencies.py +@@ -40,7 +40,10 @@ class TestDependencyChecker(TestCase): + def mock_installed_package( + self, distribution: Optional[DummyDistribution] + ) -> Generator[None, None, None]: +- """Pretend that looking up any distribution yields the given `distribution`.""" ++ """Pretend that looking up any package yields the given `distribution`. ++ ++ If `distribution = None`, we pretend that the package is not installed. ++ """ + + def mock_distribution(name: str): + if distribution is None: +@@ -81,7 +84,7 @@ def test_version_reported_as_none(self) -> None: + self.assertRaises(DependencyException, check_requirements) + + def test_checks_ignore_dev_dependencies(self) -> None: +- """Bot generic and per-extra checks should ignore dev dependencies.""" ++ """Both generic and per-extra checks should ignore dev dependencies.""" + with patch( + "synapse.util.check_dependencies.metadata.requires", + return_value=["dummypkg >= 1; extra == 'mypy'"], +@@ -142,3 +145,16 @@ def test_release_candidates_satisfy_dependency(self) -> None: + with self.mock_installed_package(new_release_candidate): + # should not raise + check_requirements() ++ ++ def test_setuptools_rust_ignored(self) -> None: ++ """Test a workaround for a `poetry build` problem. Reproduces #13926.""" ++ with patch( ++ "synapse.util.check_dependencies.metadata.requires", ++ return_value=["setuptools_rust >= 1.3"], ++ ): ++ with self.mock_installed_package(None): ++ # should not raise, even if setuptools_rust is not installed ++ check_requirements() ++ with self.mock_installed_package(old): ++ # We also ignore old versions of setuptools_rust ++ check_requirements() + +From b7dab6f99ac46ce35f90f8cd25eab56a8ebd67ec Mon Sep 17 00:00:00 2001 +From: David Robertson +Date: Thu, 29 Sep 2022 19:32:02 +0100 +Subject: [PATCH 2/3] Changelog + +--- + changelog.d/13952.bugfix | 1 + + 1 file changed, 1 insertion(+) + create mode 100644 changelog.d/13952.bugfix + +diff --git a/changelog.d/13952.bugfix b/changelog.d/13952.bugfix +new file mode 100644 +index 00000000000..a6af20f0518 +--- /dev/null ++++ b/changelog.d/13952.bugfix +@@ -0,0 +1 @@ ++Fix a bug introduced in v1.68.0 where Synapse would require `setuptools_rust` at runtime, even though the package is only required at build time. + +From 76abcb27b7f21e0978f1ad7019b816fe9731a816 Mon Sep 17 00:00:00 2001 +From: David Robertson +Date: Thu, 29 Sep 2022 19:43:04 +0100 +Subject: [PATCH 3/3] Finish your sentence, boy; poetry issue reference + +--- + synapse/util/check_dependencies.py | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/synapse/util/check_dependencies.py b/synapse/util/check_dependencies.py +index 0fb1a8fb72a..3b1e2057002 100644 +--- a/synapse/util/check_dependencies.py ++++ b/synapse/util/check_dependencies.py +@@ -70,8 +70,12 @@ def _should_ignore_runtime_requirement(req: Requirement) -> bool: + # This is a build-time dependency. Irritatingly, `poetry build` ignores the + # requirements listed in the [build-system] section of pyproject.toml, so in order + # to support `poetry install --no-dev` we have to mark it as a runtime dependency. +- # Workaround this by ignoring it here. (It might be slightly cleaner to put +- # `setuptools_rust` in a `build` extra or similar, but . But for now I' ++ # See discussion on https://github.com/python-poetry/poetry/issues/6154 (it sounds ++ # like the poetry authors don't consider this a bug?) ++ # ++ # In any case, workaround this by ignoring setuptools_rust here. (It might be ++ # slightly cleaner to put `setuptools_rust` in a `build` extra or similar, but for ++ # now let's do something quick and dirty. + if req.name == "setuptools_rust": + return True + return False diff --git a/_service b/_service index 5e0113d..3490a62 100644 --- a/_service +++ b/_service @@ -4,7 +4,7 @@ @PARENT_TAG@ https://github.com/matrix-org/synapse.git git - v1.67.0 + v1.68.0 v(.*) \1 + + synapse + diff --git a/cargo_config b/cargo_config new file mode 100644 index 0000000..6fb4ff4 --- /dev/null +++ b/cargo_config @@ -0,0 +1,5 @@ +[source.crates-io] +replace-with = "vendored-sources" + +[source.vendored-sources] +directory = "vendor" \ No newline at end of file diff --git a/matrix-synapse-1.67.0.obscpio b/matrix-synapse-1.67.0.obscpio deleted file mode 100644 index 628e3df..0000000 --- a/matrix-synapse-1.67.0.obscpio +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:29f7e1fc03c4e38256af18c514ac6d31bb7f14ffad435b9d3bb04222d56b50fc -size 33315853 diff --git a/matrix-synapse-1.68.0.obscpio b/matrix-synapse-1.68.0.obscpio new file mode 100644 index 0000000..663b707 --- /dev/null +++ b/matrix-synapse-1.68.0.obscpio @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:74896f03bd0c9042354ca1c4381ef7409a2b825afc83a760ebaf937027cc548b +size 33437709 diff --git a/matrix-synapse-test.spec b/matrix-synapse-test.spec index f9a3570..bbd5675 100644 --- a/matrix-synapse-test.spec +++ b/matrix-synapse-test.spec @@ -27,7 +27,7 @@ %define pkgname matrix-synapse Name: %{pkgname}-test -Version: 1.67.0 +Version: 1.68.0 Release: 0 Summary: Test package for %{pkgname} License: Apache-2.0 diff --git a/matrix-synapse.changes b/matrix-synapse.changes index 5378ade..4ffe9a1 100644 --- a/matrix-synapse.changes +++ b/matrix-synapse.changes @@ -1,3 +1,172 @@ +------------------------------------------------------------------- +Fri Sep 30 09:37:21 UTC 2022 - Marcus Rueckert + +- added https://patch-diff.githubusercontent.com/raw/matrix-org/synapse/pull/13952.patch + this prevents setuptools-rust being enforced as a runtime + dependency. Drop dependency in the package again. + +------------------------------------------------------------------- +Wed Sep 28 01:07:43 UTC 2022 - Marcus Rueckert + +- synapse checks for setuptools-rust as a runtime dep. add this + until we figured out a better solution + +------------------------------------------------------------------- +Tue Sep 27 20:50:59 UTC 2022 - Marcus Rueckert + +- Update to 1.68.0 + Please note that Synapse will now refuse to start if configured + to use a version of SQLite older than 3.27. + + In addition, please note that installing Synapse from a source + checkout now requires a recent Rust compiler. Those using + packages will not be affected. On most platforms, installing with + pip install matrix-synapse will not be affected. See the upgrade + notes. + + - Features + - Keep track of when we fail to process a pulled event over + federation so we can intelligently back off in the future. + (#13589, #13814) + - Add an admin API endpoint to fetch messages within a + particular window of time. (#13672) + - Add an admin API endpoint to find a user based on their + external ID in an auth provider. (#13810) + - Cancel the processing of key query requests when they time + out. (#13680) + - Improve validation of request bodies for the following + client-server API endpoints: + /account/3pid/msisdn/requestToken, + /org.matrix.msc3720/account_status, /account/3pid/add, + /account/3pid/bind, /account/3pid/delete and + /account/3pid/unbind. (#13687, #13736) + - Document the timestamp when a user accepts the consent, if + consent tracking is used. (#13741) + - Add a listeners[x].request_id_header configuration option to + specify which request header to extract and use as the + request ID in order to correlate requests from a reverse + proxy. (#13801) + - Bugfixes + - Fix packaging to include Cargo.lock in sdist. (#13909) + - Fix building from packaged sdist. Broken in v1.68.0rc1. + (#13866) + - Fix a bug introduced in Synapse 1.41.0 where the /hierarchy + API returned non-standard information (a room_id field under + each entry in children_state). (#13506) + - Fix a long-standing bug where previously rejected events + could end up in room state because they pass auth checks + given the current state of the room. (#13723) + - Fix a long-standing bug where Synapse fails to start if a + signing key file contains an empty line. (#13738) + - Fix a long-standing bug where Synapse would fail to handle + malformed user IDs or room aliases gracefully in certain + cases. (#13746) + - Fix a long-standing bug where device lists would remain + cached when remote users left and rejoined the last room + shared with the local homeserver. (#13749, #13826) + - Fix a long-standing bug that could cause stale caches in some + rare cases on the first startup of Synapse with replication. + (#13766) + - Fix a long-standing spec compliance bug where Synapse would + accept a trailing slash on the end of /get_missing_events + federation requests. (#13789) + - Delete associated data from event_failed_pull_attempts, + insertion_events, insertion_event_extremities, + insertion_event_extremities, insertion_event_extremities when + purging the room. (#13825) + - Improved Documentation + - Note that libpq is required on ARM-based Macs. (#13480) + - Fix a mistake in the config manual introduced in Synapse + 1.22.0: the event_cache_size is scaled by + caches.global_factor. (#13726) + - Fix a typo in the documentation for the login ratelimiting + configuration. (#13727) + - Define Synapse's compatability policy for SQLite versions. + (#13728) + - Add docs for the common fix of deleting the + matrix_synapse.egg-info/ directory for fixing Python + dependency problems. (#13785) + - Update request log format documentation to mention the format + used when the authenticated user is controlling another user. + (#13794) + - Deprecations and Removals + - Synapse will now refuse to start if configured to use SQLite + < 3.27. (#13760) + - Don't include redundant prev_state in new events. Contributed + by Denis Kariakin (@dakariakin). (#13791) + - Internal Changes + - Fix the release script not publishing binary wheels. (#13850) + - Lower minimum supported rustc version to 1.58.1. (#13857) + - Lock Rust dependencies' versions. (#13858) + - Add a stub Rust crate. (#12595, #13734, #13735, #13743, + #13763, #13769, #13778) + - Bump the minimum dependency of matrix_common to 1.3.0 to make + use of the MXCUri class. Use MXCUri to simplify media + retention test code. (#13162) + - Add and populate the event_stream_ordering column on the + receipts table for future optimisation of push action + processing. Contributed by Nick @ Beeper (@Fizzadar). + (#13703) + - Rename the EventFormatVersions enum values so that they line + up with room version numbers. (#13706) + - Update trial old deps CI to use Poetry 1.2.0. (#13707, + #13725) + - Add experimental configuration option to allow disabling + legacy Prometheus metric names. (#13714, #13717, #13718) + - Fix typechecking with latest types-jsonschema. (#13724) + - Strip number suffix from instance name to consolidate + services that traces are spread over. (#13729) + - Instrument get_metadata_for_events for understandable traces + in Jaeger. (#13730) + - Remove old queries to join room memberships to current state + events. Contributed by Nick @ Beeper (@Fizzadar). (#13745) + - Avoid raising an error due to malformed user IDs in + get_current_hosts_in_room. Malformed user IDs cannot + currently join a room, so this error would not be hit. + (#13748) + - Update the docstrings for get_users_in_room and + get_current_hosts_in_room to explain the impact of partial + state. (#13750) + - Use an additional database query when persisting receipts. + (#13752) + - Preparatory work for storing thread IDs for notifications and + receipts. (#13753) + - Re-type hint some collections as read-only. (#13754) + - Remove unused Prometheus recording rules from + synapse-v2.rules and add comments describing where the rest + are used. (#13756) + - Add a check for editable installs if the Rust library needs + rebuilding. (#13759) + - Tag traces with the instance name to be able to easily jump + into the right logs and filter traces by instance. (#13761) + - Concurrently fetch room push actions when calculating badge + counts. Contributed by Nick @ Beeper (@Fizzadar). (#13765) + - Update the script which makes full schema dumps. (#13770) + - Deduplicate is_server_notices_room. (#13780) + - Simplify the dependency DAG in the tests workflow. (#13784) + - Remove an old, incorrect migration file. (#13788) + - Remove unused method in synapse.api.auth.Auth. (#13795) + - Fix a memory leak when running the unit tests. (#13798) + - Use partial indices on SQLite. (#13802) + - Check that portdb generates the same postgres schema as that + in the source tree. (#13808) + - Fix Docker build when Rust .so has been built locally first. + (#13811) + - Complement: Initialise the Postgres database directly inside + the target image instead of the base Postgres image to fix + building using Buildah. (#13819) + - Support providing an index predicate clause when doing + upserts. (#13822) + - Minor speedups to linting in CI. (#13827) +- update dependencies + bcrypt to 3.1.7 + matrix-common to 1.3.0 +- add handling for the rust based parts: + - new dependencies + - setuptools-rust + - cargo + - update _service file to also vendor the cargo dependencies + ------------------------------------------------------------------- Tue Sep 13 14:16:44 UTC 2022 - Marcus Rueckert diff --git a/matrix-synapse.obsinfo b/matrix-synapse.obsinfo index b37ee3b..b63c4c3 100644 --- a/matrix-synapse.obsinfo +++ b/matrix-synapse.obsinfo @@ -1,4 +1,4 @@ name: matrix-synapse -version: 1.67.0 -mtime: 1663059310 -commit: 80bb098d8775cc2ad1bf5abd150913577e643481 +version: 1.68.0 +mtime: 1664278471 +commit: 3853011d01ad3f5034f53a9dfb7a06e36cf70ae9 diff --git a/matrix-synapse.spec b/matrix-synapse.spec index b9b80de..5e6cdf0 100644 --- a/matrix-synapse.spec +++ b/matrix-synapse.spec @@ -34,7 +34,7 @@ %global idna_version 3.3 %global ijson_version 3.1.4 %global jsonschema_version 4.4.6 -%global matrix_common_version 1.2.1 +%global matrix_common_version 1.3.0 %global matrix_common_max_version 2 %global msgpack_version 1.0.3 %global netaddr_version 0.8.0 @@ -75,7 +75,7 @@ %global PyYAML_version 3.11 %global Twisted_version 18.9.0 %global attrs_version 21.1.1 -%global bcrypt_version 3.1.0 +%global bcrypt_version 3.1.7 %global bleach_version 1.4.3 %global canonicaljson_version 1.5.0 %global canonicaljson_max_version 2 @@ -84,7 +84,7 @@ %global idna_version 2.5 %global ijson_version 3.1.4 %global jsonschema_version 3.0.0 -%global matrix_common_version 1.2.1 +%global matrix_common_version 1.3.0 %global matrix_common_max_version 2 %global msgpack_version 0.5.2 %global netaddr_version 0.7.18 @@ -155,13 +155,15 @@ %define pkgname matrix-synapse %define eggname matrix_synapse Name: %{pkgname} -Version: 1.67.0 +Version: 1.68.0 Release: 0 Summary: Matrix protocol reference homeserver License: Apache-2.0 Group: Productivity/Networking/Instant Messenger URL: https://github.com/matrix-org/synapse Source0: %{pkgname}-%{version}.tar.xz +Source1: vendor.tar.xz +Source2: cargo_config Source47: matrix-synapse-user.conf Source48: README.SUSE Source49: matrix-synapse.tmpfiles.d @@ -173,6 +175,7 @@ Source51: matrix-synapse-generate-config.sh Source99: series Patch: matrix-synapse-1.4.1-paths.patch Patch1: bump-dependencies.patch +Patch2: https://patch-diff.githubusercontent.com/raw/matrix-org/synapse/pull/13952.patch # https://github.com/matrix-org/synapse/pull/10719 # disable by marking as source until we get a decision upstream Source100: 10719-Fix-instert-of-duplicate-key-into-event_json.patch @@ -181,6 +184,7 @@ BuildRequires: %{use_python}-pip BuildRequires: %{use_python}-poetry BuildRequires: %{use_python}-setuptools BuildRequires: %{use_python}-wheel +BuildRequires: cargo BuildRequires: fdupes BuildRequires: python-rpm-macros BuildRequires: systemd-rpm-macros @@ -190,6 +194,7 @@ BuildRequires: unzip %{?systemd_ordering} %{sysusers_requires} %requires_peq %{use_python}-base +BuildRequires: %{use_python}-setuptools-rust # NOTE: Keep this is in the same order as pyproject.toml. # some version locks based on poetry.lock BuildRequires: %{use_python}-Jinja2 >= %{Jinja2_version} @@ -292,7 +297,6 @@ BuildRequires: %{use_python}-txredisapi >= %{txredisapi_version} %endif BuildRequires: %{use_python}-Pympler >= %{Pympler_version} %requires_peq %{use_python}-Pympler -BuildArch: noarch # We only provide/obsolete python2 to ensure that users upgrade. Obsoletes: python2-matrix-synapse < %{version}-%{release} Provides: python2-matrix-synapse = %{version}-%{release} @@ -304,7 +308,8 @@ Synapse is a Python-based reference "homeserver" implementation of Matrix. Matrix is a system for federated Instant Messaging and VoIP. %prep -%autosetup -p1 +%autosetup -p1 -a1 +install -m 0644 -D %{SOURCE2} .cargo/config # Remove all un-needed #!-lines. find synapse/ -type f -exec sed -i '1{/^#!/d}' {} \; @@ -382,8 +387,8 @@ install -d -m 0750 %{buildroot}%{_localstatedir}/log/%{pkgname} %config(noreplace) %attr(-,root,synapse) %{_sysconfdir}/%{pkgname}/ %dir %attr(0750,%{modname},%{modname}) %{_localstatedir}/lib/%{pkgname} %dir %attr(0750,%{modname},%{modname}) %{_localstatedir}/log/%{pkgname} -%{python3_sitelib}/%{modname} -%{python3_sitelib}/%{eggname}-*-info +%{python3_sitearch}/%{modname} +%{python3_sitearch}/%{eggname}-*-info # Python helper scripts. %{_bindir}/synctl %{_libexecdir}/%{pkgname} diff --git a/vendor.tar.xz b/vendor.tar.xz new file mode 100644 index 0000000..709af7c --- /dev/null +++ b/vendor.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a08f39c2b21835c939efae0c46d5e891ebc9e5f0f58d175d953b3dfbe6be4be5 +size 6175020