← Back to issue list

adopt-info not finding desktop files

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1805431
Type
issue
State
closed
Author
~apachelogger
Labels
19.04 19.04-blue 19.04-external
Created
Updated
Closed

Current evaluation

AppStream desktop-file lookup was fixed by merged PR snapcraft#2435 (commit 63a365159), correcting relative path resolution during extraction and metadata adoption.

Resolution: closed resolved

Reason: PR snapcraft#2435 was merged, and commit 63a365159 (“appstream extractor: properly find desktop files”) resolved the desktop-file path lookup problem.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Version: 2.43.1+18.04 the adopt-info based on appstream isn't working as intended. the method `_desktop_file_id_to_path` in appstream.py fails to actually resolve the desktop file paths because the working directory is wrong. I've added ``` print(desktop_file_path) print(os.getcwd()) ``` which results in ``` usr/share/applications/org.kde.kblocks.desktop /home/me/src/git/kblocks ``` this is of course wrong as the working directory should be inside the part's directory `/home/me/src/git/kblocks/parts/kblocks/install/` or thereabout. Or the desktop_file_path relative path would need adjusting to contain the relevant prefix. This results in `extract` actually not coming back with any desktop files being detected and rendering the automatic desktop file detection from the build state entirely broken. ADDITIONALLY The very same problem appears in the `_adopt_keys` method at snapping time, where the working directory is also the actual working directory of snapcraft while the desktop_file_path (which as I understand is basically what `_desktop_file_id_to_path` returned) would also be relative to "root". So it too fails a path check for exactly the same reason.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved AppStream desktop-file lookup was fixed by merged PR snapcraft#2435 (commit 63a365159), correcting relative path resolution during extraction and metadata adoption.
stealth/space-bunny-alpha — closed resolved Desktop-file lookup was fixed by merged PR snapcore/snapcraft#2435 (commit 63a365159), correcting AppStream path resolution during extraction and metadata adoption.
stealth/space-bunny-alpha — closed resolved Desktop-file path handling was fixed in canonical/snapcraft#1879 (75a919b2c), replacing ID-based lookup with explicit paths for extraction and adopt-info.
qwen/qwen3.6-35b-a3b — — Closed without comments or resolution, likely abandoned. The report detailed incorrect working directory handling in appstream.py that prevented desktop file detection during adopt-info extraction and snap time.
qwen/qwen3.6-35b-a3b — — Closed without resolution or comments. The working directory mismatch in appstream.py causing desktop file detection failures remains unfixed, likely abandoned or superseded.

Update history

Date Change
created

Related work

  • Likely Fixed By: snapcraft#2435 (confidence 100%)

    The merged PR contains commit 63a365159, which corrected AppStream desktop-file path resolution.

Related issues

Issue Project State Summary Similarity
#2435 Appstream desktop snapcraft merged Merged PR #2435 added AppStream-derived desktop-file support to Snapcraft, updating 10 files with 95.91% diff coverage.
76%
#1814898 appstream/desktop file icon extraction missing snapcraft (launchpad) closed Fixed by merged PR snapcore/snapcraft#2512 (commit 9e8601b80), adding desktop-file Icon= fallback and stock-icon lookup through the hicolor theme.
72%
#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=.
71%