← Back to issue list

many: add snapcraftctl command for scriptlets

View original Github issue

Metadata

Project
snapcraft
Number
#2002
Type
pull request
State
merged
Author
kyrofa
Labels
Created
Updated
Closed

Current evaluation

Merged. Adds snapcraftctl CLI for scriptlet-to-Snapcraft communication. Introduces snapcraftctl build for override-build, resolving #1675 and LP: #1751749. Approved with passing CI across 28 files.

Suggested action:

No scores available.

Issue body

- [x] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)? - [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [x] If this is a bugfix. Have you checked that there is a bug report open for the issue you are trying to fix on [bug reports](https://bugs.launchpad.net/snapcraft)? - [x] If this is a new feature. Have you discussed the design on the [forum](https://forum.snapcraft.io)? - [x] Have you successfully run `./runtests.sh static`? - [x] Have you successfully run `./runtests.sh unit`? ----- There is the desire for scriptlets to be able to communicate with Snapcraft, e.g. to request that it use a specific name, or version, or do a specific action, such as fetch stage packages, or run a lifecycle step. This PR resolves #1675 by adding the basic framework for this communication, adding a new CLI utility called `snapcraftctl` that is used to communicate with the parent Snapcraft process. It proves this out by adding a new subcommand to this utility called `build` which, if called, will run the plugin's build step. It also adds the `overide-build` scriptlet, which can use `snapcraftctl build` like so: # ... override-build: | snapcraftctl build # ... Note that, as a side-effect of this work, LP: [#1751749](https://bugs.launchpad.net/snapcraft/+bug/1751749) is fixed as well.

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Merged. Adds snapcraftctl CLI for scriptlet-to-Snapcraft communication. Introduces snapcraftctl build for override-build, resolving #1675 and LP: #1751749. Approved with passing CI across 28 files.
qwen3.6-35b-a3b-mtp-q6 Merged. Introduces the snapcraftctl CLI utility to enable scriptlet communication with the parent Snapcraft process. Adds the snapcraftctl build subcommand for override-build scriptlets, resolving issue #1675 and bug LP: #1751749.
qwen3.6-35b-a3b-mtp-q6 Merged. Introduces the snapcraftctl CLI utility enabling scriptlets to communicate with the parent Snapcraft process. Adds a build subcommand and override-build support, resolving issue #1675 and fixing LP: #1751749.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#2063 many: add snapcraftctl set-version snapcraft merged Merged. Adds snapcraftctl set-version to configure snap versions from scriptlets, resolving issue 1676. Provides reusable infrastructure for future setter commands. Approved by reviewer and passed CI checks.
80%
#2067 many: add snapcraftctl set-grade snapcraft merged Merged. Introduces snapcraftctl set-grade for scriptlet-based snap grade configuration and adds final YAML validation before snap.yaml generation. Resolves #2064. Approved, passed CI, and modified 20 files.
76%
#2052 many: add override-prime scriptlet snapcraft merged Merged after approval and passing CI checks. Adds the override-prime scriptlet and prime subcommand to snapcraftctl, resolving issue #1674.
76%
#2045 many: add override-pull scriptlet snapcraft merged Merged: added override-pull scriptlet and snapcraftctl pull subcommand to Snapcraft. Enables overriding the plugin pull step for source patching. Fixed Local source handling to preserve pre-pull changes.
73%
#4095 cli: add lint command snapcraft merged Merged into main after approval and passing CI checks. Introduces a new snapcraft lint CLI command, adding 223 lines across 5 files with 96.25% test coverage. Resolves CRAFT-1688.
72%
#49 packages: add snap package support craft-parts merged Merged after implementing snap download and installation for stage and build snaps. Approved by two reviewers, passed CI, and added 1,072 lines across five files. Follows snapcraft conventions with future refactoring planned.
72%
#3683 commands: add snap command snapcraft merged Merged into snapcraft/7.0. Implements legacy snap command support for package creation and fixes output parameter passing to managed instances. Approved by reviewer with passing CI checks.
72%
#2283 snapcraft snap: refactor override-build into a script snapcraft merged Merged refactoring that extracts override-build into a standalone script to reduce snapcraft.yaml duplication and support internal vendoring. Approved by reviewer, passed CI, and modified two files.
72%
#2103 package: make use of snapcraftctl snapcraft features snapcraft merged Merged. Replaced prepare, build, and install with override-pull and override-build. Integrated snapcraftctl set-version and set-grade to fix LP: #1758958. Changes shipped in the 2.42 release, with full version management deferred to a follow-up.
72%
#3751 craftctl: add snapcraftctl compatibility wrapper snapcraft merged Merged a snapcraftctl compatibility wrapper into craftctl to ease the core22 transition. The wrapper outputs an update message and includes spread tests. Approved by reviewer, passed CI, and merged into main.
72%