Replies: 17 comments
-
Thank you for writing! Always good to hear when someone starts using Elektra 💖 May I ask you where you intend to use Elektra?
🚀
Very nice to hear 🎆
This is more @darddan and @mpranj's domain. We have spec files (e.g. #2519) which worked across different versions and our CI system also uses Fedora. I am not sure if our CI produces (S)RPMs, though.
Yes, this is very well maintained by @haraldg.
I do not know. @darddan can you look into BuildRoot?
The INI plugin is a bit quirky. @bauhaus93 develops a TOML plugin #3292 which is superior in many ways and will replace the INI plugin for most use-cases. @bauhaus93 can you maybe answer the question? Does the TOML plugin makes this quoting/structure shown above as wanted? |
Beta Was this translation helpful? Give feedback.
-
@poldi871 @markus2330 I created the following script for checking. Command output is annotated with
|
Beta Was this translation helpful? Give feedback.
-
Hello, thanks for the quick and good answers!
Poldi Addendum: ################################################################################ libelektra################################################################################ LIBELEKTRA_VERSION = 0.9.2 LIBELEKTRA_SUPPORTS_IN_SOURCE_BUILD = NO |
Beta Was this translation helpful? Give feedback.
-
Thank you so much for your interest and for sharing your BuildRoot recipe with us.
Unfortunately we don't have any official ones now, but they are planned. We do offer current DEBs and packages for macOS (via homebrew).
I also agree. If your scenario allows it, wait for us to publish the TOML plugin, which is superior and almost ready. If your project timeline does not allow it, then use what is available. If you have any further questions, feedback and bugreports (or even success stories) we are happy to hear from you. |
Beta Was this translation helpful? Give feedback.
-
I downloaded the git master branch of today. The build shows the plugins in- and excluded. "toml" is mentioned nowhere. "On stupid" I included "toml" in "-DPLUGINS" -> no chance ;-) ... beg your pardon, I still did not rtfm completely up to now -> should do it, but at the moment it is too exciting to experiment with libelekta ;-)) |
Beta Was this translation helpful? Give feedback.
-
You can not test it yet comfortably, because it is not released and not even merged into master. The development branch can be seen in #3292, but we do not recommend basing any other work on top of development branches. |
Beta Was this translation helpful? Give feedback.
-
I checked out "bauhaus93, libelektra-66cbf47" and found the toml plugin there ;-)
Example-File:
root@Vd:~/.config# kdb ls user/example/Services
` And now the file looks like:
` Next beginner' problem - export to xml:
The command was: "kdb export user xmltool >example.xml" The resulting file was:
--> CDATA's are empty. Background: By the way:
But within the example itself the following is used:
-> my be a typo, because trying that form leads to an error message (no such plugin).
Thanks for your patience! Poldi |
Beta Was this translation helpful? Give feedback.
-
I agree that this would be a nice-to-have for TOML as the files otherwise easily get hard-to-read.
Thank you for pointing this out. This is not a good example, as xmltool is only legacy (to import Elektra 0.7 configs). Tip: With
It should use the xerces plugin (see also below in that man page), maybe you did not include it, as it needs the xerces XML parser. See https://www.libelektra.org/plugins/xerces
This should be easily doable. Can you sponsor development to speed things up? |
Beta Was this translation helpful? Give feedback.
-
Thanks, will try it tomorrow. Hope that xerces is buildable in BuildRoot.
Unfortunately not. As I already mentioned, I'm a "one man band". I'm spending my time on my own risk at the moment and this will continue until the result of my evaluation will end in a positive decision. And the risk for me is not only spending my time, but also get an unjustifiable delay in my own project. Even in the positive case I have to prepare a realizable proposal to convince the customer. From the view of the customer, this will be only a very little part of the project and I think he will not even pay for (yes, I'm a technician, not a sales man). I see my part in helping to make the project a little better known by trying to integrate libelektra into my application because i am convinced of this approach. And hand on heart, after all the resources that are already in this project, there are still problems with ini files in the officially available release? I think the reality is, that most evaluators would have stopped evaluation at that point. And I'm still a long way from the end of my tests... |
Beta Was this translation helpful? Give feedback.
-
💖
Can you also write here what your goals and requirements are? Maybe we can tell you if and how much implementation effort will be needed and what we might be able to do.
🚀
Yes, this was also very surprising for me that this is such a hard problem. In the beginning we were hoping that there would already be some library that would simply read&write configuration files and to integrate this library to Elektra. But we did not find such a library, they always fail in either:
The INI plugin was the first attempt to solve all three requirements but it became so complex that it is unmaintainable now. That is why @bauhaus93 wrote the TOML plugin using better parser technology.
We have quite a lot of customers in the embedded systems world (e.g. Broadcom, Toshiba, Kapsch, ...), as in embedded systems human-editable configuration files are usually not a big topic. There are plenty of plugins in Elektra that reliably serialize and deserialize any KeySet with whatsoever weird configurations, e.g. |
Beta Was this translation helpful? Give feedback.
-
Background: Back to your question:
I agree concerning the processing of ini files. Last week I studied a lot of competitors, even whole distributions and all have their problems.
Nice to hear that (customers) |
Beta Was this translation helpful? Give feedback.
-
We spent quite some time into DBUS integration https://www.libelektra.org/plugins/dbus and are currently improving it for KDE&GNOME elektrifikation.
Such CM tasks are very well supported by Elektra, you can use Elektra for both parsing the XML and for changing the system configuration. Basically you would need to implement something similar to
Yes, Elektra could help in both situations: for the non-elektrified applications you would mount their configuration files. If you can you are better of by patching them. Usually elektrifying applications is not so hard because often there is some internal API which you can reimplement using Elektra. If you try to change these APIs, however, things get very time-consuming, e.g. lcdproc/lcdproc#146 by @kodebach 🚀
Good to hear that our efforts for human-read/writeable config files are appreciated 💖 |
Beta Was this translation helpful? Give feedback.
-
Thanks for the hints. |
Beta Was this translation helpful? Give feedback.
-
After a few day and night shifts, here are more experiences of a beginner ;-) "#include_next" problem:
Not very elegant either, but now the build was successfull. Now, at runtime I've got:
That was a problem for me (language settings and copying gconv libs from the toolchain). Now, basic "kdb" commands were successfull, but now I couldn't load an ini file with the "toml" plugin. I made a lot of "build from scratch" (BfS) removing every change step by step until "toml" worked again. I didn't investigate further, because I noticed issues that I hadn't noticed before. But I wasn't sure if I just overlooked it or if there were still hidden bugs in my build (multiple entries for the plugins).
To get rid of any sideeffects of my own build I decided to setup two virtual machines with OpenWrt, because these versions should be very well maintained according to marcus2330. Finally, I still wanted to familiarize myself with the xerces plugin ;-)) To make another long story short this problem is also existing in the OpenWrt versions:
Getting more info about such plugins leads to:
I don't know if it is not allowed to call up info about such a plugin, but the plugin names appear in the output of "kdb plugin-list". ... still trying to explore the xerces plugin with a primitive "ini" file, because "toml" is not available: Both version's output:
Finally, not even "kdb --version" seems to work on the snapshot version:
I admit that I'm getting a little tired now. I am still fascinated and convinced by the idea, but I now think I understand why libelektra has not become a standard tool until now. |
Beta Was this translation helpful? Give feedback.
-
First of all: You can ask questions much earlier, you do not need to try every possibility before asking a question 😉 Second: While embedded systems are an important target for Elektra, it is very unusual (or you are the first?) who tries to develop, or even learn Elektra on an embedded system. I recommend you to install Elektra on a desktop distribution (or use docker) and to experiment/develop there. E.g.
Did you install the package which contains the spec plugin? See above, better to use some desktop distribution where it is much easier to get a clean installation (but also easier to get a messed-up installation 😉) and where you can run all tests to verify which parts of the installation work as intended (
I think the version number 0.9.2 indicates quite well where we currently are, we are at about 92% for the ability of applications to use Elektra. So there are definitely some areas and situations, where development or at least bug fixes are needed before you can be 100% satisfied 🥇 So better ask here first before you make elaborate testing of things where it is quite clear for us that this part is not there yet. |
Beta Was this translation helpful? Give feedback.
-
I talked with @mpranj and it is not a good idea to use the xerces plugin for your use case (sending/receiving XML documents). It is better if you do the XML processing and construction of the KeySet directly in your application. The problem is that xerces does not do escaping in the meta-data but the comments need escaping (your requirement was that you want to send comments in the XML document). Elektra would then only be used for what it is designed to be: to get/set local configuration. |
Beta Was this translation helpful? Give feedback.
-
Thanks very much for the info. Today and eventually tomorrow I have to make a break in matters "libelektra". Then I will reconsider the situation. |
Beta Was this translation helpful? Give feedback.
-
Hello,
I am evaluating libelektra for an embedded system under BuildRoot. And as noted in the FAQ of libelektra "ask before you search too long", I'll do that now ;-)
In advance, after reading a lot (but not yet all) of the documentation and viewed the youtube videos, it seems to be a great work, even a kind of a developer's dream, if it will work for me.
Here are my problems / questions:
My evaluation system is a Leap-15.2. Unfortunately there are only versions of 0.8.20 out there. I've searched for SRPM's of newer versions, because I would not use an old version for my system. I have some "hen egg problem" here. On the one hand my build under BuildRoot was successful at the first look, but at runtime there are still problems (warnings C01200), so the build recipe will need some more efforts. On the other hand I don't want to invest too much, in case it turns out that libelektra is not suitable after all. I've also looked through "libelektra4 aus Projekt home:bekun:devel", but there are also only old versions. Is there any RPM or SRPM for the 0.9.2 version?
By the way BuildRoot:
I found a recipe for OpenWrt. Does a recipe exist for BuildRoot already?
On a first simple test, I have an entry in a mounted "ini"-file like this:
Parameter = "[10,20]; [11,35]"
Reading the value with "kdb get" results in: [10,20]; [11,35]
Writing that value back to the configuration file results in: [10,20]; [11,35] (without the quotes)
It is not possible to quote this entry with \" or "". If I do a double quoting, double quotes are written:
kdb set /users/Parameter ""[10,20]; [11,35]""
writes: Parameter = ""[10,20]; [11,35]"" to the file.
On a second test I was not able to process structured "ini"-files.
Example:
[Services]
[Services:html]
port = 80
[Services:ssh]
port = 22
On a "kdb ls /user/example" I get:
...
/user/example/Services/[Services:html]
but I don't get the "port" key.
If I do a "kdb get /user/example/Services/[Services:html]" I get a "duplicated key entry in INI file"
What's wrong?
Thanks in advance.
Poldi
Beta Was this translation helpful? Give feedback.
All reactions