Products › lamco-dbus-tools › Docs
D-Bus interface drift rules: What counts as a breaking change
D-Bus interface drift rules: Which changes between two versions of a service's interface are breaking, for new clients only, or information, DRIFT-001 to 012.
Describes version 0.4.1. The source of truth is src/interface/drift.rs.
dbustell drift <old> <new> compares two descriptions of a service's interfaces and puts every
difference in one of three classes:
| Class | Means |
|---|---|
| Breaking | A client written for the old description can fail against the new |
| New clients only | Old clients are unaffected; a client written for the new description can fail against an old service |
| Information | Nothing on the wire changes |
It exits 1 when any change is breaking.
Where the rules come from
One interface-compatibility checker's comparator, at its commit of 2024-02-05, is the one published set of rules for a D-Bus interface break, and these follow it, with two changes and one addition:
- A property that stops emitting
PropertiesChanged(EmitsChangedSignaltrueorinvalidatestofalseorconst) is breaking here: A client waiting for a change never hears of one. That checker's code reports it as forwards-incompatible only, against its own table, which marks it as harming old clients. - A property that starts emitting it (
falsetotrueorinvalidates) is for new clients only here: An old client couldn't rely on the signal and asks again, which still works. That checker's code reports it as backwards-incompatible. Two oflogin1's properties changed so between systemd 257 and 262. - An object that's gone is breaking, with
--objects: A pair of XML files can't show it, two live trees can.
The rules
| Change | Finding | Class |
|---|---|---|
| An interface removed | DRIFT-001 |
Breaking |
| A method removed | DRIFT-002 |
Breaking |
| A signal removed | DRIFT-003 |
Breaking |
| A property removed | DRIFT-004 |
Breaking |
| A method's in or out arguments, or a signal's, added, removed, retyped or moved between in and out | DRIFT-005 |
Breaking |
| A property's type changed | DRIFT-006 |
Breaking |
A property's access changed, except from read or write to readwrite |
DRIFT-007 |
Breaking |
org.freedesktop.DBus.Method.NoReply added or removed |
DRIFT-008 |
Breaking |
EmitsChangedSignal: To false or const from true or invalidates; true to invalidates and back; const to anything else |
DRIFT-009 |
Breaking |
An object gone, with --objects |
DRIFT-010 |
Breaking |
An interface, method, signal, property or object added; access widened to readwrite; EmitsChangedSignal from false to true, invalidates or const |
DRIFT-011 |
New clients only |
An argument renamed, where both sides name it; org.freedesktop.DBus.Deprecated set or cleared; org.freedesktop.DBus.GLib.CSymbol changed |
DRIFT-012 |
Information |
A property's EmitsChangedSignal is its own annotation, or its interface's, or true, as the D-Bus
specification gives the default.
What's compared
- Interfaces by name. An interface is a type, the same wherever it's implemented; its first object's
definition is the one compared. The four standard interfaces every library adds
(
org.freedesktop.DBus.Introspectable,Peer,Properties,ObjectManager) are left out. - Arguments by type, in order, in each direction. A name on one side only isn't a rename: Names are
optional, and a library fills one in where a file leaves it out, as GLib's
arg_1. - Objects, with
--objects, and only between two captures ofdbussee introspect: Objects such aslogin1's sessions differ from machine to machine, so two machines' trees differ without any change to the interface.
What it can't see
It can't see a change in behavior with an unchanged signature, an interface a service adds at run time after it was introspected, or a well-known name that moves.