← Back to issue list

`--debug` does not enter a shell for failures during post-prime or packing

View original Github issue

Metadata

Project
craft-application
Number
#415
Type
issue
State
closed
Author
mr-cal
Labels
—
Created
Updated
Closed

Current evaluation

Fixed by merged PR #436 (commit ab55ec81), adding --shell/--shell-after to pack and making --debug drop into a shell when packing fails; closed by maintainer tigarmo on 2024-09-10.

Resolution: closed resolved

Reason: Maintainer tigarmo closed the issue with "Fixed in #436"; PR #436 (commit ab55ec81, "feat: support shell/shell-after and debug in 'pack'") was merged, and _run_pack in craft_application/commands/lifecycle.py now catches pack_artifacts() failures and calls _launch_shell() when debug is set.

Evaluated by: mr-cal-bot

No scores available.

Issue body

### What needs to get done Wrap the post-prime and pack steps with the debug shell function ### Why it needs to get done * Providing `--debug` and not getting a debug shell when an artefact fails to pack is unintuitive * Users need a way to troubleshooting packing an artefact * It's a regression for snapcraft in core24 (https://github.com/canonical/snapcraft/issues/4959)

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Fixed by merged PR #436 (commit ab55ec81), adding --shell/--shell-after to pack and making --debug drop into a shell when packing fails; closed by maintainer tigarmo on 2024-09-10.
stealth/space-bunny-alpha — closed resolved Fixed in craft-application#436 (commit ab55ec81), which added --shell and --shell-after to pack and made --debug enter a shell when packing fails.
qwen/qwen3.6-35b-a3b — — 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.
qwen/qwen3.6-35b-a3b — — Fixed in #436 by wrapping post-prime and pack steps with the debug shell function, restoring expected behavior when artifacts fail to pack.

Update history

No update history recorded yet.

Related work

Related issues

Issue Project State Summary Similarity
#1074 --shell and --debug fail cryptically with late pack failures craft-application closed Fixed in merged PR #1073 (commit 38fdb686), which added post-prime failure handling so --debug can open a shell instead of only reporting an instance error.
85%
#4959 `--debug` does not enter a shell for failures during post-prime or packing snapcraft closed Fixed in Snapcraft 8.4.1: core24 --debug now opens a shell after post-prime or packing failures via craft-application PR #436 (ab55ec81).
84%
#430 Properly support `--shell`, `--shell-after` and `--debug` on `pack` craft-application closed Fixed by merged PR #436 (ab55ec81), adding --shell and --shell-after to pack and applying --debug when packing fails.
78%
#1073 fix: handle `--debug` for post-prime failures craft-application merged Merged PR #1073 (commit 38fdb686) preserves --debug shell handling when post-prime actions such as Snapcraft pack fail, fixing #1074.
75%
#436 feat: support shell/shell-after and debug in 'pack' craft-application merged Merged craft-application#436 (commit ab55ec81), adding --shell/--shell-after to pack and making --debug shell into the build environment when packing fails; fixes #430.
74%
#495 pack: add support for --debug, --shell, and --shell-after (CRAFT-408) charmcraft merged Merged in commit 1a957995, adding --debug, --shell, and --shell-after to pack for interactive and failure-triggered build debugging.
73%