How to handle references to broken DevInt / DEV_INT type in cppTango 10.x
Compilation against latest cppTango fails due to the removal of the DEV_INT
type. It isn't an official Tango type, as per the RFC. PyTango exposed this constant as the CmdArgType.DevInt
type, which could also be specified as a string like dtype="DevInt"
. However, it isn't that useful since it is not properly implemented in cppTango.
In PyTango, if an attribute is created with @attribute(dtype=CmdArgType.DevInt)
, the Tango device cannot be started we get an error like:
PyTango.DevFailed: DevFailed[
DevError[
desc = Attribute : my_int: Data type is not supported
origin = void Tango::Attr::check_type() at (/Users/runner/miniforge3/conda-bld/cpptango_1687345480050/work/cppapi/server/attrdesc.cpp:208)
reason = API_AttrWrongDefined
severity = ERR]
]
If a command is created using @command(dtype_in=CmdArgType.DevInt)
, the device can start, but the command handler will receive a None
value instead of the integer value passed to the command. Similarly, with @command(dtype_out=CmdArgType.DevInt)
, the returned integer doesn't reach the client - they get a None
value instead.
One way it could work was as spectrum in a command, like @command(dtype_in=(CmdArgType.DevInt,))
. In this case, PyTango implements the spectrum type using CmdArgType.DevVarLongArray
.
If we remove CmdArgType.DevInt
from PyTango, that breaks compatibility. User code may be using CmdArgType.DevInt
, even if they didn't do anything special with it. E.g., https://gitlab.com/ska-telescope/ska-tango-base/-/blob/0.15.1/src/ska_tango_base/utils.py?ref_type=tags#L44.
Options:
- remove
CmdArgType.DevInt
from PyTango, in next minor release, 9.4.3? - remove
CmdArgType.DevInt
from PyTango, in next major release, 10.0? - keep
CmdArgType.DevInt
, but make it an alias toCmdArgType.DevLong64
? (This make some previously broken code work...)