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

XDG Cache and Data and State directories not supported, causing data to be stored in the wrong directories on Linux and Mac. #5140

Open
2 tasks done
kothawoc opened this issue Sep 13, 2024 · 4 comments

Comments

@kothawoc
Copy link

kothawoc commented Sep 13, 2024

Checklist

  • I have searched the issue tracker for open issues that relate to the same feature, before opening a new one.
  • This issue only relates to a single feature. I will open new issues for any other features.

Is your feature request related to a problem?

According to the XDG spec, I should be able to use cache and data directories.
https://specifications.freedesktop.org/basedir-spec/latest/index.html

This is also an issue for Macs too, but with their standards at:
https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPFileSystem/Articles/WhereToPutFiles.html

Is it possible to construct a solution with the existing API?

I don't believe so.

Describe the solution you'd like to see.

I think it would be sensible to some additional APIs used for these, rather than the existing myApp.Storage().RootURI().Path(), possibly have a CacheURI, ConfigURI, DataURI and StateURI.
I believe the RootURI could point at the ConfigURI for the current version so as to be 100% compatable. And the RootURI could be deprecated in v3 or when desired if you wish. For other platforms, they can just point at the same place.

@dweymouth
Copy link
Contributor

dweymouth commented Sep 13, 2024

To add to this, I wonder if the app storage directories should just be created at the root with the appID (~/.config/com.someapp/, ~/.cache/com.someapp/, etc) instead of being nested under a fyne directory. Users who go looking for the config files (linux users often do this) may not find it since they're not expecting it to be under a fyne directory

@dweymouth dweymouth added this to the "F" release, Late 2024 milestone Sep 13, 2024
@andydotxyz
Copy link
Member

I'm not sure how this applies to macOS?

@kothawoc
Copy link
Author

kothawoc commented Sep 15, 2024

When discussing the issue on discord, @dweymouth pointed out that the location was an issue on Macs too:

yeah new APIs could use a new location. A cache API would be especially handy to store things in ~/.cache/... and ~/Library/Caches/... (Mac)

The XDG standard places don't apply to Macs, that information can be found at:
https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPFileSystem/Articles/WhereToPutFiles.html

I just mentioned Macs as @dweymouth mentioned them, I can update the issue to reflect the Mac stuff, or remove it?

@andydotxyz
Copy link
Member

I just mentioned Macs as @dweymouth mentioned them, I can update the issue to reflect the Mac stuff, or remove it?

Well, the title mentions it but the body does not explain. If the source is a chat elsewhere the relevant info should have be pasted in here for people to follow. I can see from the document that cache applies to both. Not sure about data or state on Mac.

To add to this, I wonder if the app storage directories should just be created at the root with the appID

Just be sure we don't simply change location in an upgrade - would result in a lot of lost data.

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

No branches or pull requests

3 participants