Skip to content

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

Draft
sunlin7 wants to merge 1 commit into
syl20bnr:developfrom
sunlin7:custom-spacemacs-cache-dir
Draft

* core-load-paths.el: Support spacemacs-cache-directory from env variable#16706
sunlin7 wants to merge 1 commit into
syl20bnr:developfrom
sunlin7:custom-spacemacs-cache-dir

Conversation

@sunlin7

@sunlin7 sunlin7 commented Dec 9, 2024

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

sunlin7 commented Dec 23, 2024

Copy link
Copy Markdown
Contributor Author

@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

bcc32 commented Dec 23, 2024

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
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

sunlin7 commented Dec 30, 2024

Copy link
Copy Markdown
Contributor Author

@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