Using remote parts

Implicit use

The simplest use of a remote part is to specify it in the after stanza for an existing part. This will pull the remote part as the snap is built.

parts:
client:
plugin: autotools
source: .
after: [curl]

Composing

Perhaps the remote part is almost what’s needed, but a change is required to fit the needs of your snap. In this case we can override pieces of the remote part. In this example we’re overriding the source URL.

Copy/Pasting

In this example we take the output from snapcraft define <part> and paste it directly into our snap. This allows us full control over all the pieces of the part. We are now effectively no longer using the remote part, but have incorporated it into our build definition.

The ‘parts: [curl]’ is the critical piece as it MUST detail all of the parts contained in the snapcraft.yaml from your remote part.

Note: To edit the Ubuntu wiki you’ll need an Ubuntu SSO account (as used in the snap store), and need to request to join the ubuntu-wiki-editors team. Once approved, logout from the Ubuntu wiki and log back in again to refresh your new credentials.

Wait for cache refresh

The online parts cache refreshes from the wiki every 30 minutes. You can check the status (including time of most recent update) of the parts cache at https://parts.snapcraft.io/v1/status.

If you have an error in your catalog entry on the parts wiki, the parts status page https://parts.snapcraft.io/v1/status will display details of the error. Your remote part won’t be published until you fix any errors.

Promote your new part

Consider starting a thread on the forum to request feedback on, and promote the use of your new remote part.