Preprocessing snapcraft part files

Mark Shuttleworth mark at ubuntu.com
Wed Dec 16 07:36:32 UTC 2015


Interesting use case, thanks for mailing the list.

We already support sequenced operations (with the "after" keyword) so
it's pretty clear how you would have the one part built after another part.

What's more interesting is having pre-processing steps. I think we quite
strongly want to avoid having a turing-complete packaging system, which
means that any code itself needs to be in the repositories that come
with the parts. Are you able to commit to the upstream repository? Are
there single commands which would perform the needed steps? If so we
could think about having a declarative pre-processing mechanism in
snapcraft.yaml which essentially says to the plugin "do this before you
do what you normally do". It's just that "this" would be much easier to
define if it were something expressed in the repository itself, like a
Makefile target.

Would that help?

Mark

On 15/12/15 21:52, Mike Berger wrote:
> I'm trying to create a snap where I need to preprocess pull'ed files before
> building them.  I'm hoping someone can give me a strategy to attack the
> problem.
>
> I have one git repository that contains some generic schema files.  Within
> this repository is a python command, transform.py, used to transform the
> generic schema files into a build-specific schema files.
>
> I then have second git repository that comes with (different) generic
> schema files.  I need to replace the schema files in this second repository
> with the build-specific schema files that were generated in the first
> repository.
>
> I then need to build the second repository using the autotools plugin.
>
> Any suggestions on how I can make snapcraft perform the above operations?





More information about the snappy-app-devel mailing list