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
plugins: introduce v2.PluginV2 and v2.NilPlugin #3022
Conversation
Rely less on setting from the plugin and remove duplicate attributes already held by Project and Project._snap_meta. This involved a general cleanup. Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
There's just enough scaffolding in place to allow for the plugin to load. PluginHandler has been extended to determine when a PluginV2 is being used (PluginHandler should be renamed to PartHandler). Some extra attribute were added to PluginV2 to minimize the changes required in PluginHandler. Old code handling state file migration in PluginHandler._do_build was removed as that was done before the migration to bases (meaning that no base using Snapcraft project needs this). Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
@cjp256 yeah, fixed them earlier, my push got stuck on my ssh keys... |
isinstance(self.plugin, plugins.v1.PluginV1) | ||
and self.plugin.out_of_source_build | ||
): | ||
if os.path.exists(self.part_build_dir): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so this will always happen with v2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose this is what we just discussed not doing and you were going to look into. I can remove the rm entirely and we can see what happens
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i thought we discussed the opposite. v2 would leave the build directory alone and incremental builds would work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exactly, but I did this before that conversation, that's all I am saying :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I say let's make the change now :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you want to change the v2 build clean... i'd suggest doing it now, but otherwise lgtm
isinstance(self.plugin, plugins.v1.PluginV1) | ||
and self.plugin.out_of_source_build | ||
): | ||
if os.path.exists(self.part_build_dir): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I say let's make the change now :)
There's just enough scaffolding in place to allow for the plugin to
load.
PluginHandler has been extended to determine when a PluginV2 is being
used (PluginHandler should be renamed to PartHandler).
Some extra attribute were added to PluginV2 to minimize the changes
required in PluginHandler.
Old code handling state file migration in PluginHandler._do_build was
removed as that was done before the migration to bases (meaning that
no base using Snapcraft project needs this).
Signed-off-by: Sergio Schvezov sergio.schvezov@canonical.com
./runtests.sh static
?./runtests.sh tests/unit
?