Proposal: expanding scriptlets

Thanks for the input, @jamesh. It sounds like the root pre-pack scriptlet won’t really solve your issue very well then, huh? The per-part lifecycle architecture is such that they happen essentially in complete isolation from the other parts (save for the after keyword, which just controls order). The only way for us to support something like pre-pack for parts is to re-architect the lifecycle to add another step between priming and packing, which is a significant enough effort that we can’t fit it in right now.

With that in mind, I think we should probably shelve the root pre-pack property. It was relatively easy to add onto the general expansion of scriptlets, but it doesn’t solve the problem it was intended to solve. Instead, a solution that is imperfect but workable once the rest of this proposal is in place is to do this in the override-prime scriptlet of a part that runs after everything else. This still requires some boilerplate for snaps that consume desktop helpers, but you can still keep all the actual work in the remote parts that way.

Hopefully that unblocks this, and once we finish this cycle we can revisit a more perfect solution.

2 Likes