handling interpreters in *-snapper scripts (or snapcraft)

Michael Hudson-Doyle michael.hudson at canonical.com
Mon Jun 15 21:58:29 UTC 2015


On 16 June 2015 at 00:57, Didier Roche <didrocks at ubuntu.com> wrote:
> Le 15/06/2015 14:54, Oliver Grawert a écrit :
>>
>> hi,
>>
>> Am Montag, den 15.06.2015, 08:47 -0400 schrieb Michael Terry:
>>>
>>> Why not instead of a runtime solution, you just have py-snapper go
>>> through and adjust all shebangs right before creating the snap?
>>> -mt
>>
>> this was my fallback idea ... but also the ugliest of all solutions (and
>> possibly error prone)
>
>
> That would solve, 90%+ of the existing issues, I agree. If we only focus on
> those, that makes sense.
>
> However, I can clearly see some apps doing some kind of:
> subprocess.call(["/usr/bin/python", "foo"])
> Should we care of those use cases? That's the real question I guess…

Such things wouldn't work well with virtualenv, so I don't think that
it would be a common pattern (better use sys.executable instead).

In general, even if virtualenv is overkill for this, the fact that it
exists and is commonly used in the Python ecosystem means that most
things do in fact work with non-standard interpreter paths. (There is
certainly code in setuptools or distutils or something to rewrite
shebang lines).

Cheers,
mwh



More information about the snappy-devel mailing list