diff mbox series

[5/6] package/python-autobahn: add missing subpackages

Message ID 20220403221953.1158787-5-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>

Added missing python-autobahn subpackages required by python-crossbar.
Signed-off-by: Emile Cormier <emile.cormier.jr@gmail.com>
---
 package/python-autobahn/Config.in | 40 +++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

Comments

Thomas Petazzoni Aug. 7, 2022, 4:12 p.m. UTC | #1
Hello Emile,

I have applied, with a few changes, see below.

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

> From: ecorm <ecorm@users.noreply.github.com>
> 
> Added missing python-autobahn subpackages required by python-crossbar.
> Signed-off-by: Emile Cormier <emile.cormier.jr@gmail.com>

Fixed up the From: and missing empty line, as usual.

> +if BR2_PACKAGE_PYTHON_AUTOBAHN
> +
> +config BR2_PACKAGE_PYTHON_AUTOBAHN_TWISTED
> +	bool "Twisted support"
> +	select BR2_PACKAGE_PYTHON_ATTRS # runtime
> +	select BR2_PACKAGE_PYTHON_TWISTED # runtime
> +	select BR2_PACKAGE_PYTHON_ZOPE_INTERFACE # runtime
> +
> +config BR2_PACKAGE_PYTHON_AUTOBAHN_ACCELERATE
> +	bool "C-based WebSocket acceleration"
> +	select BR2_PACKAGE_PYTHON_WSACCEL # runtime
> +
> +config BR2_PACKAGE_PYTHON_AUTOBAHN_COMPRESS
> +	bool "Non-standard WebSocket compression support"
> +	select BR2_PACKAGE_PYTHON_SNAPPY # runtime
> +
> +config BR2_PACKAGE_PYTHON_AUTOBAHN_SERIALIZATION
> +	bool "Accelerated JSON, MessagePack, CBOR, UBJSON, and FlatBuffers serialization support"
> +	select BR2_PACKAGE_PYTHON_CBOR # runtime

I do see the cbor2 dependency being expressed in setup.py, but not the
cbor dependency. Also, I only cbor2 being imported in the autobahn code
base, so I dropped this line. Of course, if there is something I
missed, let me know.

> +	select BR2_PACKAGE_PYTHON_CBOR2 # runtime
> +	select BR2_PACKAGE_PYTHON_FLATBUFFERS # runtime
> +	select BR2_PACKAGE_PYTHON_MSGPACK # runtime
> +	select BR2_PACKAGE_PYTHON_UBJSON # runtime
> +	select BR2_PACKAGE_PYTHON_UJSON # runtime
> +
> +config BR2_PACKAGE_PYTHON_AUTOBAHN_ENCRYPTION
> +	bool "TLS and WAMP-cryptosign encryption/authentication support"
> +	select BR2_PACKAGE_PYTHON_PYNACL # runtime
> +	select BR2_PACKAGE_PYTHON_PYOPENSSL # runtime
> +	select BR2_PACKAGE_PYTHON_PYQRCODE # runtime
> +	select BR2_PACKAGE_PYTHON_PYTRIE # runtime
> +	select BR2_PACKAGE_PYTHON_SERVICE_IDENTITY # runtime
> +
> +config BR2_PACKAGE_PYTHON_AUTOBAHN_SCRAM
> +	bool "WAMP-SCRAM authentication support"
> +	select BR2_PACKAGE_PYTHON_ARGON2_CFFI # runtime
> +	select BR2_PACKAGE_PYTHON_PASSLIB # runtime

The other thing I changed is to sort those sub-options alphabetically
by their option name.

Applied with those changes!

Thanks,

Thomas
Emile Cormier Aug. 7, 2022, 4:46 p.m. UTC | #2
On Sun, Aug 7, 2022 at 1:12 PM Thomas Petazzoni <
thomas.petazzoni@bootlin.com> wrote:

