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

Updating flatpak breaks already installed flatpaks #43581

Closed
hedning opened this issue Jul 15, 2018 · 1 comment · Fixed by #44366
Closed

Updating flatpak breaks already installed flatpaks #43581

hedning opened this issue Jul 15, 2018 · 1 comment · Fixed by #44366
Labels

Comments

@hedning
Copy link
Contributor

hedning commented Jul 15, 2018

Issue description

When installing flatpaks the current flatpak binary is hardcoded in the application launchers, eg.:

/var/lib/flatpak/app/org.kde.krita/current/active/export/bin
❯ cat org.kde.krita 
#!/bin/sh
exec /nix/store/khqdfyd4ddlrssp0wdv8rvx7ry9yy3a8-flatpak-0.99.2/bin/flatpak run --branch=stable --arch=x86_64 org.kde.krita "$@"

When flatpak is upgraded (and the old one garbage collect) the launchers stop working due to the dead flatpak path. It's then necessary to reinstall the application to update the launchers.

The code that creates the launchers:
https://github.com/flatpak/flatpak/blob/master/common/flatpak-dir.c#L5470
https://github.com/flatpak/flatpak/blob/master/common/flatpak-dir.c#L6648

Looks like FLATPAK_BINDIR is configurable at build time, but not sure where it should point (I'm guessing we can assume flatpak is only useful on NixOS which might make this solvable).

cc @jtojnar

Steps to reproduce

  1. Install some application using flatpak
  2. Update the flatpak derivation (eg. via. nixos-rebuild)
  3. Broken packges 😢

Technical details

  • system: "x86_64-linux"
  • host os: Linux 4.17.6, NixOS, 18.09.git.be979263ece (Jellyfish)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.0.4
  • channels(hed): "unstable-18.03pre126246.a4f433c03cc"
  • channels(root): "nixos-17.09.3254.967e40787c5"
  • nixpkgs: /home/hed/nixpkgs/channel
@jtojnar
Copy link
Member

jtojnar commented Jul 15, 2018

What a fun thing. I think we cannot solve this any other way than patching the generator to use /usr/bin/env. At least for the interactively installed packages, which will be the majority even if we implement the declarative installation (#30336).

hedning added a commit to hedning/nixpkgs that referenced this issue Aug 2, 2018
The hardcoded flatpak path breaks all installed applications when flatpak is
updated.

fixes: NixOS#43581
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants