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

implement basic plugin system #202

Closed
wants to merge 2 commits into from
Closed

Conversation

ignatenkobrain
Copy link
Contributor

Signed-off-by: Igor Gnatenko ignatenko@redhat.com

@cgwalters
Copy link
Collaborator

What's the use case for this? This seems like it's going to make the control flow more confusing if all of a sudden we're calling both Python -> C and C -> Python. Are there use cases that can't be covered by e.g. gobject signals?

And what specific plugins are we talking about? Could those be baked in as e.g. compile time options?

I'm a bit uncertain about pulling in libpeas in particular - basically the project's goal can't really be achieved, because you can only have one GC'd language per process, so you have C/Vala/Rust and at most one of Python/JS/golang etc.

@ignatenkobrain
Copy link
Contributor Author

@cgwalters one of main plugins will be subscription manager (which will be entirely in C). Yes, any of plugins can be backed by compile-time options.

My goal was mainly to achieve plugin system for C and Python.

@kalev
Copy link
Collaborator

kalev commented Oct 14, 2016

Would it not be easier to have subscription manager support as a compile time option instead?

@ignatenkobrain
Copy link
Contributor Author

@kalev that was only example, but basically we want all plugins (which we have in dnf) to become part of the libdnf (e.g. needs_restarting/tracer, snapper, etc.)

@ignatenkobrain ignatenkobrain force-pushed the wip/ignatenko/plugins branch 2 times, most recently from 035f1c0 to 8c5d3a4 Compare November 7, 2016 08:17
@ignatenkobrain ignatenkobrain changed the title [WIP] implement basic plugin system implement basic plugin system + Subscription Manager plugin Nov 7, 2016
@ignatenkobrain
Copy link
Contributor Author

retest this please

@ignatenkobrain ignatenkobrain force-pushed the wip/ignatenko/plugins branch 7 times, most recently from 6c9a0ba to 650e0b1 Compare November 11, 2016 02:15
@ignatenkobrain ignatenkobrain changed the title implement basic plugin system + Subscription Manager plugin implement basic plugin system Nov 18, 2016
@ignatenkobrain
Copy link
Contributor Author

@j-mracek, any ideas why testcase fails?

g_autoptr(PeasEngine) engine = peas_engine_get_default ();

/* Enable Python 3 plugins */
peas_engine_enable_loader (engine, "python3");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this is exactly what I don't want for rpm-ostree. Why can't python plugins stay as dnf plugins?

@j-mracek
Copy link
Member

test this please

@cgwalters
Copy link
Collaborator

Another reason not to have plugins right now is that the API is far from stable. So my vote is still to bake in subscription-manager as a compile time option, and conditionally evaluate the set of dnf plugins for migration into C. Some other ones like tracer honestly should most likely stay as dnf plugins, given that I doubt we're going to use them for PackageKit or rpm-ostree.

@jsilhan
Copy link
Contributor

jsilhan commented Dec 7, 2016

We don't say libdnf plugin API is stable now. It will be formed together with the rest of API.

The high level vision is to have most parts from DNF in libdnf. DNF would be just Python wrapper around libdnf with DNF CLI input/output handling. In best case the libdnf plugin API should be close to current DNF API. All plugins would be handled in lindnf core. Plugins extending DNF output like tracer could have set special demand so it would run in dnf, tdnf and microdnf only. Does that make sense?

For example, this way even SWDB could be implemented just as a plugin...

Igor Gnatenko added 2 commits December 9, 2016 12:30
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
@Conan-Kudo
Copy link
Member

For example, this way even SWDB could be implemented just as a plugin...

I think that would be a dangerous mistake, unless you'd like to support both the dnf yumdb and swdb.

@cgwalters
Copy link
Collaborator

I'd be more OK with doing this initially if the plugin system itself is a build time option. Then I could just disable it for rpm-ostree.

@dnf-bot
Copy link
Member

dnf-bot commented Jan 5, 2017

☔ The latest upstream changes (presumably 632545b) made this pull request unmergeable. Please resolve the merge conflicts.

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.

None yet

7 participants