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 compatibility of cache #2797

Closed
kodebach opened this issue Jun 18, 2019 · 5 comments · Fixed by #3387
Closed

XDG compatibility of cache #2797

kodebach opened this issue Jun 18, 2019 · 5 comments · Fixed by #3387
Assignees
Labels
Milestone

Comments

@kodebach
Copy link
Member

Simple question: Is there any way to tell the cache plugin to use $XDG_CACHE_HOME/elektra instead of ~/.cache/elektra?

@mpranj
Copy link
Member

mpranj commented Jun 18, 2019

No, unfortunately not. Currently the resolver resolves the home directory, and the ".cache/elektra" below is hardcoded.

@markus2330
Copy link
Contributor

markus2330 commented Jun 19, 2019

Thank you for the question and answer.

As it is a global plugin, we could actually also easily make it configurable via /elektra/cache/path or similar.

And maybe also /elektra/cache/disable, then we would not need tools for caching at all?

rm -rf `kdb get /elektra/cache/path`

sounds a bit dangerous, though. So maybe one tool for cleaning the cache.

@mpranj
Copy link
Member

mpranj commented Jun 19, 2019

Sounds good to me!

So maybe one tool for cleaning the cache.

That should not be a problem, especially if the path is configured in /elektra/cache/path.

@mpranj mpranj added this to the 0.9.2 milestone Mar 1, 2020
@mpranj
Copy link
Member

mpranj commented Apr 9, 2020

Would it be sufficient if it respects XDG_CACHE_HOME instead of adding a /elektra/cache/path config as well? The XDG part is implemented now.

@markus2330
Copy link
Contributor

Yes, for now it should be fine, it fixes this issue.

For long term (maybe even after 1.0) I would prefer if Elektra's configuration would be completely specified, without any bypasses like env vars. Then people could specify that the path should be static or from the env var XDG_CACHE_HOME, as preferred. I am not sure if this would already work with the gopts plugin or if there are some bootstrapping issues (cache getting the key before gopts had a possibility to run).

For now, however, we should focus on that applications, i.e. our users, can specify everything. This is also more easy to implement, as no bootstrapping issues occur.

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.

3 participants