

The Future of Snapcraft
source link: https://snapcraft.io//blog/the-future-of-snapcraft
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

The Future of Snapcraft
by Igor Ljubuncic on 7 January 2022
System hysteresis, when applied to software, can roughly be defined as an overall lag between desired implementation of code and actual implementation of said code. Ideally, this delay should be minimal, and programmers would be able to make instantaneous changes and improvements to their applications.
In reality, things are more complex – and tend to get more complex as time goes by. For the past six odd years, the Snapcraft team has worked on making their core product modular, efficient and useful to snap developers, extending its functionality and introducing new capabilities over time. In a way, it is a complete product, and it serves its purpose well. But there are ways to make things even better. This article looks at the future of Snapcraft.
Life in the fast lane
The basic concept revolves around breaking Snapcraft apart – into smaller, even more modular and reusable components that can be utilized across a range of different products. The common foundation 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 parts builder based on craft-providers and craft-parts, with added Snapcraft functionality as a separate layer. The only question is, what is the airspeed velocity of a swallow how difficult would this be to architect and implement?
Just before the holidays season, the Snapcraft team set about answering that exact question, and to examine the extent of modularity in their approach.
Here’s a quick digest of the work done:
- The current Snapcraft codebase is now considered legacy. The main entry point of this package is executed when fallback to legacy Snapcraft is required.
- Legacy Snapcraft keeps project configuration data in dictionary form. This was changed to use a pydantic model. Likewise, the JSON schema will need to be maintained separately.
- A simple prototype was made using the core22 base (development image), resulting in an installable snap package containing a test application.
More work to be done
The early proof of concept only covers some aspects of the Snapcraft functionality, but it did illustrate a relatively quick conversion to the new modular design. However, there are still quite a few technical challenges that need to be addressed, including data validation on a global level, grammar processing, extensions, part information adoption, Appstream info adoption, Snapcraft-specific plugins re-implementation as application plugins for craft-parts, or binary file patching.
Then, there are also the command-line argument processing implementation using craft-cli, new Store interactions and remote build functionality, as well as making the command-line user experience cleaner and more consistent.
What about legacy code?
It is important to note that this (somewhat) radical change will not disrupt the current usage model. Projects with core18 and core20 will continue using monolithic Snapcraft, whereas the new, modular Snapcraft will be used for core22 and later. A fallback mechanism will be placed to decide which implementation is required in the build process. This way, the thousands of projects happily using Snapcraft can continue working, and will only be affected if and when they move to the new base.
Summary
To boldly go where no one has gone before. This is true for spacecraft as well as Snapcraft. Going forward, you should expect to see quite a few new, interesting developments in the product, all aimed at making things simpler, faster, more robust, and without adversely affecting the user experience. If you have any comments or ideas, or perhaps if you’d like to contribute, please join our forum and let us know your thoughts.
Newsletter Signup
In submitting this form, I confirm that I have read and agree to Canonical's Privacy Policy
Recommend
-
29
Linux 一直在发展。过去,开发人员必须分别为不同的 Linux 发行版构建应用。由于存在多种 Linux 变体,因此为所有发行版构建应用变得很繁琐,...
-
31
GNU Emacs ...
-
12
Official snaps from major publishers “The auto-updating feature is huge” Due to the nature of our...
-
5
Official snaps from major publishers “The auto-updating feature is huge” Due to the nature of our platform, we release updates more than daily which adm...
-
3
解决Snapcraft的方框字问题 从snap安装的软件经常会出现文字显示为方框的情况,目前发现一个比较有效...
-
12
Snapcraft offline mode – Build snaps while saving data by Igor Ljubuncic on 12 November 2021 As part of the snap creation cycle, the Snapcraft tool creates isolated build instances inside which all of the necessar...
-
7
How Snapcraft helps developers map out their application dependencies and efficiently build snaps by Igor Ljubuncic on 8 February 2022 One of the core concepts of snaps is cross-distro compatibility. Developers ca...
-
6
Snapcraft experimental login – new, secure Web-based authentication method by Igor Ljubuncic on 20 October 2021 Some Snapcraft operations mandate that users identify themselves. For example, if you want to push yo...
-
8
Let’s build a snap together – a complex snapcraft.yaml walkthrough by Igor Ljubuncic on 21 January 2022 It has been a while since we talked about how to build snaps. In the past, we went through a number of detail...
-
2
Craft Parts – Reusable code, Snapcraft style by Igor Ljubuncic on 26 November 2021 Throughout the ages, humans have always used simpler tools and materials to create more complex ones. Wood and stone for smelting...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK