handling interpreters in *-snapper scripts (or snapcraft)

Zygmunt Krynicki zygmunt.krynicki at canonical.com
Mon Jun 15 12:03:25 UTC 2015


One of the problems with virtualenv/pex today is that they poorly
handle .so files that some interesting python modules depend on.

As an example, to get lxml (pip installable) working you need to
bundle a few extra libraries that are _not_ handled by anything on the
python side (no tool automates this). I build a smap with plainbox
manually by using rpath to show each of the .so files that python
loads where to load remaining libraries from. It would be very
beneficial if LD_LIBRARY_PATH was defined by snappy launcher so that
rpath is not required.

On Mon, Jun 15, 2015 at 2:00 PM, Alexander Sack <asac at canonical.com> wrote:
> Oliver,
>
> if you use virtualenv check out the --relocate option.
>
> That one adjusts the shebangs afaik. Not 100% sure what to best set it
> to.... maybe #!/usr/bin/env python and then make snappy hook into that
> env to adjust the PATH to look at right place inside the snap that
> gets launched?
>
>
> On Mon, Jun 15, 2015 at 1:55 PM, Rick Spencer
> <rick.spencer at canonical.com> wrote:
>>
>>
>> On Mon, Jun 15, 2015 at 7:39 AM, Oliver Grawert <ogra at ubuntu.com> wrote:
>>>
>>> hi,
>>>
>>> i'm currently trying to set up something similar to node-snapper for
>>> python snaps ... i.e. "py-snapper".
>>>
>>> the problem i am hitting my head against now is how to handle these
>>> hardcoded interpreter lines without requiring the user to manually
>>> re-write them when producing a snap (or have error prone code in the
>>> *-snapper script to mangle them with a prefix or some such)
>>>
>>
>> How does one manage porting a Python app to different platforms today?
>> Surely /bin/... is not functional on Macs and Windows?
>>
>> I'm wondering how bad it really is to ask snappers to change the shebang
>> line to something sensible?
>>
>> Cheers, Rick
>>
>> --
>> snappy-devel mailing list
>> snappy-devel at lists.ubuntu.com
>> Modify settings or unsubscribe at:
>> https://lists.ubuntu.com/mailman/listinfo/snappy-devel
>>
>
> --
> snappy-devel mailing list
> snappy-devel at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/snappy-devel



More information about the snappy-devel mailing list