diff mbox series

[6/6] package/python-crossbar: fix configuration

Message ID 20220403221953.1158787-6-emile.cormier.jr@gmail.com
State Accepted
Headers show
Series [1/6] package/python-snappy: bump version to 0.6.1 | expand

Commit Message

Emile Cormier April 3, 2022, 10:19 p.m. UTC
From: ecorm <ecorm@users.noreply.github.com>

Fixes configuration and patches setup requirements so that
python-crossbar can build and run.
See https://github.com/crossbario/crossbar/issues/1936 for discussion
with Crossbar author.
Fixes: #14556
Signed-off-by: Emile Cormier <emile.cormier.jr@gmail.com>
---
 .../0002-Remove-idna-requirement.patch        | 29 ----------
 ...002-Resolve-conflicting-requirements.patch | 57 +++++++++++++++++++
 package/python-crossbar/Config.in             | 21 +++----
 3 files changed, 68 insertions(+), 39 deletions(-)
 delete mode 100644 package/python-crossbar/0002-Remove-idna-requirement.patch
 create mode 100644 package/python-crossbar/0002-Resolve-conflicting-requirements.patch

Comments

Thomas Petazzoni Aug. 8, 2022, 8:45 p.m. UTC | #1
Hello Emile,

On Sun,  3 Apr 2022 19:19:53 -0300
Emile Cormier <emile.cormier.jr@gmail.com> wrote:

> From: ecorm <ecorm@users.noreply.github.com>
> 
> Fixes configuration and patches setup requirements so that
> python-crossbar can build and run.
> See https://github.com/crossbario/crossbar/issues/1936 for discussion
> with Crossbar author.
> Fixes: #14556
> Signed-off-by: Emile Cormier <emile.cormier.jr@gmail.com>
> ---
>  .../0002-Remove-idna-requirement.patch        | 29 ----------
>  ...002-Resolve-conflicting-requirements.patch | 57 +++++++++++++++++++
>  package/python-crossbar/Config.in             | 21 +++----
>  3 files changed, 68 insertions(+), 39 deletions(-)
>  delete mode 100644 package/python-crossbar/0002-Remove-idna-requirement.patch
>  create mode 100644 package/python-crossbar/0002-Resolve-conflicting-requirements.patch

I have applied, with a number of changes:

 - The patch 0002-Resolve-conflicting-requirements.patch is replaced by
   a more general patch that removes indirect dependencies from
   requirements-min.txt.

 - The test case for crossbar is changed to no longer force autobahn to
   use umsgpack, as we now use msgpack, expected by default by autobahn.

The minimal Crossbar test case we have in
https://git.buildroot.org/buildroot/tree/support/testing/tests/package/sample_python_crossbar.py
runs correctly.

If you have some suggestions of other things to test (simple tests) to
better validate the Crossbar installation, it would be useful.

Thanks!

Thomas
Emile Cormier Aug. 8, 2022, 9:39 p.m. UTC | #2
Hi Thomas,

Thank you for your efforts towards fixing Buildroot's Crossbar. Although I
am migrating away from Crossbar (will be writing my own embeddable C++
router), I'm sure it may be useful to others.

"crossbar status" is pretty much the only easy test I know off the top of
my head. There might be some stuff in Crossbar's test suite that could be
borrowed, but I don't have much time to check right now:
https://github.com/crossbario/crossbar/tree/master/test

My expertise is more in C++ and I am not fluent in Python (although I can
read the latter).

Cheers,
Emile Cormier

On Mon, Aug 8, 2022 at 5:45 PM Thomas Petazzoni <
thomas.petazzoni@bootlin.com> wrote:

> Hello Emile,
>
> On Sun,  3 Apr 2022 19:19:53 -0300
> Emile Cormier <emile.cormier.jr@gmail.com> wrote:
>
> > From: ecorm <ecorm@users.noreply.github.com>
> >
> > Fixes configuration and patches setup requirements so that
> > python-crossbar can build and run.
> > See https://github.com/crossbario/crossbar/issues/1936 for discussion
> > with Crossbar author.
> > Fixes: #14556
> > Signed-off-by: Emile Cormier <emile.cormier.jr@gmail.com>
> > ---
> >  .../0002-Remove-idna-requirement.patch        | 29 ----------
> >  ...002-Resolve-conflicting-requirements.patch | 57 +++++++++++++++++++
> >  package/python-crossbar/Config.in             | 21 +++----
> >  3 files changed, 68 insertions(+), 39 deletions(-)
> >  delete mode 100644
> package/python-crossbar/0002-Remove-idna-requirement.patch
> >  create mode 100644
> package/python-crossbar/0002-Resolve-conflicting-requirements.patch
>
> I have applied, with a number of changes:
>
>  - The patch 0002-Resolve-conflicting-requirements.patch is replaced by
>    a more general patch that removes indirect dependencies from
>    requirements-min.txt.
>
>  - The test case for crossbar is changed to no longer force autobahn to
>    use umsgpack, as we now use msgpack, expected by default by autobahn.
>
> The minimal Crossbar test case we have in
>
> https://git.buildroot.org/buildroot/tree/support/testing/tests/package/sample_python_crossbar.py
> runs correctly.
>
> If you have some suggestions of other things to test (simple tests) to
> better validate the Crossbar installation, it would be useful.
>
> Thanks!
>
> Thomas
> --
> Thomas Petazzoni, CTO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
>
diff mbox series

