[Interest] Beginner DBUS Question: how to enforce the XML?
jhihn at gmx.com
Wed Jun 16 16:20:31 CEST 2021
> Sent: Tuesday, June 15, 2021 at 6:21 PM
> From: "Thiago Macieira" <thiago.macieira at intel.com>
> To: "interestqt-project.org" <interest at qt-project.org>
> Cc: "Jason H" <jhihn at gmx.com>
> Subject: Re: [Interest] Beginner DBUS Question: how to enforce the XML?
> On Tuesday, 15 June 2021 13:24:12 PDT Jason H wrote:
> > So I think the Qt docs and support on DBUS are quite good. But I keep coming
> > back to a non-Q- non-G DBUS question: When interfacing with C/CPP code
> > using libdbus or sdbus, which manually pack parameters to messages, how is
> > "proper" DBUS messaging enforced?
> There is no XML when messages are being exchanged. So there's nothing to be
> > Example:
> > I have a XML Definition for a service I publish, I use tools to generate the
> > wrappers for it. Someone using libdbus/sdbus consumes that service. I
> > update the XML (say add or remove a parameter), do my workflow, and now
> > their client is expecting the wrong parameters.
> > Reverse example:
> > I consume a DBUS service and they update their libdbus/sdbus code, they
> > don't have an XML, how do I identify it before it gets deployed?
> > I'm interested in some kind of build-time compilation process check. I'm
> > thinking:
> > 1. Force them to publish a XML.
> > 2. Generate a header from it
> > 3. Force them to have an implementation that consumes the header
> > 4. Rely on the compiler to error when the header doesn't match the
> > implementation.
> Ok, that makes sense.
Glad to hear it :-)
> > However there are two bug flaws with this:
> > 1. I'm forcing them to adhere to the development protocol (maybe a makefile
> > is sufficiently forceful?)
> > 2. I can't guarantee the functions are actually the ones used (a bigger
> > issue I know)
> If they aren't used, why do you care? It's the same as requiring everyone to
> use blue pens: if it's not part of something you see, why do you care?
Well it's more about not trusting the competence of the other side. Or,
alternatively, them not trusting a n00b (me). Perhaps I waxed too philosophical.
Yeah, it would be possible to use an alternative function, which should be
caught in code review, but I'm looking for something brain-dead simple
and preferably enforceable by the CI system.
It seems that I've got to invent some kind of Qt and C (no ++, libdbus/sdbus
legacy codebase) workflow that everyone can agree on. I was hoping that this
workflow already existed in the world.
More information about the Interest