It would be useful to have a tool, that would do all the mechanical checks of protocol backward-compatibility when XML files get updated. One possible way to implement it would be as follows:
Add a new output mode to wayland-scanner, that produces distilled details of protocol ABI on the wire, including things like opcodes for messages, argument signatures, and 'since' versioning. You would generate this output for the XML before and after a change, and then use a new tool to verify all the changes are backward-compatible.
Or, maybe the tool could process XML directly, but that probably duplicates things from wayland-scanner. It is uncertain which approach is better in the end, or should it perhaps be even built into wayland-scanner itself.
Examples of things that break backward-compatibility:
- changing opcodes (changing the order in which requests and events are listed)
- changing interface, request and event names
- adding, removing or changing arguments to existing messages
- changing enum values
- removing enum names/values
- removing interfaces, requests or events
This tool could also verify, that interface versions get bumped properly, and that correct 'since' attributes are used.
Obviously this tool cannot check for semantical changes, and we want to allow improving documentation without being flagged as a break, so it would need to completely ignore all documentation elements.
While writing this tooling and making it detect each of the listed error types, also write tests that provoke those particular errors, so we are certain it will keep on working in the future.