[Rpm-maint] [rpm] initial embedded python interpreter support (@rpm5.org derived) (#25)

Neal Gompa ngompa13 at gmail.com
Mon Nov 30 15:35:19 UTC 2015


On Mon, Nov 30, 2015 at 4:22 AM, Vít Ondruch <vondruch at redhat.com> wrote:
> Dne 28.11.2015 v 14:37 Neal Gompa napsal(a):
>
> On Thu, Nov 26, 2015 at 5:20 AM, Florian Festi <ffesti at redhat.com> wrote:
>>
>> On 11/19/2015 04:09 PM, Vít Ondruch wrote:
>> > What is the usecase for this? Isn't this just feature bloat?
>>
>> I kinda agree that this looks like feature bloat. This patch set needs a
>> very good justification to go in upstream. The overall trend is to
>> rather keep minimal installs smaller as this is a big issue for
>> containers and VMs. Python is one of the candidates to be thrown out at
>> some point.
>>
>> Also embedding a particular version of Python into rpm itself makes this
>> Python version part of the spec syntax with all kind of possibly ugly
>> implications.
>>
>> It also seems to not bring many benefits except from saving the
>> interpreter starting time (which can be significant if there are many
>> Python scriptlets). But the trend here is also to rather getting rid of
>> more of the scriptlets using the new file trigger feature (We'll see how
>> this works out).
>>
>> Having access to the transaction objects of the running rpm instance
>> could give such justification as it can hardly done in any other way.
>> But I really, really doubt that we wan to go down that route. Especially
>> as it gives a whole new way of how scriptlets can break a transaction.
>>
>> As the patch set is not interfering with many places in the rpm code it
>> should be not too hard to maintain the changes outside of the upstream
>> repository for distributions with (still) rely on this feature.
>>
>> Florian
>>
>
> So the main justification for the Python stuff is less about scriptlets and
> more about being able to have templates for spec files. In OpenMandriva, for
> instance, the distro-release package[0] includes a Python script that is
> used by the main spec file at build-time (not run-time!) to construct the
> complete spec customized for a particular distribution (as there's actually
> at least three different distributions hosted and built through
> OpenMandriva's ABF system). There's no really nice way to do this with the
> existing RPM feature set.
>
> The ways I've seen this done in the absence of this feature (and I have seen
> it attempted a few times before) are pretty terrible. It's usually a
> combination of macros, bconds, and a whole bunch of other crazy things to
> make it work, and it's an unmanageable mess.
>
>
> So what are the other ways? Could you share them with us?
>
> And why not use LUA?
>
> Vít

The other ways involved writing fairly complex macros, doing some
shell-scripting things, and using conditionals/bconds to switch around
values. It's generally quite messy and difficult to follow/maintain. I
don't know if I have an example of it anymore, as the other Mandriva
derivative (Mageia) greatly simplified theirs because they don't care
to support all of that. Since OpenMandriva is designed as a base to
build multiple distributions (ROSA Desktop, OpenMandriva Lx, etc.)
from, this particular requirement remains.

I do not know if it can be done with Lua in the same manner that it is
done in Python in OpenMandriva. Nothing I've read suggests it is
possible to import Lua scripts and use functions in those scripts
within the spec. I'm also not too familiar with Lua as a language,
either.



-- 
真実はいつも一つ!/ Always, there's only one truth!


More information about the Rpm-maint mailing list