Patch

diff --git a/package/python-crossbar/0002-Remove-idna-requirement.patch b/package/python-crossbar/0002-Remove-idna-requirement.patch
deleted file mode 100644
index 5e19a467c2..0000000000
--- a/package/python-crossbar/0002-Remove-idna-requirement.patch
+++ /dev/null
@@ -1,29 +0,0 @@ 
-From 9164d21cc66c1f78de37c9383528c5d528cbdbeb Mon Sep 17 00:00:00 2001
-From: Asaf Kahlon <asafka7@gmail.com>
-Date: Wed, 26 Sep 2018 15:33:43 +0300
-Subject: [PATCH] Remove idna requirement.
-
-The latest version of idna is 2.7, but it seems like idna is not a direct
-dependency anymore (a short "git grep" shows it's only written in requirement
-and readme files).
-
-Signed-off-by: Asaf Kahlon <asafka7@gmail.com>
----
- requirements-min.txt | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/requirements-min.txt b/requirements-min.txt
-index 92fb0f8f..13cdac87 100644
---- a/requirements-min.txt
-+++ b/requirements-min.txt
-@@ -8,7 +8,6 @@ click>=6.7
- constantly>=15.1.0
- cryptography>=2.6.1
- h2>=3.2.0
--idna<2.6,>=2.5
- importlib-resources>=4.1.1
- incremental>=17.5.0
- jinja2>=2.10.1
--- 
-2.17.1
-
diff --git a/package/python-crossbar/0002-Resolve-conflicting-requirements.patch b/package/python-crossbar/0002-Resolve-conflicting-requirements.patch
new file mode 100644
index 0000000000..afb182cab1
--- /dev/null
+++ b/package/python-crossbar/0002-Resolve-conflicting-requirements.patch
@@ -0,0 +1,57 @@ 
+Remove the upper limit for idna, which is an indirect dependency via
+twisted[tls] and treq->requests. This upper limit conflicts with the
+python-idna v3.3 package bundled with buildroot. The idna requirement for
+twisted v20.3.0 is idna>=0.6,!=2.3 , and for requests it's
+idna>=2.5,<4;python_version>="3" .
+
+Remove the upper limit for urllib3, which is an indirect dependency via
+treq->requests. This upper limit conflicts with the python-urllib3 v1.26.8
+package bundled with buildroot. The urllib3 requirements for requests v2.27.1
+is urllib3>=1.21.1,<1.27 .
+
+Set the lower limit for urllib3 to >1.24.2 to satisfy the comment regarding
+CVE-2019-11324.
+
+Remove the importlib-resources>=4.1.1 requirement. The features of
+importlib-resources v5.0 (and thus v4.1.1) have been merged into the
+CPython 3.10 bundled with buildroot.
+
+Remove the u-msgpack-python requirement, which is an indirect dependency via
+autobahn[serialization] that is not needed due to the python-msgpack package
+being chosen instead on CPython.
+
+Remove the netaddr requirement, which is an indirect dependency via
+autobahn[xbr]->web3. buildroot's python-autobahn package currently does not
+support the autobahn[xbr] extras.
+
+Signed-off-by: Emile Cormier <emile.cormier.jr@gmail.com>
+
+--- a/requirements-min.txt
++++ b/requirements-min.txt
+@@ -8,13 +8,11 @@ colorama>=0.4.4
+ constantly>=15.1.0
+ cryptography>=2.6.1
+ h2>=3.2.0
+-idna<2.6,>=2.5
+-importlib-resources>=4.1.1
++idna>=2.5
+ incremental>=17.5.0
+ jinja2>=2.10.1
+ lmdb>=0.92
+ mistune>=0.7.4
+-netaddr>=0.7.19
+ passlib>=1.7.1
+ priority>=1.3.0
+ psutil>=5.2.2
+@@ -37,10 +35,9 @@ twisted[tls,conch,http2,osx_platform]>=2
+ twisted[tls,conch,http2,windows_platform]>=20.3.0; sys_platform == 'win32'
+ txaio>=21.2.1
+ txtorcon>=20.0.0
+-u-msgpack-python>=2.4.1
+ # urllib3 is an indirect dependency, but we force a recent version because of https://nvd.nist.gov/vuln/detail/CVE-2019-11324
+ # workaround for version conflict in requests vs sth else:
+-urllib3<1.25,>=1.21.1
++urllib3>1.24.2
+ vmprof>=0.4.12; platform_machine=='x86_64' or platform_machine=='i386' or platform_machine=='arm'
+ watchdog>=0.8.3
+ werkzeug>=0.14.1
diff --git a/package/python-crossbar/Config.in b/package/python-crossbar/Config.in
index 9625d9ce8e..ef02dd54f9 100644
--- a/package/python-crossbar/Config.in
+++ b/package/python-crossbar/Config.in
@@ -2,21 +2,21 @@  config BR2_PACKAGE_PYTHON_CROSSBAR
 	bool "python-crossbar"
 	depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS # python-cryptography
 	# All the following dependencies are runtime dependencies
