← Back to issue list

fix: allow desktop files without an Exec key

View original Github issue

Metadata

Project
snapcraft
Number
#6298
Type
pull request
State
merged
Author
WaiHlyanMinThein17
Labels
—
Created
Updated
Closed

Current evaluation

Merged PR #6298 (commit ea842ae55) makes Snapcraft accept desktop entries lacking an Exec key, fixing #5799; Exec reformatting now only runs when the key exists and test_missing_exec_entry was updated.

Resolution: closed resolved

Reason: The PR was approved by two reviewers and merged into main as commit ea842ae55, closing issue #5799. Desktop files without an Exec key (common for D-Bus/systemd-activated apps) are now written through unchanged instead of failing with "missing 'Exec' key".

Evaluated by: mr-cal-bot

No scores available.

Issue body

Fixes #5799 Desktop entries without an `Exec` key are valid when the application is D-Bus- or systemd-activated (often with `NoDisplay=true`), so the shell can still match an icon and metadata to a GUI that isn't launched directly. `desktop-file-validate` accepts such files, but snapcraft rejected them with `missing 'Exec' key`. This makes the `Exec` reformatting conditional on the key being present instead of raising when it's absent, so the file is written through unchanged. The separate "missing Desktop Entry section" guard is untouched. The existing `test_missing_exec_entry` is converted from asserting rejection to asserting the file is written faithfully without an `Exec` line. The issue suggested delegating validation to `desktop-file-validate` rather than encoding key requirements in snapcraft. I went with this minimal in-tree fix to keep it focused and avoid a new external dependency, but I'm happy to take the delegation approach if the team prefers it. `ruff`, `ty`, and `make test-fast` (3628 passed, 0 failed) all pass. `make lint` fails locally only in its docs build (`TypeError: issubclass() arg 1 must be a class`, Sphinx on Python 3.14); I confirmed the same failure on a clean `upstream/main`, so it's pre-existing and unrelated to this change. --- - [x] I've followed the [contribution guidelines](https://github.com/canonical/snapcraft/blob/main/CONTRIBUTING.md). - [x] I've signed the [CLA](http://www.ubuntu.com/legal/contributors/). - [ ] I've successfully run `make lint && make test`. (Code linters and `make test-fast` pass; `make lint` docs build fails identically on clean `main`.) - [ ] I've added or updated any relevant documentation. (n/a) - [ ] In documents I changed, I added a meta description if one was missing. (n/a) - [ ] I've updated the relevant release notes. (n/a)

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged PR #6298 (commit ea842ae55) makes Snapcraft accept desktop entries lacking an Exec key, fixing #5799; Exec reformatting now only runs when the key exists and test_missing_exec_entry was updated.
stealth/space-bunny-alpha — closed resolved Merged PR #6298 (commit ea842ae55) makes Snapcraft accept desktop files without an Exec key, fixing #5799; formatting and tests were updated accordingly.
qwen/qwen3.6-35b-a3b — — Merged fix allowing desktop files without an Exec key. Snapcraft previously rejected valid D-Bus and systemd-activated entries. The change conditionally formats the Exec key only if present, updates tests, and passes CI.
qwen/qwen3.6-35b-a3b
Staleness: 45
Complexity: 15
Confidence: 85
needs review Fixes snapcraft rejecting valid desktop files missing an Exec key by making reformatting conditional. Updates tests. Currently awaiting maintainer review with passing CI and signed CLA.
qwen3.6-35b-a3b-mtp-q6
Staleness: 45
Complexity: 20
Confidence: 85
needs review Makes Exec key reformatting conditional to accept valid desktop entries without Exec keys, fixing #5799. Updates tests. CI passes except pre-existing lint docs failure. Ready for maintainer review.

Update history

Date Change
updated
updated
updated
updated
updated

Related work

  • Duplicate Of: canonical/snapcraft#5799 (confidence 95%)

    PR body states "Fixes #5799"; the issue was closed by this merge.

Related issues

Issue Project State Summary Similarity
#2722 meta: fixes for desktop file handling snapcraft merged Merged in snapcraft PR #2722 via dac7a776c and 81d13ed06, fixing multi-section desktop files and preserving arguments in Exec=.
82%
#1658123 Exec key from desktop files gets trimmed when installed by snapd snapcraft (launchpad) closed Snapcraft 2.25 emitted invalid Exec keys (e.g. `tus.tus`) for apps named like their parent package, so snapd stripped the key. Fixed by merged PR #1061 in commit b393badb4, which generates a proper Exec key for those apps.
77%
#5799 Valid desktop file without Exec key are rejected snapcraft closed Fixed by PR #6298 (commit ea842ae55), allowing valid desktop files without an Exec key while still rewriting Exec when present.
77%
#1061 Fix Exec key in desktop files for apps named like their parent package (LP: #1658123). snapcraft merged Merged PR #1061 fixed desktop-file Exec keys for apps whose names match their parent package, resolving LP #1658123 in commit b393badb4.
73%
#2435 Appstream desktop snapcraft merged Merged PR #2435 added AppStream-derived desktop-file support to Snapcraft, updating 10 files with 95.91% diff coverage.
71%