Skip to content

Conversation

@fperrad
Copy link
Contributor

@fperrad fperrad commented Dec 31, 2023

dbus and dbus-broker are linked with expat (XML parsing C library).

LuaExpat is available since long time with the Debian package lua-expat.

So, xml_fromfile and xml_fromstr could be refactored in plain Lua.

By this way, the native part of lsdbus is focused on sd-bus binding.

@kmarkus
Copy link
Owner

kmarkus commented Jan 2, 2024

Thank you. The issue with this is that we're use this module on small embedded systems that has libmxml (and libexpat) available but not the lua-expat bindings. So I'd much prefer to keep the built-in serialization support to avoid another dependency. I wouldn't mind switching to libexpat instead of libmxml however.

@fperrad
Copy link
Contributor Author

fperrad commented Jan 2, 2024

I see your point.
I also target embedded Linux.
I use Buildroot which comes with a LuaExpat package (see https://git.busybox.net/buildroot/tree/package/luaexpat/luaexpat.mk).

@kmarkus
Copy link
Owner

kmarkus commented Oct 27, 2024

One possibility to support both options would be to add a CMAKE option DISABLE_MXML. If enabled, mxml is not required and checked for and the respective functions are ifdef'ed out. In init.lua, we can test if xml_fromstr and xml_fromfile are defined and if not we try to load and assign the LuaExpat based implementation (preferrably from it's own module).

@fperrad
Copy link
Contributor Author

fperrad commented Oct 27, 2024

The idea to support both via conditional compilation sounds good.

But I prefer a option named WITH_MXML or ENABLE_MXML, this avoids double negation (and headache) in the logic.

Go ahead please, because I really master not CMAKE.

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.

2 participants