-	select BR2_PACKAGE_PYTHON_ATTRS
 	select BR2_PACKAGE_PYTHON_AUTOBAHN
+	select BR2_PACKAGE_PYTHON_AUTOBAHN_ACCELERATE
+	select BR2_PACKAGE_PYTHON_AUTOBAHN_COMPRESS
+	select BR2_PACKAGE_PYTHON_AUTOBAHN_ENCRYPTION
+	select BR2_PACKAGE_PYTHON_AUTOBAHN_SCRAM
+	select BR2_PACKAGE_PYTHON_AUTOBAHN_SERIALIZATION
+	select BR2_PACKAGE_PYTHON_AUTOBAHN_TWISTED
 	select BR2_PACKAGE_PYTHON_BITSTRING
 	select BR2_PACKAGE_PYTHON_CBOR
-	select BR2_PACKAGE_PYTHON_CBOR2
 	select BR2_PACKAGE_PYTHON_CLICK
-	select BR2_PACKAGE_PYTHON_CONSTANTLY
+	select BR2_PACKAGE_PYTHON_COLORAMA
 	select BR2_PACKAGE_PYTHON_CRYPTOGRAPHY
-	select BR2_PACKAGE_PYTHON_H2
-	select BR2_PACKAGE_PYTHON_IDNA
-	select BR2_PACKAGE_PYTHON_INCREMENTAL
 	select BR2_PACKAGE_PYTHON_JINJA2
 	select BR2_PACKAGE_PYTHON_LMDB
 	select BR2_PACKAGE_PYTHON_MISTUNE
-	select BR2_PACKAGE_PYTHON_NETADDR
 	select BR2_PACKAGE_PYTHON_PASSLIB
 	select BR2_PACKAGE_PYTHON_PRIORITY
 	select BR2_PACKAGE_PYTHON_PSUTIL
@@ -29,17 +29,18 @@  config BR2_PACKAGE_PYTHON_CROSSBAR
 	select BR2_PACKAGE_PYTHON_PYTRIE
 	select BR2_PACKAGE_PYTHON_PYYAML
 	select BR2_PACKAGE_PYTHON_SDNOTIFY
-	select BR2_PACKAGE_PYTHON_SERVICE_IDENTITY
 	select BR2_PACKAGE_PYTHON_SETPROCTITLE
 	select BR2_PACKAGE_PYTHON_SETUPTOOLS
 	select BR2_PACKAGE_PYTHON_TREQ
 	select BR2_PACKAGE_PYTHON_TWISTED
+	select BR2_PACKAGE_PYTHON_TWISTED_CONCH
+	select BR2_PACKAGE_PYTHON_TWISTED_HTTP2
+	select BR2_PACKAGE_PYTHON_TWISTED_TLS
 	select BR2_PACKAGE_PYTHON_TXAIO
 	select BR2_PACKAGE_PYTHON_TXTORCON
-	select BR2_PACKAGE_PYTHON_U_MSGPACK
-	select BR2_PACKAGE_PYTHON_UBJSON
 	select BR2_PACKAGE_PYTHON_WATCHDOG
 	select BR2_PACKAGE_PYTHON_WERKZEUG
+	select BR2_PACKAGE_PYTHON_ZLMDB
 	select BR2_PACKAGE_PYTHON_ZOPE_INTERFACE
 	help
 	  Crossbar.io is an open-source WAMP application router that