> I do see the cbor2 dependency being expressed in setup.py, but not the
> cbor dependency. Also, I only cbor2 being imported in the autobahn code
> base, so I dropped this line. Of course, if there is something I
> missed, let me know.
>

Are you sure you were checking in the 22.1.1  version of Autobahn?

The cbor dependency is here:
https://github.com/crossbario/autobahn-python/blob/dc626948d5ffbd741ec1e3a7906870eae1a4c69b/setup.py#L82

"import cbor" is used in both these places:
https://github.com/crossbario/autobahn-python/blob/dc626948d5ffbd741ec1e3a7906870eae1a4c69b/autobahn/wamp/message.py#L36
https://github.com/crossbario/autobahn-python/blob/dc626948d5ffbd741ec1e3a7906870eae1a4c69b/autobahn/wamp/serializer.py#L660
Thomas Petazzoni Aug. 7, 2022, 5:18 p.m. UTC | #3
Hello Emile,

On Sun, 7 Aug 2022 13:46:21 -0300
Emile Cormier <emile.cormier.jr@gmail.com> wrote:

> Are you sure you were checking in the 22.1.1  version of Autobahn?

No, I'm checking in version 22.6.1, because that's the one we have in
Buildroot now.

> The cbor dependency is here:
> https://github.com/crossbario/autobahn-python/blob/dc626948d5ffbd741ec1e3a7906870eae1a4c69b/setup.py#L82
> 
> "import cbor" is used in both these places:
> https://github.com/crossbario/autobahn-python/blob/dc626948d5ffbd741ec1e3a7906870eae1a4c69b/autobahn/wamp/message.py#L36
> https://github.com/crossbario/autobahn-python/blob/dc626948d5ffbd741ec1e3a7906870eae1a4c69b/autobahn/wamp/serializer.py#L660

Looking at 22.6.1, I think cbor is really no longer used:

$ git grep "import.*cbor.*"
autobahn/wamp/message.py:    import cbor2
autobahn/wamp/serializer.py:    import cbor2
autobahn/xbr/_buyer.py:import cbor2
autobahn/xbr/_cli.py:import cbor2
autobahn/xbr/_seller.py:import cbor2
autobahn/xbr/templates/py-autobahn/test_obj.py.jinja2:import cbor2

Am I missing something?

Thanks!

Thomas
Emile Cormier Aug. 7, 2022, 5:37 p.m. UTC | #4
On Sun, Aug 7, 2022 at 2:18 PM Thomas Petazzoni <
thomas.petazzoni@bootlin.com> wrote:

> > Are you sure you were checking in the 22.1.1  version of Autobahn?
>
> No, I'm checking in version 22.6.1, because that's the one we have in
> Buildroot now.
>

Oh I see. My patch request was for the Autobahn v22.1.1 that was included
in Buildroot at the time. If the Autobahn version was bumped up to 22.6.1
then you'll have to recheck all the dependencies if you haven't already.

If you're planning on bumping Crossbar to the latest, be warned that you'll
end up in dependency hell as it introduces a bunch of new dependencies for
the XBR and crypto features. Crossbar performs checks at runtime to bracket
the versions of these dependencies and you may have to patch some of the
dependency version ranges (or patch the runtime version checks).
Thomas Petazzoni Aug. 8, 2022, 8:43 p.m. UTC | #5
Hello Emile,

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

> +config BR2_PACKAGE_PYTHON_AUTOBAHN_ENCRYPTION
> +	bool "TLS and WAMP-cryptosign encryption/authentication support"
> +	select BR2_PACKAGE_PYTHON_PYNACL # runtime
> +	select BR2_PACKAGE_PYTHON_PYOPENSSL # runtime
> +	select BR2_PACKAGE_PYTHON_PYQRCODE # runtime

Turned out this line was not correct! Crossbar indeed uses pyqrcode,
but autobahn uses qrcode, which is a different Python module.

So I packaged qrcode:

  https://git.buildroot.org/buildroot/commit/?id=37f05c2497a05c9d007ed03c224f4a4d18a21b21

