← Back to issue list

pluginhandler: error out on scriptlet errors

View original Github issue

Metadata

Project
snapcraft
Number
#1545
Type
pull request
State
merged
Author
sergiusens
Labels
—
Created
Updated
Closed

Current evaluation

Merged pluginhandler now fails on any scriptlet command error, not only the final command, fixing LP #1707189; PR snapcraft#1545 landed as commit 3a18cc87a.

Resolution: closed resolved

Reason: PR snapcraft#1545 merged as commit 3a18cc87a. It changed pluginhandler error handling so any failing scriptlet command causes the build to fail rather than only an error in the final command.

Evaluated by: mr-cal-bot

No scores available.

Issue body

The code only handled an erroring scenario correctly when the last command executed on a script raised an error. LP: #1707189 Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com> - [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`? -----

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged pluginhandler now fails on any scriptlet command error, not only the final command, fixing LP #1707189; PR snapcraft#1545 landed as commit 3a18cc87a.
stealth/space-bunny-alpha — closed resolved Merged as 3a18cc87a, making pluginhandler fail on any scriptlet command error, not only an error in the final command (LP #1707189).
qwen/qwen3.6-35b-a3b — — Merged fix ensuring scriptlet errors trigger immediate failures instead of only catching the last command's error. Approved by one reviewer, passed CI, and merged by maintainer sergiusens. Resolves Launchpad bug #1707189.
qwen3.6-35b-a3b-mtp-q6 — — Merged fix to pluginhandler that properly exits on scriptlet errors, resolving LP #1707189. Previously, only the final command's failure triggered an error. The update now catches and reports all scriptlet failures immediately.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#1466 scriptlets erroring behavior snapcraft closed Fixed in snapcraft#1545 (commit 3a18cc87a): scriptlets now fail on any command error, not only the final command.
79%
#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.
75%
#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.
73%
#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.
73%
#2117 pluginhandler: correctly dedent the run script snapcraft merged Merged PR #2117 via commit fb5f57a7d, correctly dedenting pluginhandler run-script output as partial prework for LP #1767625.
70%
#988 pluginhandler: build scriptlet support snapcraft merged Merged PR #988 added pluginhandler build-scriptlet support for custom part build scripts in commit cc123cad9.
70%