snapping a python2 application that uses a makefile

Leo Arias leo.arias at canonical.com
Tue Oct 4 19:54:49 UTC 2016


Hello Michael,

On Wed, Sep 28, 2016 at 5:42 PM, Michael Foley <michael.foley at canonical.com>
wrote:
>
> I've started working on a few snaps last month and worked out how to
> build an initial snap of the gpodder podcast client.  However in order
> to get it to build I had to do a few manual steps during the build
> step.  This is a python2 application, but actually uses a makefile.  I
> tried a few different tactics including trying to use the make plugin,
> but that does not create the command wrapper properly.
>

That seems to be a common approach for upstream projects. I've seen many go
projects directed by a Makefile that doesn't set the GOPATH, so it requires
to hack our plugin. IMO, that means that the makefile is incomplete, but we
will need to deal with it. So far, I've solved it by making custom plugins
that combine two of snapcraft's plugins. That's not so nice for various
reasons. Sometimes you only need to add a command to an existing plugin,
and yet you have to copy it all. In the previous sprint we talked a little
about adding hooks, and making the plugins easier to extend, but that will
be a heavy burden to support in snapcraft.


> And actually when I tried to rebuild my snap today the command wrapper
> is failing to find and exec gpodder.  I think the command wrapper is no
> longer setting the PYTHONPATH.  Has this changed in the python2 plugin.
> I see that is deprecated so tried the python plugin with
> "python-version: python2", but got the same result.
>

We changed the python plugins completely in one of the recent releases.
using python-version: python2 now is the same as using plugin: python2.


> A copy of my snapcraft.yaml file is here:
> http://pastebin.ubuntu.com/23248926/
>
> Any suggestions on ways to work around these issues?
>
> Can you inspect the prime directory to see if the binary is now in a
different place?

Running snapcraft on your yaml, I actually get: Missing file:
share/dbus-1/services/org.gpodder.service
Did you solve that somehow?

pura vida
<http://www.ubuntu.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/snapcraft/attachments/20161004/b2030d69/attachment.html>


More information about the Snapcraft mailing list