Migrate snapcraft_legacy subcommands to use craft-cli
Metadata
Current evaluation
Requested legacy-handler bypass was abandoned; verbosity support landed in #5646/#5680, and snapcraft_legacy was later removed in ffb164b7a.
Resolution: closed stale
Reason: Closed after mr-cal's 2025-04-22 comment said bypassing the legacy handler was no longer the approach; Snapcraft would retain it short term and migrate commands out instead. The reported verbosity symptom was separately fixed by merged PR #5646 (3aeded2fa) and #5680 (4a7663069).
Evaluated by: mr-cal-bot
No scores available.
Issue body
### What needs to get done
Here's what I understand:
Rather than passing the cli context from `craft-cli` to `snapcraft_legacy`'s cli handler, snapcraft should directly call functions in `snapcraft_legacy`. In other words, `snapcraft_legacy`'s cli handler should be bypassed.
I think @sergiusens mentioned he did this for [`list-extensions`](https://github.com/snapcore/snapcraft/blob/40136ea9b59351e4f9f1fbed8c4d8c0db873c488/snapcraft/commands/extensions.py#L38).
### Why it needs to get done
This needs to get done to improve the user experience.
`snapcraft <subcommand> --help` lists `--verbosity` but using this argument when building a core20 snap or using snapcraft_legacy subcommand raises an error. There are a few reports about this. [[1](https://bugs.launchpad.net/ubuntu/+source/snapcraft/+bug/2020891)] [[2](https://bugs.launchpad.net/snapcraft/+bug/2016662)] [[3](https://forum.snapcraft.io/t/very-confusing-verbosity-and-verbose-behavior-depends-on-base-in-snapcraft-7/35433)]
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed stale | Requested legacy-handler bypass was abandoned; verbosity support landed in #5646/#5680, and snapcraft_legacy was later removed in ffb164b7a. | |
| stealth/space-bunny-alpha | — | closed stale | Proposed migration was abandoned; mr-cal closed it in favor of keeping the legacy handler short term and eventually migrating commands out. The verbosity failure was separately addressed by PRs #5646 and #5680. | |
| qwen/qwen3.6-35b-a3b | — | — | Abandoned. The maintainer rejected the proposed approach, confirming the legacy CLI handler will remain in use short-term while commands are fully migrated out of snapcraft_legacy in the medium term. | |
| qwen/qwen3.6-35b-a3b | — | — | The craft-cli migration was rejected. The issue was closed, with the maintainer confirming the team will continue using the legacy CLI handler short-term while planning a full command migration out of snapcraft_legacy long-term. | |
| qwen/qwen3.6-35b-a3b | — | — | Rejected. Maintainer declined bypassing legacy CLI handler. Project will continue using it short-term, planning to migrate commands entirely out of snapcraft_legacy medium-term. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | The proposed migration approach was rejected. The team will continue using the legacy CLI handler short-term, planning to migrate commands entirely out of snapcraft_legacy in the medium term. |
Update history
No update history recorded yet.
Related work
-
Related To:
canonical/snapcraft#5646
(confidence 100%)
Merged as 3aeded2fa, adding verbosity argument and environment support to legacy lifecycle commands.
-
Related To:
canonical/snapcraft#5680
(confidence 100%)
Merged as 4a7663069, extending verbosity support to non-lifecycle commands and shipping in Snapcraft 8.11.1.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #5338 Migrate snapcraft_legacy store commands | snapcraft | closed | All four legacy store commands were migrated through merged PRs #6109, #6128, #6207, and #6218; snapcraft_legacy was later removed. | |
| #5982 Trim down snapcraft_legacy and plan migration effort | snapcraft | closed | Superseded by a revised plan to migrate store commands first, then delete snapcraft_legacy; the package was later removed in ffb164b7a and 995f0a3bc. | |
| #1793261 Vendor legacy snapcraft to maintain backward compatibility | snapcraft (launchpad) | closed | Legacy Snapcraft was vendored into the snapcraft snap, dispatching projects without bases to it. Delivered via merged PRs canonical/snapcraft#2283 (commit f9592939a, override-build refactor) and #2285 (commit 5c1ee3b88). | |
| #5680 feat(snapcraft_legacy): support verbosity args in non-lifecycle commands | snapcraft | merged | Merged in PR #5680 (commit 4a7663069), adding verbosity handling to snapcraft_legacy non-lifecycle commands and fixing #5298; released in Snapcraft 8.11.1. | |
| #2285 snapcraft snap: vendor legacy snapcraft | snapcraft | merged | Merged in canonical/snapcraft#2285 (commit 5c1ee3b88), vendoring legacy Snapcraft and dispatching no-base projects to it to preserve backward compatibility. | |
| #5646 feat(snapcraft_legacy): support verbosity args | snapcraft | merged | Merged as commit 3aeded2fa: snapcraft_legacy core20 commands now accept craft-cli verbosity args/env vars, with --enable-developer-debug as alias for --verbosity=debug. Follow-up #5680 (4a7663069) extended it to non-lifecycle commands. | |
| #5423 Add `--verbosity`, `--verbose`, and `--quiet` for legacy commands in Snapcraft 8 | snapcraft | closed | Legacy command verbosity support merged in PR #5646 (3aeded2fa), with non-lifecycle coverage completed by PR #5680 (4a7663069). | |
| #5424 Add `--verbosity`, `--verbose`, and `--quiet` for legacy commands in Snapcraft 7 | snapcraft | closed | Enhancement request for --verbosity/--verbose/--quiet on legacy commands in Snapcraft 7. Maintainer closed it 2025-08-07 noting it shipped in Snapcraft 8.11 via #5423 (PR #5646, commit 3aeded2fa) and is not planned for Snapcraft 7. | |
| #5682 Remove legacy help and version code | snapcraft | closed | Merged PR #5777 removed the unused snapcraft_legacy help/version commands and their tests; the legacy package was later removed wholesale for Snapcraft 9. |