Skip to content

appimageTools.wrapAppImage: Fix passing arguments to wrapped executable#128927

Merged
Mic92 merged 1 commit intoNixOS:masterfrom
andersk:appimage
Jul 21, 2021
Merged

appimageTools.wrapAppImage: Fix passing arguments to wrapped executable#128927
Mic92 merged 1 commit intoNixOS:masterfrom
andersk:appimage

Conversation

@andersk
Copy link
Copy Markdown
Contributor

@andersk andersk commented Jul 2, 2021

Motivation for this change

appimage-exec.sh parses its arguments with getopts, so we need to delimit arguments intended for the wrapped executable with --, in case some of them begin with -.

Without this fix, a wrapped application like Zulip Desktop can’t be opened the normal way using the .desktop file, which includes Exec=zulip --no-sandbox %U (as per the electron-builder default):

$ gtk-launch zulip.desktop
/usr/bin/appimage-exec.sh: illegal option -- -
Usage: appimage-run [appimage-run options] <AppImage> [AppImage options]
[…]

Cc @bignaux (author of #81833)

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • 21.11 Release Notes (or backporting 21.05 Relase notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

appimage-exec.sh parses its arguments with getopts, so we need to
delimit arguments intended for the wrapped executable with ‘--’, in
case some of them begin with ‘-’.

Without this fix, a wrapped application like Zulip Desktop can’t be
opened the normal way using the .desktop file, which includes
‘Exec=zulip --no-sandbox %U’ (as per the electron-builder default):

$ gtk-launch zulip.desktop
/usr/bin/appimage-exec.sh: illegal option -- -
Usage: appimage-run [appimage-run options] <AppImage> [AppImage options]
[…]

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
@cole-h
Copy link
Copy Markdown
Member

cole-h commented Jul 2, 2021

@ofborg eval

(Sorry, ofborg's certs recently had an issue, meaning that it was unable to
react to PRs. This has been fixed, but all PRs filed in this period will need
ofborg to be manually kicked off.)

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. labels Jul 2, 2021
@andersk andersk requested a review from Mic92 July 19, 2021 23:19
@Mic92 Mic92 merged commit 436c1a9 into NixOS:master Jul 21, 2021
@andersk andersk deleted the appimage branch July 21, 2021 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0.kind: bug Something is broken 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants