3e71ab90 | 27-May-2020 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++: fix setup.py for template file change
Commit I9002f850c315c6e97a871e15f70f333f0608a2ad changed the paths to the sdbus++ Mako templates, but missed updating the setup.py file. Adjust the set
sdbus++: fix setup.py for template file change
Commit I9002f850c315c6e97a871e15f70f333f0608a2ad changed the paths to the sdbus++ Mako templates, but missed updating the setup.py file. Adjust the setup.py files as appropriate.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I0f43158522930b6b2b677e11ed794516de92f342
show more ...
|
5621624f | 21-May-2020 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++: rename template mako files
meson automatically generates a 'ninja clang-format' target since we have a .clang-format, but this attempts to reformat any file which ends with .cpp or .hpp. W
sdbus++: rename template mako files
meson automatically generates a 'ninja clang-format' target since we have a .clang-format, but this attempts to reformat any file which ends with .cpp or .hpp. We previously named our mako files as foo.mako.cpp, which was picked up by this target. Rename them as foo.cpp.mako instead to avoid hitting this meson target.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I9002f850c315c6e97a871e15f70f333f0608a2ad
show more ...
|
ad145e09 | 19-May-2020 |
Patrick Williams <patrick@stwcx.xyz> |
meson: feature match autotools support
Add support to build the example and test directories, which will get us feature match with the current autotools-based build.
Signed-off-by: Patrick Williams
meson: feature match autotools support
Add support to build the example and test directories, which will get us feature match with the current autotools-based build.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ib0789b6a715be366601eb639fd70ca3da9536a66
show more ...
|
185d2791 | 19-May-2020 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++: create script to generate all files from a dir
Meson doesn't handle generating code in the style that sdbus++ has, so we're going to need a script of some part as a helper. Create a script
sdbus++: create script to generate all files from a dir
Meson doesn't handle generating code in the style that sdbus++ has, so we're going to need a script of some part as a helper. Create a script that can generate all sdbus++ parts by looking at a directory for YAML files.
phosphor-dbus-interfaces has similar scripts already that generate autotools makefiles[1] and gnome has scripts like this to workaround meson limitations[2]. Having sdbusplus provide this will hopefully reduce duplication for other repositories.
1. https://github.com/openbmc/phosphor-dbus-interfaces/blob/5fd7574b59acfce023b892a995e0c87b13c5ab4c/generate_makefile.sh 2. https://github.com/gtkd-developers/GlibD/blob/b09fb1411378b98c3c035038863c5def6a4a0774/meson.build#L32
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ifd3cc04a10937c06dc20fe3d447a54e6f45b672a
show more ...
|
78b7803b | 20-May-2020 |
Patrick Williams <patrick@stwcx.xyz> |
clean up more pedantic compile warnings
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I84790e29a24c73a65c9770c6836b482386cc0ab7 |
f934ca30 | 15-May-2020 |
Patrick Williams <patrick@stwcx.xyz> |
build: add setuptools install script
Add a new setuptools install script which will allow us to eliminate the autotools-based python install in some environments, such as Yocto. This will reduce the
build: add setuptools install script
Add a new setuptools install script which will allow us to eliminate the autotools-based python install in some environments, such as Yocto. This will reduce the recipe complexity and allow future work towards meson-based build.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I23af49db2ba2245a5a44cfa5bc50a4734e7ca89c
show more ...
|
50981164 | 15-May-2020 |
Patrick Williams <patrick@stwcx.xyz> |
build: move python setuptools for future non-autotools
The current setup.py.in is an autotools-generated setuptools-like install script. When building the python-only module, we don't need the comp
build: move python setuptools for future non-autotools
The current setup.py.in is an autotools-generated setuptools-like install script. When building the python-only module, we don't need the complexity of autotools, but the well-supported python install behavior is for a script named 'setup.py'. In order to facilitiate creating a native setuptools setup.py, move the autotools one to a different name. This allows both to live in parallel for a bit.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I496a7891451649a06f6761f082195330a53cb967
show more ...
|
6805284b | 15-May-2020 |
Patrick Williams <patrick@stwcx.xyz> |
remove usage of WANT_TRANSACTION option
The feature to disable transactions is not used anywhere in openbmc and it is just making the build system more complicated than necessary.
Will follow up wi
remove usage of WANT_TRANSACTION option
The feature to disable transactions is not used anywhere in openbmc and it is just making the build system more complicated than necessary.
Will follow up with removing entirely from configure.ac after the recipe is updated with this change so that we do not have any co-req with the recipe updates.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I2d5f11b72f47abef5c6b1277b97ca448d88d3765
show more ...
|
18ce803d | 31-Jan-2020 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++: switch to python3
Python2 is DEAD! Long live Python3!
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ifd46a4aeb41fb0e6db2f4310a603b727a5a2c2ff |
ddc0eba2 | 13-Feb-2020 |
Lei YU <mine260309@gmail.com> |
sdbus++: Generate initial client header
By "client-header" option, sdbus++ could generate a client header file that provides the code used by the client.
Currently it only includes the interface na
sdbus++: Generate initial client header
By "client-header" option, sdbus++ could generate a client header file that provides the code used by the client.
Currently it only includes the interface name's string in the header file, it could be extended in the future.
The client header could be merged together for all the interfaces, so that an interface library could provide a single header to represent all the interface strings.
Usage:
sdbus++ -r $(srcdir) -t $(top_builddir)/tools/sdbusplus/templates \ interface client-header <interface>
Tested: Generate the header in example and use static_assert to verify it is the same as the interface defined in the interface calss.
Signed-off-by: Lei YU <mine260309@gmail.com> Change-Id: Idafc4724efa88a2dfd37e3f7735732c45171fd88
show more ...
|
7eb0d25f | 13-Mar-2020 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++: refactor enum handling for container-types
Previously an attempt was made to support container types holding an enumeration, like 'struct[int, enum[self.Foo]]', but this code was not fully
sdbus++: refactor enum handling for container-types
Previously an attempt was made to support container types holding an enumeration, like 'struct[int, enum[self.Foo]]', but this code was not fully functional. There are some generated functions that occur outside of the class that defines the enum, so the fully qualified namespace is required. Previously, only the enum name was given, resulting in compile errors.
Refactor the enumeration type handling by inserting C++-like placeholders into the early-parsed type name and then replace those placeholders, as appropriate, when it is determined if we need a fully-qualified or locally-qualified type.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Iddfcf99299a1ad4770f614431474d388cb6d9088
show more ...
|
67c79b0c | 19-Feb-2020 |
Waqar Hameed <waqarh@axis.com> |
sdbus++: Use list comprehension when parsing property types
This is more consistent with code-style (c.f. the other branch in the same if-statement). This was suggested by 2to3-tool.
Signed-off-by:
sdbus++: Use list comprehension when parsing property types
This is more consistent with code-style (c.f. the other branch in the same if-statement). This was suggested by 2to3-tool.
Signed-off-by: Waqar Hameed <waqarh@axis.com> Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I32c1bcf2e12712e2f9695ae6d1c891061f27ee0e
show more ...
|
7c5faabe | 31-Jan-2020 |
Patrick Williams <patrick@stwcx.xyz> |
build: remove interface.mako autoconf gen
The content in interface.mako.server.cpp.in that required autoconf to generate was moved to property.mako.prototype.hpp.in with ee6ac694c3e21b24ebd2f32ef552
build: remove interface.mako autoconf gen
The content in interface.mako.server.cpp.in that required autoconf to generate was moved to property.mako.prototype.hpp.in with ee6ac694c3e21b24ebd2f32ef55249c5eb44bccd but never removed from the autoconf generated list. Move it back to a not-.in file.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I463126db072994f395fb5fa21f4ca8ffdb9c09f0
show more ...
|
f7e2159d | 24-Jan-2020 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++: use native enums for message operations
Support was added in earlier commits for handing enums as native types in message::read and message::append operations. Fix up all the generated tem
sdbus++: use native enums for message operations
Support was added in earlier commits for handing enums as native types in message::read and message::append operations. Fix up all the generated templates to use this support.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I9f002d6f9fd681abfd0a22a757d5e99fa775c715
show more ...
|
25207042 | 28-Jan-2020 |
Patrick Williams <patrick@stwcx.xyz> |
sdbusplus: message: append: add native enum support
Add support for appending enums directly into a sdbusplus message and generate the required helper functions in the interface server templates.
sdbusplus: message: append: add native enum support
Add support for appending enums directly into a sdbusplus message and generate the required helper functions in the interface server templates.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ib142482de90572e1bda2f3658f6aeec201c043de
show more ...
|
978f77d8 | 28-Jan-2020 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++: interface: refactor enum-to-string conversion
Move the enum-to-string conversion functions as static members inside the interface class, just like the string-to-enum conversion.
Signed-off
sdbus++: interface: refactor enum-to-string conversion
Move the enum-to-string conversion functions as static members inside the interface class, just like the string-to-enum conversion.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I4efe4f8c26fb4047de4e5a7487ea301d8b43be10
show more ...
|
06d43b83 | 28-Jan-2020 |
Patrick Williams <patrick@stwcx.xyz> |
sdbusplus: message: read: add native enum support
Add support for reading enums directly out of a sdbusplus message and generate the required helper functions in the interface server templates.
Sig
sdbusplus: message: read: add native enum support
Add support for reading enums directly out of a sdbusplus message and generate the required helper functions in the interface server templates.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I2c89614edb5981d984660efe06cc4380cb526d9e
show more ...
|
a163b177 | 24-Jan-2020 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++: property: simplify local enum handling
Local enums are prepended with "self." in the YAML files, which was propagated through some of the internal handling, such as cppTypeName. Eliminate
sdbus++: property: simplify local enum handling
Local enums are prepended with "self." in the YAML files, which was propagated through some of the internal handling, such as cppTypeName. Eliminate this so that cppTypeName is a real type for local enums.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I14424532a0bb392f050ce43d1b98996f94da5cd5
show more ...
|
18b29bab | 24-Jan-2020 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++: property: simplify enum handling
The property cppTypeName use to not be a real C++ type for enums and was instead a funny 'enum<Name>' type. Simplify the enum handling so that it becomes a
sdbus++: property: simplify enum handling
The property cppTypeName use to not be a real C++ type for enums and was instead a funny 'enum<Name>' type. Simplify the enum handling so that it becomes an almost real type.
For local types there is still a funny 'self.' prepended.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I25a0f15aa3dbbfc505b433a5757946521b2ffa72
show more ...
|
e57c38e9 | 20-Sep-2019 |
Lei YU <mine260309@gmail.com> |
Emit adding/removing interfaces for object server
The object server currently either creats the objects and interfaces, or defer the signal by not adding objects.
In practice, we have situations th
Emit adding/removing interfaces for object server
The object server currently either creats the objects and interfaces, or defer the signal by not adding objects.
In practice, we have situations that the code would like to add interfaces to an existing object, and it's not supported, or needs tricky code to workaround. Exmaples: https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-bmc-code-mgmt/+/5820 https://gerrit.openbmc-project.xyz/c/openbmc/openpower-pnor-code-mgmt/+/5346
This commit adds the support by: 1. Adding emit_added() in interface.hpp and the generated server.hpp 2. Adding a enum class in object's constructor to indicate which action to do, to create the object, or adding the interface, or defer signal as before.
So the user of object<> could pass `action::emit_interface_added` to the constructor to tell the object server *only* emit interface added to DBus, without emitting object added. The previous code stays the same behavior: * If `true` is passed in object's constructor, it defers emitting object added signal; * If no extra parameter is passed in object's constructor, it emits object added signal as before.
Tested: 1. Make sure the openbmc builds fine with https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-logging/+/25089 because phosphor-logging uses its own server.hpp for interface, the above patch removes that. 2. Manually write a small service to verify the interfaces are added and removed by using the `emit_interface_added` action. 3. Added the unit test cases for object.hpp to check the ctor/dtor with different actions.
Signed-off-by: Lei YU <mine260309@gmail.com> Change-Id: I178c5bed3c9ff39ee2ac8d143fbe9131b0753dfa
show more ...
|
5e001779 | 24-Jan-2020 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++: interface: fix indent of enum-string fn
The convert<enum>FromString functions were indented incorrectly relative to the rest of the class.
Signed-off-by: Patrick Williams <patrick@stwcx.xy
sdbus++: interface: fix indent of enum-string fn
The convert<enum>FromString functions were indented incorrectly relative to the rest of the class.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Iabe9d30c33c8707bf2bf4c6a697e3d27d0a3000b
show more ...
|
14db20f0 | 03-Feb-2020 |
Lei YU <mine260309@gmail.com> |
Make interface string public
The interface string was private, and the users of sdbusplus have to define their own strings for the D-Bus interfaces. By making the interface string public, users do n
Make interface string public
The interface string was private, and the users of sdbusplus have to define their own strings for the D-Bus interfaces. By making the interface string public, users do not have to define their own and the generated string could be used instead.
E.g. one could directly use "Calculator::interface" instead of "net.poettering.Calculator" in the example.
Signed-off-by: Lei YU <mine260309@gmail.com> Change-Id: I0846d4e0609c8588d81e8a19bdd69fd79df83848
show more ...
|
66ef099b | 17-May-2019 |
William A. Kennington III <wak@google.com> |
sdbus++: Fix construction of objects with flags
Objects don't take kwargs for their constructors so don't call the object constructor with kwargs
``` | Traceback (most recent call last): | File "
sdbus++: Fix construction of objects with flags
Objects don't take kwargs for their constructors so don't call the object constructor with kwargs
``` | Traceback (most recent call last): | File "/home/spirit/src/vesnin/openbmc-alternate/build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-dbus-interfaces/1.0-r1/recipe-sysroot-native/usr/bin/sdbus++", line 50, in <module> | main() | File "/home/spirit/src/vesnin/openbmc-alternate/build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-dbus-interfaces/1.0-r1/recipe-sysroot-native/usr/bin/sdbus++", line 45, in main | instance = valid_types[args.typeName].load(args.item, args.rootdir) | File "/home/spirit/src/vesnin/openbmc-alternate/build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-dbus-interfaces/1.0-r1/recipe-sysroot-native/usr/lib/python2.7/site-packages/sdbusplus/interface.py", line 21, in load | return Interface(**y) | File "/home/spirit/src/vesnin/openbmc-alternate/build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-dbus-interfaces/1.0-r1/recipe-sysroot-native/usr/lib/python2.7/site-packages/sdbusplus/interface.py", line 25, in __init__ | [Property(**p) for p in kwargs.pop('properties', [])] | File "/home/spirit/src/vesnin/openbmc-alternate/build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-dbus-interfaces/1.0-r1/recipe-sysroot-native/usr/lib/python2.7/site-packages/sdbusplus/property.py", line 12, in __init__ | super(Property, self).__init__(**kwargs) | File "/home/spirit/src/vesnin/openbmc-alternate/build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-dbus-interfaces/1.0-r1/recipe-sysroot-native/usr/lib/python2.7/site-packages/sdbusplus/namedelement.py", line 8, in __init__ | super(NamedElement, self).__init__(**kwargs) | File "/home/spirit/src/vesnin/openbmc-alternate/build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-dbus-interfaces/1.0-r1/recipe-sysroot-native/usr/lib/python2.7/site-packages/sdbusplus/renderer.py", line 3, in __init__ | super(Renderer, self).__init__(**kwargs) | TypeError: object.__init__() takes no parameters ```
Fixes openbmc/sdbusplus#30
Tested: Ran with some locally modified properties marked as const. Verified that the generated code marks those as const and removes their setter
Change-Id: I94965add8588a8a3168662e00ef2502276440ee5 Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
4274c117 | 26-Nov-2018 |
William A. Kennington III <wak@google.com> |
std::variant: Remove uses of the variant_ns
Now that we are using std::variant we should reference it directly instead of using our own namespace alias.
Tested: Built and ran through unit tests
std::variant: Remove uses of the variant_ns
Now that we are using std::variant we should reference it directly instead of using our own namespace alias.
Tested: Built and ran through unit tests.
Change-Id: Ic3fd62ea74cf808b85ad7b7ffcce8c0a0bfb125d Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
8515eae7 | 03-Apr-2019 |
William A. Kennington III <wak@google.com> |
sdbus++: Generate includes for enum references
It is common for enums to be shared across different dbus definitions. This change adds the functionality to automatically generate the correct include
sdbus++: Generate includes for enum references
It is common for enums to be shared across different dbus definitions. This change adds the functionality to automatically generate the correct includes for the server.hpp files.
Change-Id: Ic5b8df55b58479d18dd4aee20ead9c05b867b968 Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|