Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upWrite plugin in rust #3308
Comments
This comment has been minimized.
This comment has been minimized.
Great job, looks nice! But this might not be enough, you also need some ways to set error/warnings, access the handle, ... Maybe @PhilippGackstatter knows more about that. I think we should focus on making the PR for kconfig now. |
This comment has been minimized.
This comment has been minimized.
I'm working on the |
This comment has been minimized.
This comment has been minimized.
Very good idea to do this in the meantime |
This comment has been minimized.
This comment has been minimized.
Seems like a good idea to me, to use a macro for generating a plugin. The Rust bindings are only for the low-level API and do not touch the Plugins in any way, that's why there's no As I haven't looked at the plugin API yet, I can't give much guidance at the moment, but if you want any help feel free to ask.
(Slightly Off-topic) |
This comment has been minimized.
This comment has been minimized.
You could use some subversion number like If we have some problem that blocks KDE/LCDproc/GSettings progress, @mpranj might also decide to release earlier. But the subversions for bindings will not harm anyway, as it gives you flexibility to fix little things. |
This comment has been minimized.
This comment has been minimized.
That would be ideal. But crates use semver and according to that Then |
This comment has been minimized.
This comment has been minimized.
Ahh, ok, seems like Docker, Debian and semver handle this differently. Then any other char ~ for which 0.9.1 < 0.9.1~1, I am sure you will find one. I would not do the pre-releases as long as we did not update Elektra's version. It would be confusing if you get from |
This comment has been minimized.
This comment has been minimized.
Semver only allows I agree that Unfortunately I believe the only options are pre-releases and clearly stating the compatible version at the top of the readme, or detaching the version from Elektra's entirely. |
This comment has been minimized.
This comment has been minimized.
There is a difference between ordering and precedence. Somehow a tool needs to decide which version to pick if several versions (only differing in the build number) are available. So ordering somehow needs to be defined. I would say if the Cargo implementation does the correct thing (0.9.1 < 0.9.1+1 < 0.9.1+2 ordering), we should simply use the build number for fixes in docu. At least the semver implementation seems to not ignore the build number (for Cargo I did not check): See also: The only problem with this "abuse" of build number is that someone who already has 0.9.1+1 installed will not get 0.9.1+2. But this should not matter for fixing docu.
But for making something public (or also fixing a bug) it makes a difference, as this is a change relevant to semantic versioning precedence. People might want the upgrade even if they already have 0.9.1. So here the build number stops working.
I now started a PR with an proposal how to solve it: #3319 It basically says that you can go out of sync with Elektra's patch version. But this is maybe not the best idea as long as we are in the
Yes. If someone needs the KeySet::from_ptr releasing Elektra 0.9.2 just for that makes sense. Releases only take a lot of time if there are huge changes (and release notes). But this is of course to @mpranj to decide. Maybe kconfig, gsettings or LCDproc also need some little patch and there is some synergy? |
This comment has been minimized.
This comment has been minimized.
I agree that having the versions in sync makes the compatibility intuitively obvious, but I would leave the decision up to the maintainer of the binding.
I don't have anything against doing releases more often than our somewhat-quarterly release cycle. For me it would depend on the changes. Currently we don't have so much in the changelog that another release makes sense to me. Maybe we could schedule it in ~two weeks if needed. That would give us some time to work on more things for the release. If there is a real need to do 0.9.2 immediately, ping me and we can release it earlier. |
I've looked at the rust bindings and trying to write a storage plugin. If I'm not overlooking something there's two things stopping me from building it. There's no types for the
Plugin
class and thefrom_ptr
function in KeySet (elektra
) is private.I've copied
elektra-sys
toelektra-plugin-sys
, changed thewrapper.h
to contain only#include "kdbplugin.h"
and changed lines 22 and 23 inbuild.rs
to:With those I was able to create a macro which would generate the needed functions for a plugin (handling the unsafe
elektra-plugin-sys
code). By using that macro, creating a storage plugin in rust can look like this:Would this be of use?