Re: Installing DBus interface files for services

On Tue, 03.02.15 18:29, Cosimo Cecchi (cosimoc gnome org) wrote:

On Mon, Feb 2, 2015 at 3:22 AM, Lennart Poettering <mztabzr 0pointer de>

Oh no, that's not what I meant. I was more proposing to pull them
once, while you develop your stuff, and then shipping them in your own
tarball. So, don't pull them dynamically when you start building, but
you keep your own copy of the XML bits of other APIs, frozen and
stable in time in your own project.

That's what some modules are doing today already, but I don't think it
really addresses my use case.
I would like to be able to easily build client code that interacts with a
DBus service on the system without manually hunting for that interface from
the service's git repository, ideally with a nice autotool integration like
Philip proposed at the beginning of this thread.

Well, don't hunt it down from some git repo, just pull it ouf some
running daemon you are testing against. 

So it seems that if we were to do that we're saying:
- services should install one of those files for each interface
- such files should have the same name as the interface and not contain
other nodes

Well, are you sure the gdbus tools can even read introspection files
right now that do not start with <node> but with <interface>?

- tooling would verify that the above two are true?
- it wouldn't be a great idea to use this for clients that ends up exposing
the generated code through a public API

Lennart, you also mentioned about cross-build problems, but I'm not really
sure what those would be with this proposal - could you expand on that?

Well, in sd-bus you define your bus interfaces in a C struct, with
some syntactic sugar made of macros. The XML stuff is something you
never see, it's generated at runtime from these structs. If you wanted
to store the XML stuff on disk you'd thus have to run the program, and
oull it out from there. But people who cross-build generally don't
like it if they have to run the stuff they just built to complete the
build process, because that usually requires the build and the target
arch to be the same...

Also note that sd-bus' XML introspection data is very reduced, it
contains no parameter names or anything. In sd-bus we actually try to
hide the fact that XML is used for this as much as we can, developers
don't come into contact with it if at all possible...

I figure it all boils down to the difference in philosophy: in gdbus
the XML introspection data is the source of evertyhing and the C code
built from that. In sd-bus the C code is the source of everything and
the XML introspection data generated from that. 


Lennart Poettering, Red Hat

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]