This topic is a stub, feel free to complete/extend it.
Stage snaps is a mechanism to integrate content from other snaps to your snap, it works like stage-packages
but instead dumping the content from the Debian-ish packages, stage-snaps
dumps content from a specified snap.
Stage snaps, and Extensions are the two features that are to replace the “Remote parts” feature in the legacy 2.X Snapcraft.
Possible usage
Import a launcher without actually adding it to your source tree
- The locales-launch launcher: Fix Glibc locales in the snap runtime
- The magic-launch launcher: Fix file type detection based on libmagic in the snap runtime
Import an SDK(a.k.a. library) snap and build your part against it
Other things
Implementation example
It is normally recommended to define the stage snap in a separate part and assign a dependency to the consuming part by using the after
clause, as you can control which files you want to import from the stage snap:
parts:
provider-stage-snap:
plugin: nil
stage-snaps:
- _provider_snap_name_
- _provider_snap_name_/_track_name_/_risk_level_name
stage:
- needed/files
consumer-part:
after:
- provider-stage-snap
Note
Stage snaps that also shipping their own stage-packages
will likely cause file conflict due to shipping the same non-identical libraries with your consumer snap, use the stage
key to filter conflicting files from the stage snap.