Compatibility#

The SDK talks to an application package’s shared library through a C application binary interface (ABI). The Python package and the C binding are both clients of that ABI, and an application package is an implementation of it. This page states which combinations load, and what you have to update when one side changes.

The ABI version#

Every application package reports its ABI version as a 32-bit integer:

Bits

Field

Changes when

16-31

Major

The ABI changes incompatibly: a function or type is changed or removed.

0-15

Minor

Functions are added. Existing functions and types stay as they were.

The current ABI is version 6.0. The SDK carries the version it was built for: ABR_ABI_MAJOR and ABR_ABI_MINOR in the C header abr_sdk_macros.h, and the Python changelog names the ABI each release requires.

What is checked at load time#

Creating an AsrAsr or TtsTts loads the package’s shared library and reads its ABI version. A major version other than the one the Python package was built for raises abr_sdk.exceptions.AbrSdkError with both versions in the message. The Python package then resolves every ABI function it calls; a function the library lacks also raises AbrSdkError.

abr_lib_openabr_lib_open loads the shared library and reads its ABI version. A major version other than ABR_ABI_MAJOR fails with ABR_ERR_INCOMPATIBLE_LIBRARY, logging “Incompatible ABI versions”. The binding then resolves every function in abr_lib_t; a function the library lacks fails the same way, logging the symbol it could not resolve. A successful abr_lib_open means every function pointer in the struct is set.

The binding does not treat any ABI function as optional. If you build the binding’s .c files into your own program, that is the behaviour you get: nothing needs probing before it is called.

The minor version is not checked. A package with a higher minor version than the SDK adds functions the SDK does not call, so it loads and works. A package with a lower minor version loads as long as it has every function the SDK calls, which it does unless the SDK was updated to call a function added after the package was built. In practice: keep packages at least as new as the SDK, and newer packages always work.

What to update#

Release

Application packages

Python package or C binding

Your program

New package date, same ABI

Replace the package

Nothing

Nothing

Minor ABI bump

Nothing required

Update to call the new functions

Recompile against the updated C headers

Major ABI bump

Download new packages

Update

Recompile; adapt to any changed types or calls

A major bump is a coordinated release: packages, the Python package, and the C binding move together, and the old and new sets do not mix. The release notes name the ABI version, so compare it with the one your SDK was built for before upgrading one side on its own.

Version numbers#

The C binding’s version starts with the ABI major version it loads, for example 6.0.261106: a binding whose version starts with 6 loads any package with ABI major version 6. Application package versions describe the neural network instead; see Application packages.

Next steps