Question
Is it possible to re-use plugin artifacts across build runs of a given snap part, but re-pull the latest version of my part’s source
? For example, keep the ruby/node runtime built during the part’s pull step by the corresponding plugin, but re-build the ruby/JS app from the latest codebase using the existing runtime. I could of course add said runtime as a part of its own and specify before/after chains, but that way I loose all the bells and whistles of plugins
A second, related question: Two parts of my snap use the same nodejs version, so each part downloads & builds its own Node version (which then gets thrown away because I just need the resulting JS bundle). Is it possible to re-use the plugin runtime across parts?
Problem description / use case
My snap bundles several script language applications, each defined as a part with a plugin (two JavaScript singlepage applications and a Ruby-on-Rails backend). While iterating over the codebase of each part, I have to test certain functionality from within the snap. To get the latest app code in a new snap revision, I have to clean the part from the pull step onward and rebuild it (snapcraft clean my-part -s pull
but pull is the first step anyway … so snapcraft clean my-part
).
Cleaning a part’s pull step also removes the runtime built by the plugin, so each rebuild also downloads and builds the required ruby/nodejs version from scratch. This is especially time-consuming on the ARM devices for which the snap is intended (and the ruby plugin does not support cross-compilation atm).