feat: support shell/shell-after and debug in 'pack'
Metadata
Current evaluation
Merged following two approvals and passing CI. Introduces --shell and --shell-after flags to the pack command for build environment inspection, and improves --debug to activate on packing failures. Resolves #430.
Suggested action: —
No scores available.
Issue body
`--shell` and `--shell-after` are implemented for a) consistency with the other lifecycle commands, and b) because it makes sense to want to inspect the build environment at packing time, considering that there are packing-related steps, like writing the metadata file, that the users don't have a way to inspect otherwise (short of examining the final artefact).
`--debug` is improved to actually shell into the build environment when the packing itself failed, as opposed to the previous behavior of only debugging failures that happen during the lifecycle steps.
Fixes #430
- [ ] Have you followed the guidelines for contributing?
- [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [ ] Have you successfully run `tox`?
-----
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged following two approvals and passing CI. Introduces --shell and --shell-after flags to the pack command for build environment inspection, and improves --debug to activate on packing failures. Resolves #430. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Adds --shell and --shell-after flags to the pack command for environment inspection, and improves --debug to trigger on packing failures. Resolves #430. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #495 pack: add support for --debug, --shell, and --shell-after (CRAFT-408) | charmcraft | merged | Added --debug, --shell, and --shell-after flags to the pack command for debugging charm builds. Merged after approval by three reviewers and passing CI checks, modifying five files. | |
| #81 feat: implement --shell, shell-after, --debug | craft-application | merged | Merged into main, implementing --shell, shell-after, and --debug flags. Approved by two reviewers, passed CI checks, and increased test coverage by 0.05%. Resolves issue #58. | |
| #419 Support `--shell` and `--shell-after` for the `pack` command | craft-application | closed | Added support for --shell and --shell-after to the pack command. Fixed via pull request #436 and marked as a duplicate of issue #430. | |
| #3718 parts: run debug shell on build environment | snapcraft | merged | Merged. Adds debug, shell, and shell-after flags to launch a build environment shell during parts errors or to replace lifecycle steps. Approved by reviewer, rebased, and passed CI before integration. | |
| #430 Properly support `--shell`, `--shell-after` and `--debug` on `pack` | craft-application | closed | Closed without a GitHub resolution. Synced to internal Jira ticket CRAFT-3288. No pull requests were merged, indicating the request was abandoned or handled via internal tracking. | |
| #415 `--debug` does not enter a shell for failures during post-prime or packing | craft-application | closed | Resolved in pull request #436. The --debug flag now correctly opens a shell when post-prime or packing steps fail, fixing a regression that blocked artifact troubleshooting. | |
| #4963 Support `--shell` and `--shell-after` for `snapcraft pack` | snapcraft | closed | Added --shell and --shell-after flags to snapcraft pack for debugging. The request was closed after being fixed via upstream craft-application pull request 436. |