fix: handle `--debug` for post-prime failures
Metadata
Current evaluation
Merged fix resolving an exception when launching a debug shell after post-prime failures. Approved by three reviewers and passed CI checks. Resolves craft-application#1074 with 48 additions and 2 deletions across two files.
Suggested action: —
No scores available.
Issue body
Fixes an exception when trying to launch a shell in the case where `--debug` is used and a post-prime action fails. An example case in Snapcraft is when a build succeeds but `pack` fails due to missing required metadata fields. (Presence of required fields cannot always be validated earlier, because one could use `parse-info` to read them from a build output file).
Fixes canonical/craft-application#1074.
- [ ] Have you followed the guidelines for contributing?
- [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [ ] Have you successfully run `make lint && make test`?
- [ ] Have you added an entry to the changelog (`docs/reference/changelog.rst`)?
---
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged fix resolving an exception when launching a debug shell after post-prime failures. Approved by three reviewers and passed CI checks. Resolves craft-application#1074 with 48 additions and 2 deletions across two files. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged fix for an exception when launching a debug shell after a post-prime action failure. Resolves canonical/craft-application#1074 by properly handling debug mode during post-prime errors. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged fix for an exception triggered when using --debug during post-prime failures, such as Snapcraft pack failures from missing metadata. Resolves canonical/craft-application#1074. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1074 --shell and --debug fail cryptically with late pack failures | craft-application | closed | Closed and transferred to craft-application repository. Root cause identified: post-prime failures bypass --shell/--debug guards. Fix requires wrapping _run_post_prime_steps() in error handling. Pending upstream resolution. | |
| #727 fix: only run post prime in the process that ran the lifecycle | craft-application | merged | Merged a fix ensuring the post prime lifecycle step only runs in the initiating process, resolving #716 and CRAFT-4425. Approved by three reviewers with passing CI checks. A reviewer suggested adding a spread test later. |