Improve error reporting for snap builds
Metadata
Current evaluation
Contributor jawadsalwati prepared a fix to clarify the snapcraft base validation error and updated unit tests. The issue was closed after the pull request was merged, improving error messaging for kernel and base types.
Suggested action: —
No scores available.
Issue body
### What needs to get done
When building a kernel with core24, I got the following error;
```
Bad snapcraft.yaml content:
- Snap base must be declared when type is not base, kernel or snapd
Full execution log: ....etc
```
This error was because I had a `base: core24` statement in my yaml. This error would be better expressed as something like _Snap base definition not required when type is base, kernel or snapd_. This would make the error message a little more useful.
### Why it needs to get done
Making error messages more self-explainatory will aid adoption.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Contributor jawadsalwati prepared a fix to clarify the snapcraft base validation error and updated unit tests. The issue was closed after the pull request was merged, improving error messaging for kernel and base types. | |
| qwen/qwen3.6-35b-a3b | — | — | Requested clearer error messages for snap builds. A contributor reproduced the issue, prepared a validation fix, and updated unit tests. The original interested developer stepped aside. The issue was closed after the fix was implemented. | |
| qwen/qwen3.6-35b-a3b | — | — | Resolved following a contributor handoff. A fix was prepared to improve the validation error message for snap base declarations and update unit tests, resulting in closure. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Fixed and closed after jawadsalwati prepared a fix improving the validation message and tests. EdmilsonRodrigues stepped aside. The change resolves misleading error reporting for kernel and base snap types. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Resolved by improving the snapcraft.yaml base validation error message and updating unit tests. The fix was prepared by jawadsalwati after another contributor stepped down, and the issue was closed upon implementation. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #5388 fix: don't fail when checking the base | snapcraft | merged | Merged a fix preventing snapcraft from failing early during base checks. Enables user-friendly error reporting for incorrect bases. Approved by two reviewers and merged with 10 additions and 30 deletions across three files. | |
| #4755 tests: fix devel base snap test | snapcraft | merged | Merged a fix for the devel base snap test. The update ensures snapcraft correctly creates and utilizes the devel base. Approved by two reviewers, passed CI checks, and applied with a minimal one-file change. | |
| #591 Improve error reporting | snapcraft | merged | Merged after improving error reporting to log errors before exiting with status 1. Tests updated and specific handling added for uploading non-existent snaps. Resolved following maintainer review and commit message adjustment. | |
| #6193 fix: snapcraft try error shows effective base | snapcraft | merged | Merged fix for #6186 that updates the snapcraft try error message to accurately display the effective base using get_effective_base(). Approved by reviewers and merged with added unit tests for core24 and core26. |