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 XDG_STATE_HOME and HOST_XDG_STATE_HOME env variables #4478
Conversation
Presumably you mean |
Please do? That would have caught several mistakes. |
The Steam Flatpak app has had a lot of trouble with games/apps that blindly assume It's far too late for us to avoid that problem for However, because That would also have the benefit that it's the same directory that would be used by apps built with |
Note that there is no persistent app-private home directrory, unless the flatpak app has |
I didn't mean to imply that it is. There is always an app-private directory: it's where If apps want to use |
Ah, sorry, I was confused by
This change seems trivial - why not backport it? |
Not all distributions use our stable releases. Some distributions are using branches that we no longer support, and backporting individual security fixes themselves; other distributions are using branches that we do support, but backporting security fixes themselves instead of using the stable releases that we provide for this purpose. We cannot make new features available in distributions that go out of their way to avoid them, but app authors presumably want their apps to work on those distributions anyway. Even for those distros that do take our stable releases as-is, we need to "pick our battles": the more new features we backport, the more likely those distros become to stop accepting our stable releases as being sufficiently low-risk. |
I think that what could really help Steam flatpak a lot is an opt-in alternate
|
For cache/config/data: yes that seems good, but it's out of scope for this MR (and it's a new feature, so the Steam Flatpak app will not be able to rely on it for several years). For state, I think the right thing to do is to always use the layout with |
If such selectable layouts are to be implemented, I think it could be made on per-variable basis (e.g. |
That sounds bad for test coverage: 4 boolean settings means 16 combinations, and realistically nobody is going to test them all. I'd rather have a single configuration that is heavily tested and works, or perhaps eventually one boolean to use |
I've now tested that it works, made it use .local/state as per discussion here and fixed all of the previous reviews. Sorry for not testing it from the start, I was just hoping this would be a simple stupid copy-paste job (and that was a mistake). |
This should really have automated test coverage, but I noticed we don't have test coverage for XDG_DATA_HOME, etc. either. I've added test coverage for this whole family of variables as an extra commit on your branch. |
I've expanded this to create |
Would it work either way? Isn't
It's kind of unfortunate that using |
Correct, unless the app uses
I am not aware of apps that are using [edit: |
Okay, this LGTM aside from the couple things I pointed out. With those fixed, we can merge unless you think we should wait for Alex to review it. And then we will want to update docs.flatpak.org since that mentions the default values of these XDG dirs: flatpak/flatpak-docs#311 |
This gives new support for the new XDG_STATE_HOME addition to XDG_BASE_DIRS which allows applications to use this without breaking because they would assume $HOME/.local/state which may be unavailable to the flatpak This adds it as .local/state as to make --persist=.local/state the same behaviour as in new flatpak. This in turn means that the transition should be seamless between old and new flatpak. This also has the benefit of working if the application doesn't follow XDG spec thanks to --persist=.local/state. This fixes flatpak#4477 [smcv: Don't call nonexistent g_get_user_state_dir(); fix a reference to XDG_STATE_DIR]
Signed-off-by: Simon McVittie <smcv@collabora.com>
Signed-off-by: Simon McVittie <smcv@collabora.com>
Signed-off-by: Simon McVittie <smcv@collabora.com>
Signed-off-by: Simon McVittie <smcv@collabora.com>
This is placed at the same location that would be used by the --persist=.local/state option. Signed-off-by: Simon McVittie <smcv@collabora.com>
Signed-off-by: Simon McVittie <smcv@collabora.com>
lgtm |
This gives new support for the new XDG_STATE_HOME addition to XDG_BASE_DIRS which allows applications to use this without breaking because they would assume $HOME/.local/state which may be unavailable to the flatpak
This adds it as .local/state as to make --persist=.local/state the same behaviour as in new flatpak. This in turn means that the transition should be seamless between old and new flatpak.
This also has the benefit of working if the application doesn't follow XDG spec thanks to --persist=.local/state.
This fixes #4477