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
Add a way to export multiple commands #5404
base: main
Are you sure you want to change the base?
Conversation
Add and --export-command=COMMAND option to the build-finish command, export it under the exported-commands key in the metadata file, and generate APPID-command shell wrappers for each of them.
This feels a bit weird. This means you could end up with something like |
You just can't override commands safely. There would have to be some user intervention for them to opt-in to that. |
I'm saying that |
Maybe this was discussed at LAS… @ramcq at one point you had suggested that this would be a more general approach that would allow Flatpak apps to export native messaging hosts, where the protocol only allows executing a single command, not a command with arguments? |
I don't really agree with the need for Flatpak to get involved in aliasing. Applications which are not sandboxed manage to export the binaries they want with the names they want in /bin or /usr/bin - why is this suddenly not possible because the same commands are in /app? I reviewed the bin dirs of the ~100 Flatpaks installed on my system and there were 2 which might've needed a little adjustment (eg |
Indeed! Being able to export one more binary entry point is pre-work for being able to rewrite the native messaging host files to a binary that exists on the host system. See flatpak/xdg-desktop-portal#705 (comment) |
The feature is targeted at native messaging hosts in browsers, where the json file defining them can only list a bare command, not a commandline with arguments. Therefore, the idea is to let flatpaked messaging hosts export a shell script wrapper that runs them with the right arguments. We should probably enforce reasonable limits on the command names - no spaces, newlines, slashes, not more than 60-80 chars... |
This was an oversight from copying the original wrapper setup code. Co-authored-by: Robert McQueen <[email protected]>
As pointed out in review, '-' has a risk of being ambiguous, since it is allowed in the APP_ID. Update the docs and provide some more guidance on suitable COMMAND names.
Avoid obvious nonsense.
c1288a6
to
f2ebccf
Compare
It might be helpful to describe this feature as "exporting more than one executable" rather than "exporting more than one command", to make it more clear that it's a way for a Flatpak app that contains both Use cases:
Non-use-cases:
|
I'm in favour of giving the possibility to export as |
No. This would conflict with the system binaries, and several apps exporting the same command could be messy. It's best just to add the appropriate terminal exports to the PATH. |
<varlistentry> | ||
<term><option>--require-version=MAJOR.MINOR.MICRO</option></term> | ||
|
||
<listitem><para> | ||
Require this version or later of flatpak to install/update to this build. | ||
</para></listitem> | ||
</varlistentry> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicated by accident?
Add and --export-command=COMMAND option to the
build-finish command, export it under the exported-commands key in the metadata file, and generate
APPID-command shell wrappers for each of them.
Fixes #5395
Untested, and undocumented so far.