desktop: Check if binary from Exec key exists in PATH (take 2) #681
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The main problem here is the linter is running from "outside" of the target app, not inside its
flatpak runor equivalent sandbox.So using
GLib.find_program_in_pathwill find the program in the "parent" env and always fail.We need to use a worse alternative, something like
os.access(os.path.join(bin_path, executable), X.OK)wherebin_pathis<builddir>/files/binor<path_to_extracted_repo>/files/binbut that comes with its own set of issues.We can extract from the exported repo, but the executable calculated inside it might be a symlink to something else somewhere. This quickly goes in the issue that we need to extract the entire ostree repo, and even then resolving symlinks may fail.
We have a lot of large apps and extracting the entire repo is not sustainable — we might run out of space.