← 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 PR #2002 (commit bbca282fa) added the snapcraftctl CLI for scriptlets to talk to the parent Snapcraft process, including `snapcraftctl build` and the override-build scriptlet. Resolved #1675 and LP #1751749.

Resolution: closed resolved

Reason: The PR itself was merged into snapcraft as commit bbca282fa ('many: add snapcraftctl command for scriptlets'), approved by a maintainer reviewer. It introduced the snapcraftctl entry point and proved the design with the override-build scriptlet plus a `build` subcommand, closing issue #1675 and incidentally fixing LP bug #1751749.

Evaluated by: mr-cal-bot

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
stealth/space-bunny-alpha — closed resolved Merged PR #2002 (commit bbca282fa) added the snapcraftctl CLI for scriptlets to talk to the parent Snapcraft process, including `snapcraftctl build` and the override-build scriptlet. Resolved #1675 and LP #1751749.
stealth/space-bunny-alpha — closed resolved Merged PR #2002 as commit bbca282fa, adding snapcraftctl for scriptlets and snapcraftctl build for override-build. It resolved #1675 and LP #1751749.
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.

Update history

No update history recorded yet.

Related work

  • Duplicate Of: canonical/snapcraft#1675 (confidence 90%)

    PR description states it resolves #1675 (base logic for scriptlet metadata setters); that issue was subsequently closed.

  • Related To: canonical/snapcraft#2045 (confidence 70%)

    Follow-up commit 56c16cbc5 'many: add override-pull scriptlet' builds on the snapcraftctl framework introduced here.

  • Related To: canonical/snapcraft#2063 (confidence 65%)

    Follow-up commit 278f9b79f 'many: add snapcraftctl set-version' extends this framework with metadata setters.

Related issues

Issue Project State Summary Similarity
#2063 many: add snapcraftctl set-version snapcraft merged Merged as commit 278f9b79f, adding snapcraftctl set-version for scriptlets and reusable setter infrastructure; resolves #1676.
82%
#3751 craftctl: add snapcraftctl compatibility wrapper snapcraft merged Merged #3751 added a snapcraftctl compatibility wrapper delegating to craftctl, prompted core22 users to migrate, and restored execution of existing spread tests.
74%
#3317 plugin handler: properly handle snapcraftctl errors snapcraft merged Merged PR #3317 in commit 9c622ecda, making snapcraftctl exit nonzero on build/pull failures and stop override scripts after parent operation errors.
72%
#4095 cli: add lint command snapcraft merged Merged PR #4095 (commit 297130c4e) adding the `snapcraft lint` CLI command with unit tests for CRAFT-1688, giving Snapcraft users access to lint checks.
72%
#2049 many: add override-stage scriptlet snapcraft merged Merged in PR #2049 (commit c5ca9ef8), adding override-stage and snapcraftctl stage so overridden parts can invoke the default stage action, completing #1673.
70%
#2045 many: add override-pull scriptlet snapcraft merged Merged as commit 56c16cbc5: added override-pull and snapcraftctl pull; Local sources now merge into the existing directory to preserve pre-pull changes.
70%