flathub-infra / flatpak-builder-lint

A linter for flatpak-builder manifests
MIT License
50 stars 126 forks source link

desktopfile: Check that executable defined in Exec key exists in fs #405

Closed bbhtt closed 4 months ago

bbhtt commented 4 months ago

We can only do a filesystem check and we have to allow broken symlinks because the linter is being run outside of the target app's sandbox. So a executable file in files/bin/foo may point to a "broken" symlink like "/app/bin/bar", but this is valid when run inside the target app's sandbox.

Also strip all field spcifiers https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#exec-variables and env FOO=BAR or FOO=BAR to extract the actual executable from the Exec key

The paths are split into two because with builddir check the executable is in $path/files/bin/ but with repo check since we extract the subpath files/bin we get the contents of bin under tmpdir, not the parent directory bin itself. And extracting full files/ to get bin is costly.