Protocol backwards compatibility requirements?

Pekka Paalanen ppaalanen at gmail.com
Tue Apr 21 08:50:27 UTC 2020


On Tue, 21 Apr 2020 15:01:14 +1000
Peter Hutterer <peter.hutterer at who-t.net> wrote:

> On Mon, Apr 20, 2020 at 03:05:32PM +0300, Pekka Paalanen wrote:
> > On Thu, 16 Apr 2020 17:47:56 +1000
> > Christopher James Halse Rogers <chris at cooperteam.net> wrote:
> >   
> > > On Wed, Apr 15, 2020 at 14:27, Simon Ser <contact at emersion.fr> wrote:  
> > > > Hi,
> > > > 
> > > > On Monday, April 13, 2020 1:59 AM, Peter Hutterer 
> > > > <peter.hutterer at who-t.net> wrote:    
> > > >>  Hi all,
> > > >> 
> > > >>  This is request for comments on the exact requirements for protocol
> > > >>  backwards compatibility for clients binding to new versions of an 
> > > >> interface.
> > > >>  Reason for this are the high-resolution wheel scrolling patches:
> > > >>  https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/72
> > > >> 
> > > >>  Specifically, the question is: do we **change** protocol elements or
> > > >>  behaviour as the interface versions increase? A few random examples:    
> > > > 
> > > > What we can't do is:
> > > > 
> > > > - Change existing messages' signature
> > > > - Completely remove a message    
> > 
> > Indeed.

...

> > If you're asking if the implementation for version < N could be
> > deleted or avoided, then I'd say no. Definitely no for desktop
> > compositors, probably no for anything else public.  
> 
> The sub-interfaces are inseparable from the seats, that's set in stone. The
> question here is less about mixing versions within the seat but more
> about skipping versions without harm. Let's say wl_pointer version 9
> introduces wl_pointer.pressure, something independent of anything else
> else in the wl_pointer interface. Qt (iirc) never implemented axis_discrete
> handling but it let's say it wants support for pressure.
> 
> Guaranteed backwards compatibility means Qt can bump to version 9, implement
> noop functions for axis_source and axis_discrete and done. 
> 
> Allowing events to change between versions means that Qt now also needs to
> update its handling of whatever changed between those versions, e.g.
> wl_pointer.axis. A direct jump past versions you don't care about isn't
> possible.

I would say that the direct jump past versions is never possible. Like
you said, Qt still needs to implement the noop functions. If it
doesn't, it will crash when those events get sent. The fact that making
those new functions noop is ok is just a detail, an accident of design.
Qt must come with a valid implementation - what a valid and workable
implementation is, is just a detail.

> Also, having written the patches to change wl_pointer.axis_discrete to a 120
> base value there's another issue: no auto-generated FOO_SINCE_VERSION
> because this doesn't show up in the protocol itself. So this really flies
> under the radar and you just have to know about it by reading the
> documentation.

Was that one of the breaking changes already done in the past?

Sounds to me like it's just one more reason to not change existing
message semantics, and add new messages instead.

Maybe one possibility with e.g. wl_pointer, if you actually want to
shed the old cruft, is to create interface wl_pointer2 and add
get_pointer2 request to wl_seat. We will never be able to get rid of
the original wl_pointer interface or its implementations, but at least
it would be clearly separate.


Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20200421/95ea8ec6/attachment-0001.sig>


More information about the wayland-devel mailing list