Skip to content

feat(hx-cache): support XDG_CONFIG_HOME and XDG_CACHE_HOME - #18

Open
edvardm wants to merge 1 commit into
arcanist-sh:mainfrom
edvardm:fix/xdg-config-cache-dirs
Open

feat(hx-cache): support XDG_CONFIG_HOME and XDG_CACHE_HOME#18
edvardm wants to merge 1 commit into
arcanist-sh:mainfrom
edvardm:fix/xdg-config-cache-dirs

Conversation

@edvardm

@edvardm edvardm commented Aug 22, 2026

Copy link
Copy Markdown

Adds support for $XDG_CONFIG_HOME and $XDG_CACHE_HOME in global_config_dir()/global_cache_dir(). These currently resolve via ProjectDirs, following the platform-native convention (e.g. ~/Library/Application Support on macOS); this lets that be overridden when a user sets an XDG var.

Falls back to the platform default otherwise.

All green (build, test, clippy, fmt) + 5 new unit tests.

@edvardm
edvardm force-pushed the fix/xdg-config-cache-dirs branch from 43c8864 to 18fc151 Compare August 22, 2026 19:04
@edvardm edvardm changed the title fix(hx-cache): respect XDG_CONFIG_HOME and XDG_CACHE_HOME feat(hx-cache): support XDG_CONFIG_HOME and XDG_CACHE_HOME Aug 22, 2026
global_config_dir() and global_cache_dir() currently resolve via ProjectDirs,
which follows the platform-native convention (e.g. ~/Library/Application
Support on macOS). This adds support for $XDG_CONFIG_HOME/$XDG_CACHE_HOME,
respected when set (non-empty), so users who manage dotfiles across Linux
and macOS can keep config/cache locations consistent. Falls back to the
platform default otherwise, on any platform.

toolchain_dir()/toolchain_bin_dir() are unaffected: they already deliberately
bypass ProjectDirs for GHC's paths-with-spaces requirement.
@edvardm
edvardm force-pushed the fix/xdg-config-cache-dirs branch from 18fc151 to e9406a6 Compare August 22, 2026 19:05
@edvardm
edvardm marked this pull request as ready for review August 22, 2026 19:08
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.

1 participant