Skip to main content
Version: Dev (main)

Compatibility

Your app and QAROS update on their own schedules. An app built against one QAROS release, whether it calls the C API directly or uses the C#, Rust or Unity packages, meets whatever runtime the PC has installed, older or newer. QAROS is built so that this always works:

Your app was built againstThe installed runtime isWhat happens
An older headerA newer runtimeWorks. Every function of your header is still there with the same signature.
A newer headerAn older runtimeWorks. Every function the older runtime has works. A function it does not have returns QAR_STATUS_NOT_IMPLEMENTED.
The same releaseThe same releaseWorks.

The rules QAROS keeps​

  • Functions are only appended. No function is renamed, and no signature changes. A function that is retired keeps loading and returns an error that says so; it is deprecated for at least one minor release first, and the changelog says so.
  • A function appended after a release is optional. On a runtime that predates it, the loader leaves it out instead of failing, and calling it returns QAR_STATUS_NOT_IMPLEMENTED.
  • A struct never grows under its structure type. New fields come in a new extension struct with its own QAR_STRUCTURE_TYPE_* value (API Conventions).
  • Data is compatible too. From QAROS 0.10.0 every QAROS build talks to every other QAROS build, older and newer, and reads every file another build wrote: hubs, players, the Visualizer and your app's runtime can be updated one at a time. Fields are only ever added, and a value a newer build sends is read by an older one with what it knows. This holds until a release is declared breaking in the changelog.

What your app does​

  • Load the installed runtime. Call qar_library_load(NULL) (or let the binding do it) and never ship qar-streaming-c.dll beside your app: the hub refuses a runtime that is not its own installation's, and a bundled copy wins the lookup (Getting Started).

  • Detect features by calling them. Call the function and handle QAR_STATUS_NOT_IMPLEMENTED: hide the feature, or tell the user which QAROS release adds it.

    QarResult r = qar_session_open_qaros_view(session, &info);
    if (qar_result_has_code(r, QAR_STATUS_NOT_IMPLEMENTED)) {
    show_message("Opening a QAROS view needs a newer QAROS. Update QAROS to use it.");
    } else if (qar_result_is_error(r)) {
    qar_result_log_if_error(r);
    }
  • Use the runtime version for logs only. qar_runtime_info reports the loaded runtime's version, flavor and C API generation. Write it to your log and into messages for the user. Never compare it for equality and never pick functions by it.

  • A chained extension struct is the one exception. An older runtime skips an extension struct it does not know, silently, so it cannot answer QAR_STATUS_NOT_IMPLEMENTED. Where the header says a feature comes as an extension struct, check that the runtime's numeric major.minor.patch is at least the release whose changelog adds it. Never compare the pre-release suffix (-rc.N, or the commit count of a build between releases, -34+1a2b3c4d).

Common mistakes​

MistakeWhat goes wrongDo instead
Pinning the header hash (refusing a runtime whose qar_streaming.h differs from the one you built with)Your app stops working at every QAROS update, even a fix releaseCall functions and handle QAR_STATUS_NOT_IMPLEMENTED
Comparing the full version string, or the rc / dev suffixA release candidate, a fix release or a development build is refused although everything worksLog the version; check features by calling them
Requiring the runtime to equal the version you built withUsers must update your app and QAROS togetherNothing: any header works with any runtime
Bundling qar-streaming-c.dll with your appThe hub refuses it; it also hides the user's installed QAROSLoad the installed runtime with qar_library_load(NULL)
Treating an optional function as required (aborting, or failing your own start, when it returns QAR_STATUS_NOT_IMPLEMENTED)Your app cannot run on an older QAROS at allFall back, hide the feature, or name the QAROS release that adds it

Language bindings​

  • C: as above. With QAR_ENABLE_DYNAMIC_LOADING, functions are loaded by name into tables your app owns; optional ones may stay empty and return QAR_STATUS_NOT_IMPLEMENTED.
  • C# and Rust: the bindings wrap the same functions, and the same status surfaces as their status code type. The Rust binding currently loads every function of the header it was generated from and needs a runtime that has them all (Getting Started).
  • Unity: the packages use the C# binding and carry no native runtime; the Editor and every player load the runtime of the QAROS installed on the PC, so the same promise holds. Update the packages when you want new features, not to keep a build working (Unity).