Canonical unveiled recently your plans you have for a next major revision of the Snapcraft toolkit, which is used to generate, distribute and update the popular Snap package format.
It should be noted that the current Snapcraft codebase has been declared inherited and will be applied when necessary use old technologies.
In his ad he mentions that from the drastic changes that are planned to be executed and of which some of them that are already in progress will not affect the current usage model, as Ubuntu Core 18 and 20 related projects will continue to use the old monolithic Snapcraft model.
In addition, they mention that the new Snapcraft modular model has planned that it will begin to be applied from the Ubuntu Core 22 branch.
In reality, things are more complex and tend to get more complex as time goes on. For the past six years, the Snapcraft team has worked to make their core product modular, efficient, and useful to Snap developers, expanding its functionality and introducing new capabilities over time. In a way, it is a complete product and serves its purpose well. But there are ways to make things even better. This article looks at the future of Snapcraft.
As for the reasons why it is intended to replace the old Snapcraft, it is because se wants to offer a new, more compact and modular option which will make it easier for developers to create Snap packages, adding to this that they also want to eliminate once and for all the hassle of creating portable packages that work on all distributions.
The basis of the new Snapcraft is the Craft Parts mechanism, it is mentioned that in addition to allowing the power to assemble packages, it will also be able to receive data from different sources, process them in different ways and form a hierarchy of directories in the FS, suitable for the implementation of packages. .
Craft Parts involves the use of portable components in the project, which can be downloaded, assembled and installed independently.
The basic concept revolves around dividing Snapcraft into smaller, even more modular and reusable components that can be used in a range of different products. The common ground for this effort is a set of Craft Libraries, as we have already discussed in the Craft Parts blog post. The theory calls for the use of a generic part generator based on craft and craft parts vendors, with the added functionality of Snapcraft as a separate layer. The only question is, what is the airspeed of a swallow? How difficult would it be to design and implement this?
Right before the holiday season, the Snapcraft team set out to answer that exact question and examine the extent of modularity in their approach.
Choosing a new implementation or old Snapcraft will be carried out through a special built-in backup mechanism in the construction process. Therefore, existing projects will be able to create Snap packages without changes and will require modifications only when the packages are transferred to a new version of the Ubuntu Core system base.
As for the work that has already been done, a very quick summary of it is shared:
- The current Snapcraft codebase is now considered legacy.
- The main entry point for this package runs when a legacy Snapcraft backup is required.
- Legacy Snapcraft maintains project configuration data in dictionary form.
- This was changed to use a pydantic model. Also, the JSON schema will need to be kept separate.
- A simple prototype was made using the core22 base (development image), resulting in an installable instant package containing a test application.
Finally if you are interested in knowing more about it About the note, you can check the original announcement in the following link.