Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build-export: Proper validation of Exec line in desktop file #4817

Merged
merged 3 commits into from
Aug 16, 2022

Conversation

dbrgn
Copy link
Contributor

@dbrgn dbrgn commented Mar 22, 2022

Here's an attempt at explicitly allowing empty Exec values, as discussed here: flatpak/flatpak-docs#324 (comment)

Additionally, I found and fixed a segfault that occurred when the Exec line is omitted from the desktop file.

@dbrgn dbrgn force-pushed the build-export-exec-validation branch from 3f9dcc2 to d36fbc7 Compare March 22, 2022 17:58
The Desktop Entry spec says that Exec= is only required if
DBusActivatable= is not set to true, so don't emit a warning when Exec=
is missing but not required.
@mwleeds
Copy link
Collaborator

mwleeds commented Mar 25, 2022

It's a little strange that Flatpak allows build-export to succeed with warnings even when the desktop file is invalid. I assume the reasoning is that the warnings (those generated in validate_desktop_file() or those generated by desktop-file-validate) might not be critical errors so the app may still be usable. But desktop-file-validate only returns a non-zero status when the file is breaking a spec requirement, not when there's merely a warning. desktop-file-validate doesn't currently return a non-zero status when the Exec= key is missing and DBusActivatable=true is not set, but it should.

That all makes me wonder if we should be allowing the export of desktop files that have no Exec= line and don't have DBusActivatable=true.

In any case, I added a commit here to avoid printing a warning when Exec= is missing but DBusActivatable=true is present, so that will need to be reviewed by another maintainer.

@mwleeds mwleeds added this to the 1.14.0 milestone Jul 23, 2022
@alexlarsson alexlarsson merged commit 60005cf into flatpak:main Aug 16, 2022
@dbrgn dbrgn deleted the build-export-exec-validation branch August 16, 2022 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants