← Back to issue list

sign-build --local just doesn't work

View original Github issue

Metadata

Project
snapcraft
Number
#5618
Type
issue
State
closed
Author
laplante-sean
Labels
Status: Triaged Type: Bug
Created
Updated
Closed

Current evaluation

Fixed by merged PR #5826 (commit bf00a385e, "fix: parse a snap file for the sign-build command"), which declared the missing snap-file argument in the legacy sign-build command; tracked internally as SNAPCRAFT-1180.

Resolution: closed resolved

Reason: Maintainer @bepri traced the failure to the undeclared 'snap-file' argument in snapcraft/commands/legacy.py, and PR #5826 added it, resolving the 'unrecognized arguments' / 'Missing argument' errors.

Evaluated by: mr-cal-bot

No scores available.

Issue body

### Bug Description ``` $ snapcraft sign-build --local --key-name local-key --verbosity trace *.snap 2025-07-16 15:18:23.106 Starting snapcraft, version 8.10.1 2025-07-16 15:18:23.106 Logging execution to '/home/user/.local/state/snapcraft/log/snapcraft-20250716-151823.092624.log' 2025-07-16 15:18:23.106 Raw pre-parsed sysargs: args={'help': False, 'verbose': False, 'quiet': False, 'verbosity': <EmitterMode.TRACE: 5>, 'version': False} filtered=['sign-build', '--local', '--key-name', 'local-key', 'test-snap_1.0_amd64.snap'] 2025-07-16 15:18:23.106 General parsed sysargs: command='sign-build' args=['--local', '--key-name', 'local-key', 'test-snap_1.0_amd64.snap'] 2025-07-16 15:18:23.106 Configuring application...Usage: snapcraft [options] command [args]... Try 'snapcraft sign-build -h' for help. Error: unrecognized arguments: test-snap_1.0_amd64.snap ``` ``` $ ls -l test-snap_1.0_amd64.snap -rwxrwxrwx 1 user user 589808 Jul 16 14:42 test-snap_1.0_amd64.snap $ snapcraft list-keys The following keys are available on this system: Name SHA3-384 fingerprint * local-key XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ``` ### To Reproduce 1. Have an unsigned local `.snap` file 1. Try to sign it with `--local` and a registered key ### Environment * LXD * Ubuntu 24.04 ### snapcraft.yaml ```yaml n/a - trying to sign a built snap. The snap builds fine. ``` ### Relevant log output ```shell 2025-07-16 15:18:23.106 Starting snapcraft, version 8.10.1 2025-07-16 15:18:23.106 Logging execution to '/home/user/.local/state/snapcraft/log/snapcraft-20250716-151823.092624.log' 2025-07-16 15:18:23.106 Raw pre-parsed sysargs: args={'help': False, 'verbose': False, 'quiet': False, 'verbosity': <EmitterMode.TRACE: 5>, 'version': False} filtered=['sign-build', '--local', '--key-name', 'local-key', 'test-snap_1.0_amd64.snap'] 2025-07-16 15:18:23.106 General parsed sysargs: command='sign-build' args=['--local', '--key-name', 'local-key', 'test-snap_1.0_amd64.snap'] 2025-07-16 15:18:23.106 Configuring application...Usage: snapcraft [options] command [args]... Try 'snapcraft sign-build -h' for help. ``` ### Additional context When I run it without specifying a file, it tells me: ``` Usage: snapcraft sign-build [OPTIONS] <snap-file> Try 'snapcraft sign-build -h' for help. Error: Missing argument '<snap-file>'. ```

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Fixed by merged PR #5826 (commit bf00a385e, "fix: parse a snap file for the sign-build command"), which declared the missing snap-file argument in the legacy sign-build command; tracked internally as SNAPCRAFT-1180.
stealth/space-bunny-alpha — closed resolved Fixed sign-build's missing snap-file argument parsing in merged PR #5826 (commit bf00a385e), restoring local signing.
qwen/qwen3.6-35b-a3b — — Triaged and closed. The missing snap-file argument declaration in the command definition was identified as the root cause. An internal Jira ticket was created to track the fix.
qwen/qwen3.6-35b-a3b — — Closed after identifying the missing <snap-file> argument declaration in legacy.py. The bug was resolved via an internal ticket to add the missing argument.
qwen/qwen3.6-35b-a3b — — Closed without a public fix after identifying the missing snap-file argument declaration in legacy.py. An internal ticket was created, but the issue was ultimately abandoned.
qwen3.6-35b-a3b-mtp-q6 — — Closed after triage. An internal ticket was created to track the fix for the missing CLI argument declaration.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: canonical/snapcraft#5826 (confidence 97%)

    Merged fix commit bf00a385e 'fix: parse a snap file for the sign-build command' directly targets the missing snap-file argument identified in the issue.

  • Related To: canonical/snapcraft#6228 (confidence 45%)

    Later refactor migrating the sign-build command out of the legacy command set (commit 2904d0be2), following the same fix.

Related issues

Issue Project State Summary Similarity
#5826 fix: parse a snap file for the sign-build command snapcraft merged Merged PR #5826 (commit bf00a385e) fixed sign-build snap-file parsing and removed duplicate --local help text; it fixes #5618.
80%
#831 'sign-build' implementation. snapcraft merged Merged as commit ded7281c9, adding sign-build to generate, sign, and optionally push snap-build assertions; superseded PR #795.
74%
#6228 refactor: migrate sign-build command snapcraft merged Merged PR #6228 as commit 2904d0be2, migrating the sign-build command from Snapcraft's legacy codebase as part of SNAPCRAFT-1320.
71%
#1629984 trying to sign-build without keys leaves a -build file, empty snapcraft (launchpad) closed Merged canonical/snapcraft PR #848 (d0b49816f), fixing failed sign-build runs that left empty "-build" files by selecting a key before writing output.
70%