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

* core-load-paths.el: Support spacemacs-cache-directory from env variable #16706

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

sunlin7
Copy link
Contributor

@sunlin7 sunlin7 commented Dec 9, 2024

Fix the #12127 by supporting the spacemacs-cache-directory from environment variable SPACEMACSCACHE or XDG_CACHE_HOME.

NOTE:
This PR can be the first step to start supporting the XDG_* directories to fix #3589.

@fnussbaum
Copy link
Collaborator

I think that XDG_CACHE_HOME/spacemacs/ should not be created and used as spacemacs-cache-directory by default, as long as the latter is still used to store data that should persist (and thus should rather be in XDG_{DATA/CONFIG/STATE}_HOME).

…able

Support initializing the spacemacs-cache-directory from environment
variable SPACEMACSCACHE or XDG_CACHE_HOME.
@sunlin7 sunlin7 force-pushed the custom-spacemacs-cache-dir branch from 56f1b49 to 68e7e31 Compare December 23, 2024 18:09
@sunlin7
Copy link
Contributor Author

sunlin7 commented Dec 23, 2024

@fnussbaum Thanks for comment, I had change the code to detect the XDG_CACHE_HOME/spacemacs/ exists or not, please help review again. CC @bcc32

@bcc32
Copy link
Collaborator

bcc32 commented Dec 23, 2024

I think @fnussbaum's comment extends beyond the changes you made. If I understand correctly, we should not use $XDG_CACHE_HOME/spacemacs even if it exists already while persistent state data is still stored using spacemacs-cache-directory. So, we'd have to first audit the places where spacemacs-cache-directory and create a separate variable, perhaps spacemacs-state-directory, for things that should be persisted, before making any of the changes in this PR. (Please feel free to correct me if I misunderstood your comment).

@fnussbaum
Copy link
Collaborator

This is a good point, it is indeed better to first clean up the use of the cache directory, thanks @bcc32. (I can see how my comment might have been slightly ambiguous.)

@sunlin7 Thanks for taking the initiative with #16759! I'll need some more time to review it, as I would like to make sure that we do this correctly for all kinds of files, and document it well, such that users that would like to use the new locations can easily migrate, and only have to do it once. It might also make sense to adopt the no-littering package, but I am not so sure about it yet.

@sunlin7
Copy link
Contributor Author

sunlin7 commented Dec 30, 2024

@fnussbaum Thank you for looking into this, look forward the progress : )

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.

support XDG Base Directory Specification
3 participants