pluginhandler: add {pre,post}-build scriptlets
Metadata
Current evaluation
Closed unmerged; its pre-/post-build rename was superseded by #2002 (bbca282fa), which introduced snapcraftctl and override-build.
Resolution: closed superseded
Reason: PR #1998 was closed without merge after its author said the work would be landed in a different order. PR #2002, commit bbca282fa, implemented the alternative snapcraftctl/override-build design and resolved #1671.
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`?
-----
Snapcraft currently supports three scriptlets:
- `prepare`: run before build
- `build`: replaces plugin's build
- `install`: run after build
The end goal is to have scriptlets surrounding each lifecycle step. To that end, this PR resolves #1671 by adding some generic scriptlet scaffolding to make future additions easier, and by renaming `prepare` and `install` to `pre-build` and `post-build`, respectively. The old names are deprecated (https://github.com/canonical-docs/snappy-docs/pull/371).
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed superseded | Closed unmerged; its pre-/post-build rename was superseded by #2002 (bbca282fa), which introduced snapcraftctl and override-build. | |
| stealth/space-bunny-alpha | — | closed superseded | Closed unmerged; its prepare/install rename was superseded by snapcraftctl and override-build, merged in canonical/snapcraft#2002 (bbca282fa). | |
| stealth/space-bunny-alpha | — | closed superseded | Closed unmerged after a planned reshuffle; #2002 (bbca282fa) introduced snapcraftctl-based scriptlet handling instead of this pre-/post-build proposal. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without merging. The author indicated plans to restructure the changes and implement them in a different order, superseding this pull request. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed and superseded by a restructured merge. The PR added pre/post-build scriptlet scaffolding and renamed prepare/install to pre-build/post-build, deprecating legacy names. |
Update history
No update history recorded yet.
Related work
-
Superseded By:
snapcraft#2002
(confidence 99%)
Merged the alternative lifecycle design in bbca282fa, adding snapcraftctl and override-build.
-
Related To:
snapcraft#1671
(confidence 98%)
Design issue targeted by #1998 and later resolved through #2002's alternative implementation.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #987 pluginhandler: prepare scriptlet support | snapcraft | merged | Merged into master as commit 5671b910b, reworking pluginhandler to prepare for scriptlet support (LP #1642371). It set up the plumbing so the follow-up PR #988 (cc123cad9) could add build-scriptlet handling. | |
| #988 pluginhandler: build scriptlet support | snapcraft | merged | Merged PR #988 added pluginhandler build-scriptlet support for custom part build scripts in commit cc123cad9. | |
| #2327 pluginhandler: remove prepare, build and install scriptlets | snapcraft | merged | Merged PR #2327 removed PluginHandler's deprecated prepare, build, and install scriptlets, retaining override-{step-name} handling and compatibility tests. | |
| #960 pluginhandler: install scriptlet support | snapcraft | merged | Merged PR #960 (commit eb9f74b4) added pluginhandler support for part install scriptlets, implementing LP #1649683. Follow-up merged PRs #987 and #988 added prepare/build scriptlets. | |
| #3131 plugin handler: debug build commands if developer debug enabled | snapcraft | closed | Closed unmerged as superseded by snapcraft#3139, which merged isolated PluginV2 command execution and clearer error reporting in commit 389c180ea. |