when there's a syntax error in a scriptlet, it shows the name of the temp file
Metadata
Current evaluation
Snapcraft added contextual error handling for failed scriptlet execution in commit 3a18cc87a, avoiding diagnostics that exposed only the temporary script path.
Resolution: closed resolved
Reason: Commit 3a18cc87a, titled "pluginhandler: error out on scriptlet errors", added explicit plugin-handler handling for scriptlet failures. This directly addressed the unhelpful temporary-file-only diagnostic.
Evaluated by: mr-cal-bot
No scores available.
Issue body
When there's a syntax error in a scriptlet, it shows the name of the temp file which is not useful at all to find the error.
To reproduce:
Put a part with this in a snapcraft.yaml
plugin: nil
prepare: |
echo "hola" &&
There is a syntax error at the end of prepare because it's missing the second statement.
Run snapcraft:
$ snapcraft
Preparing to pull my-part
Pulling my-part
Preparing to build my-part
Building my-part
/tmp/tmpnpz33nrs: 2: /tmp/tmpnpz33nrs: Syntax error: end of file unexpected
Command '['/bin/sh', '/tmp/tmpgasuc_zd', '/tmp/tmpnpz33nrs']' returned non-zero exit status 2
Instead of showing the name of the tmp file, the error should point to the prepare scriptlet in the yaml.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Snapcraft added contextual error handling for failed scriptlet execution in commit 3a18cc87a, avoiding diagnostics that exposed only the temporary script path. | |
| stealth/space-bunny-alpha | — | closed resolved | Closed as already resolved after the maintainer realized the investigation had targeted the wrong Git tag; no linked PR or commit was recorded. | |
| stealth/space-bunny-alpha | — | closed stale | The scriptlet syntax-error reporting issue was closed without a recorded fix or maintainer explanation after years of inactivity. | |
| qwen/qwen3.6-35b-a3b | — | — | Abandoned. Syntax errors in scriptlets continue to display temporary file paths instead of the originating YAML scriptlet. No fix or pull request was implemented. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution, likely abandoned. Syntax errors in scriptlets continue to display temporary file paths instead of the original YAML location. |
Update history
| Date | Change |
|---|---|
| created |
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1751749 install scriptlet fails with stacktrace and failed command in deleted tmp files | snapcraft (launchpad) | closed | Fixed as a side effect of merged snapcore/snapcraft#2002 (commit bbca282fa), which reworked scriptlet command and error handling. |