HAP-python icon indicating copy to clipboard operation
HAP-python copied to clipboard

Is orjson supported on 32-bit Raspberian?

Open timchurches opened this issue 3 years ago • 7 comments

Even after installing rust, cargo etc, orjson fails to build on a freshly-installed 32-bit Raspberian OS on an RPi Zero W. The rustc compiler runs, but never finishes (at least not in under 24 hours, I gave up after that). V4.4.0 of HAP-python installs fine.

timchurches avatar Jul 11 '22 02:07 timchurches

It should build. There are wheels provided by orjson and wheels from wheels.home-assistant.io that might work as well

Sent from my iPhone

On Jul 10, 2022, at 10:18 PM, Tim Churches @.***> wrote:

 Even after installing rust, cargo etc, orjson fails to build on a freshly-installed 32-bit Raspberian OS on an RPi Zero W. The rustc compiler runs, but never finishes (at least not in under 24 hours, I gave up after that). V4.4.0 of HAP-python installs fine.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.

bdraco avatar Jul 11 '22 02:07 bdraco

According to this post orjson will not work with 32-bit python on a 32-bit linux OS: https://medium.com/geekculture/python-orjson-cb046b47ab8c

If that is true, it means the current version of HAP-python can't be deployed on Raspberry Pi 2 or Pi Zero W hardware, of which there are a lot still in use. It should work using 64-bit Raspberry Pi OS on Pi 3 or 4 or Pi Zero 2 (I'll test that when my Pi Zero 2 arrives).

timchurches avatar Jul 14 '22 03:07 timchurches

Would it be possible to substitute UltraJSON (json - see https://pypi.org/project/ujson/ ) for 32-bit deployment of HAP-python? ujson supports 32-bit builds, and although not as fast as orjson, it is still many, many times faster than the standard json in python, and faster than most other fast json libraries (with the exception of orjson).

timchurches avatar Jul 14 '22 03:07 timchurches

There did used to be a problem with 32bit but Home assistant has 1000+ of deployments with it on 32bit Linux so I think that link is outdated.

bdraco avatar Jul 14 '22 12:07 bdraco

orjson has been adding additional wheel builds lately, so they might accept a PR to add your arch to their build CI

https://github.com/ijl/orjson/commit/3de9685017cb8dcfb7b379d5a08d81473f7c1945

bdraco avatar Jul 14 '22 12:07 bdraco

32 bit support was added via https://github.com/ijl/orjson/issues/220

bdraco avatar Jul 14 '22 12:07 bdraco

There is an issue that might help you build wheels on github instead https://github.com/ijl/orjson/issues/278

bdraco avatar Jul 20 '22 20:07 bdraco