Summary
Since the py-ubjson → bjdata migration (#1849), autobahn's optional
"ubjson" serializer is backed by bjdata. bjdata (0.6.6) ships sdist only
and builds its _bjdata C extension against NumPy 1.x via the deprecated
oldest-supported-numpy. Imported under NumPy 2.x (now the default), NumPy
prints a multi-line diagnostic to stderr:
A module that was compiled using NumPy 1.x cannot be run in NumPy 2.4.x ...
from _bjdata import dump, dumpb, load, loadb
AttributeError: _ARRAY_API not found
import bjdata still succeeds and UBJSON (de)serialization of normal WAMP
payloads works — only bjdata's unused NumPy-NDArray path is affected — but the
notice is alarming and shows up in any app that imports
autobahn.wamp.serializer with bjdata installed (e.g. crossbar version).
Root cause / where the real fix lives
This is a bjdata packaging bug (it should build against numpy>=2.0, which
is dual-compatible, and ship wheels). Filed upstream: NeuroJSON/pybj#7
NeuroJSON/pybj (see also the existing NeuroJSON/pybj#6, which is a different
topic).
What autobahn could do (options, none urgent)
- Document the caveat for the
serialization/all extras (UBJSON backend
is CPython-only and currently emits a NumPy-2 notice until bjdata is fixed).
- Pin
bjdata to the first release that builds against NumPy 2.x, once
available.
- Nothing in code — autobahn cannot fix bjdata's build; this is mainly a
tracking note so the ecosystem is aware.
Downstream note
crossbar has added a short-term, narrowly-scoped stderr filter for this
specific benign notice in its CLI entry point, to be removed once bjdata ships a
NumPy 2.x build. (crossbar issue: see the crossbar tracker.)
Related: #1849.
Checklist
Summary
Since the
py-ubjson→bjdatamigration (#1849),autobahn's optional"ubjson" serializer is backed by
bjdata.bjdata(0.6.6) ships sdist onlyand builds its
_bjdataC extension against NumPy 1.x via the deprecatedoldest-supported-numpy. Imported under NumPy 2.x (now the default), NumPyprints a multi-line diagnostic to stderr:
import bjdatastill succeeds and UBJSON (de)serialization of normal WAMPpayloads works — only bjdata's unused NumPy-NDArray path is affected — but the
notice is alarming and shows up in any app that imports
autobahn.wamp.serializerwithbjdatainstalled (e.g.crossbar version).Root cause / where the real fix lives
This is a bjdata packaging bug (it should build against
numpy>=2.0, whichis dual-compatible, and ship wheels). Filed upstream: NeuroJSON/pybj#7
NeuroJSON/pybj (see also the existing NeuroJSON/pybj#6, which is a different
topic).
What autobahn could do (options, none urgent)
serialization/allextras (UBJSON backendis CPython-only and currently emits a NumPy-2 notice until bjdata is fixed).
bjdatato the first release that builds against NumPy 2.x, onceavailable.
tracking note so the ecosystem is aware.
Downstream note
crossbarhas added a short-term, narrowly-scoped stderr filter for thisspecific benign notice in its CLI entry point, to be removed once bjdata ships a
NumPy 2.x build. (crossbar issue: see the crossbar tracker.)
Related: #1849.
Checklist