And then fixed autobahn to use it:

  https://git.buildroot.org/buildroot/commit/?id=6826595759d1978633008479d305abb8a894d442

Thanks!

Thomas
Thomas Petazzoni Aug. 9, 2022, 8:15 a.m. UTC | #6
Hello Emile,

On Sun, 7 Aug 2022 14:37:59 -0300
Emile Cormier <emile.cormier.jr@gmail.com> wrote:

> Oh I see. My patch request was for the Autobahn v22.1.1 that was included
> in Buildroot at the time. If the Autobahn version was bumped up to 22.6.1
> then you'll have to recheck all the dependencies if you haven't already.
> 
> If you're planning on bumping Crossbar to the latest, be warned that you'll
> end up in dependency hell as it introduces a bunch of new dependencies for
> the XBR and crypto features. Crossbar performs checks at runtime to bracket
> the versions of these dependencies and you may have to patch some of the
> dependency version ranges (or patch the runtime version checks).

At this point, I do not intend to bump Crossbar. I'll leave that to
people who are interested in this :-)

Best regards,

Thomas
diff mbox series

Patch

diff --git a/package/python-autobahn/Config.in b/package/python-autobahn/Config.in
index 627bcd73e5..20b1779b95 100644
--- a/package/python-autobahn/Config.in
+++ b/package/python-autobahn/Config.in
@@ -10,3 +10,43 @@  config BR2_PACKAGE_PYTHON_AUTOBAHN
 	  framework.
 
 	  https://pypi.python.org/pypi/autobahn
+
+if BR2_PACKAGE_PYTHON_AUTOBAHN
+
+config BR2_PACKAGE_PYTHON_AUTOBAHN_TWISTED
+	bool "Twisted support"
+	select BR2_PACKAGE_PYTHON_ATTRS # runtime
+	select BR2_PACKAGE_PYTHON_TWISTED # runtime
+	select BR2_PACKAGE_PYTHON_ZOPE_INTERFACE # runtime
+
+config BR2_PACKAGE_PYTHON_AUTOBAHN_ACCELERATE
+	bool "C-based WebSocket acceleration"
+	select BR2_PACKAGE_PYTHON_WSACCEL # runtime
+
+config BR2_PACKAGE_PYTHON_AUTOBAHN_COMPRESS
+	bool "Non-standard WebSocket compression support"
+	select BR2_PACKAGE_PYTHON_SNAPPY # runtime
+
+config BR2_PACKAGE_PYTHON_AUTOBAHN_SERIALIZATION
+	bool "Accelerated JSON, MessagePack, CBOR, UBJSON, and FlatBuffers serialization support"
+	select BR2_PACKAGE_PYTHON_CBOR # runtime
+	select BR2_PACKAGE_PYTHON_CBOR2 # runtime
+	select BR2_PACKAGE_PYTHON_FLATBUFFERS # runtime
+	select BR2_PACKAGE_PYTHON_MSGPACK # runtime
+	select BR2_PACKAGE_PYTHON_UBJSON # runtime
+	select BR2_PACKAGE_PYTHON_UJSON # runtime
+
+config BR2_PACKAGE_PYTHON_AUTOBAHN_ENCRYPTION
+	bool "TLS and WAMP-cryptosign encryption/authentication support"
+	select BR2_PACKAGE_PYTHON_PYNACL # runtime
+	select BR2_PACKAGE_PYTHON_PYOPENSSL # runtime
+	select BR2_PACKAGE_PYTHON_PYQRCODE # runtime
+	select BR2_PACKAGE_PYTHON_PYTRIE # runtime
+	select BR2_PACKAGE_PYTHON_SERVICE_IDENTITY # runtime
+
+config BR2_PACKAGE_PYTHON_AUTOBAHN_SCRAM
+	bool "WAMP-SCRAM authentication support"
+	select BR2_PACKAGE_PYTHON_ARGON2_CFFI # runtime
+	select BR2_PACKAGE_PYTHON_PASSLIB # runtime
+
+endif