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

fix: download runtime to private cache for flatpak #220

Merged

Conversation

R1kaB3rN
Copy link
Member

Fixes #219

@zocker-160
Copy link

zocker-160 commented Oct 11, 2024

I think it would be better to use XDG_CACHE_HOME instead.
Inside Flatpak this resolves to the same path that you are hardcoding right now, which is /home/USER/.var/app/APPID/cache and use the default path when not set.

@R1kaB3rN
Copy link
Member Author

The problem with $XDG_CACHE_HOME is that we could be downloading to a client's private Flatpak cache directory. For instance, Heroic and Lutris sources umu-launcher in its runtime and when they call umu-run, the value of $XDG_CACHE_HOME will be Heroic's instead of umu-launcher. This could cause the runtime to be downloaded there, which is not what we want. We want to centralize all Steam Runtime installations in a single place, so there isn't runtimes everywhere.

@R1kaB3rN R1kaB3rN marked this pull request as ready for review October 11, 2024 19:02
@R1kaB3rN R1kaB3rN merged commit 0001a48 into Open-Wine-Components:main Oct 11, 2024
8 checks passed
@R1kaB3rN R1kaB3rN deleted the flatpak-cross-device-link branch October 11, 2024 19:04
@zocker-160
Copy link

zocker-160 commented Oct 11, 2024

@R1kaB3rN but isn't that actually desirable?

When I use lutris Flatpak, the folder it tries to access .var/app/org.openwinecomponents.umu.umu-launcher does not exist.

Do the default permissions even allow to create and write to that folder?

We want to centralize all Steam Runtime installations in a single place, so there isn't runtimes everywhere.

I don't think this is possible with the current permissions.

@zocker-160
Copy link

zocker-160 commented Oct 11, 2024

seems like I can write to that folder, but it is not persisting, I feel like this could cause issues.

$ flatpak run --command=sh net.lutris.Lutris 
[📦 net.lutris.Lutris ~]$ mkdir .var/app/org.openwinecomponents.umu.umu-launcher
[📦 net.lutris.Lutris ~]$ echo "test" > .var/app/org.openwinecomponents.umu.umu-launcher/test
[📦 net.lutris.Lutris ~]$ cat .var/app/org.openwinecomponents.umu.umu-launcher/test 
test
[📦 net.lutris.Lutris ~]$ exit
$ flatpak run --command=sh net.lutris.Lutris 
[📦 net.lutris.Lutris ~]$ cat .var/app/org.openwinecomponents.umu.umu-launcher/test
cat: .var/app/org.openwinecomponents.umu.umu-launcher/test: No such file or directory
[📦 net.lutris.Lutris ~]$ 

@Mershl
Copy link
Contributor

Mershl commented Oct 13, 2024

see flathub/net.lutris.Lutris#440 (comment)
a short-term workaround has been implemented in flatpak lutris

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

Successfully merging this pull request may close these issues.

[flatpak] Invalid cross-device link
3 participants