Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial D-Bus XML support #88

Merged
merged 14 commits into from
Aug 17, 2023
Merged

Initial D-Bus XML support #88

merged 14 commits into from
Aug 17, 2023

Conversation

gunnarx
Copy link
Collaborator

@gunnarx gunnarx commented Aug 15, 2023

This adds a generator for D-Bus, represented by its canonical interface description format, which is also known as the D-Bus XML introspection format.

It also adds a helper program to generate C++ server/client stubs and proxies from the resulting D-Bus XML from the sdbus_cpp project. It is in this repository represented by minimal scripts to git-clone and build the program locally and in a container.

(It has been tested, but there is no built in CI test yet that generates XML, and then applies the C++ code generator, but that may come later)

A few other things snuck in and are necessary since the new program depends on them. Apart from minor documentation etc, take note of these:

  • Introduce Interface in the core IDL
  • ifex_ast: Allow enumerations to have any type.

Gunnar Andersson added 4 commits August 15, 2023 15:25
Signed-off-by: Gunnar Andersson <gunnar_dev@[email protected]>
Signed-off-by: Gunnar Andersson <gunnar_dev@[email protected]>
In the documentation the built-in types are called fundamental
so the detailed descriptions should do the same.

A "primitive" type can be considered int/float/string/boolean
but also a few others like set and map are "built-in" into IFEX, i.e.
they are also fundamental.

(Non-fundamental types are enumerations, typedefs and structs.)

Signed-off-by: Gunnar Andersson <gunnar_dev@[email protected]>
While most usage of enumerations will be backed by an integer type,
there is no real reason to disallow other types.
For example, enumerations where each value is a string-constant.
From now on the limitation is described as the backing type must
resolve to a primitive type (e.g. it can't be a Struct, or array).

This is a big change to the specification but since it is "growing"
the set of possibilities it might be considered backwards compatible.
(MINOR)

The field that has "typing.Any" type annotation is now skipped over in
the document generation (ifex_ast_doc.py) since it does not refer to
any AST class. While doing that there was some small refactoring to
simplify the logic also.

Signed-off-by: Gunnar Andersson <gunnar_dev@[email protected]>
Gunnar Andersson and others added 10 commits August 15, 2023 15:40
This feature has really been in theory included for a long time
but it wasn't actually introduced in the files yet.

Signed-off-by: Gunnar Andersson <gunnar_dev@[email protected]>
Signed-off-by: Gunnar Andersson <gunnar_dev@[email protected]>
Previous attempt to derive from Namespace, with modification was
not working as well.

Signed-off-by: Gunnar Andersson <gunnar_dev@[email protected]>
Signed-off-by: Gunnar Andersson <gunnar_dev@[email protected]>
Signed-off-by: Gunnar Andersson <gunnar_dev@[email protected]>
This is to prepare for a minimal user-callable wrapper located
under scripts, to follow the same pattern as for ifexgen.

Signed-off-by: Gunnar Andersson <gunnar_dev@[email protected]>
l. ifexgen_dbus is a frontend / executable command, defined in the
package information (setup.py) and which calls the actual code.  I just
followed the same pattern as for ifexgen.

2. Rename D-Bus (correct spelling) to DBus (wrong spelling)
   because...python reasons :(

Signed-off-by: Gunnar Andersson <gunnar_dev@[email protected]>
Signed-off-by: Gunnar Andersson <gunnar_dev@[email protected]>
Signed-off-by: Gunnar Andersson <gunnar_dev@[email protected]>
Signed-off-by: Gunnar Andersson <gunnar_dev@[email protected]>
@gunnarx gunnarx merged commit 6593efe into COVESA:master Aug 17, 2023
3 checks passed
@gunnarx
Copy link
Collaborator Author

gunnarx commented Aug 20, 2023

This PR was missing some template files. A a thing to learn is that it was not noticed in CI because it "successfully" produced output, but incomplete because of empty templates. Unit tests that compare the output to some expected output would have caught it, but those aren't built out yet for D-Bus.

The required files are by now included on the master branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant