Welcome! Please see the About page for a little more info on how this works.

0 votes
in Tools by

XDG_CONFIG_HOME does not need to be set explicitly, and tools follow XDG spec should just write to $HOME/.config/clojure

Right now, if XDG_CONFIG_HOME is not set, it just writes to $HOME/.clojure

more context here also:
https://clojureverse.org/t/opinion-about-xdg-support-by-the-clojure-tools-deps-cli/9814/3

by
Do XDG systems always have $HOME/.config even if it is empty? If not, then what if the CLI were the first tool to run in a new user account -- it wouldn't find $HOME/.config and XDG_CONFIG_HOME wouldn't be set, so wouldn't it deduce this was not an XDG system and write to $HOME/.clojure instead of $HOME/.config/clojure? (this question would apply to all tools in such an environment, so I'm wondering what creates $HOME/.config in the first place)
by
According to arch wiki, 'only XDG_RUNTIME_DIR is set by default through pam_systemd(8). It is up to the user to explicitly define the other variables according to the specification.'


https://wiki.archlinux.org/title/XDG_Base_Directory

But in reality, if you check how apps imp XDG spec, most of them just go by following logic without check XDG_RUNTIME_DIR i think.

1. if HOME/.clojure exist, use legacy path
2. else use XFG spec, (or (getenv XDG_CONFIG_HOME)  (path HOME/.config/clojure))

XDG_CONFIG_HOME (and the other xdg vars) are unset on most distros, and there are defined defaults that should be used instead. Here's the part clj tools get confused, because it should just write to my HOME/.config/clojure instead of fall back to legacy path.
by
On an arbitrary system, before installing Clojure, $HOME/.clojure will not exist -- so you are essentially requesting Clojure CLI switch to XDG on all systems, based on that logic in your comment.

Did I misunderstand you?

1 Answer

0 votes
by

The question continues to be: how could the Clojure CLI definitively know that you wish to use XDG configuration options. If there is a definitive answer to that question, I'd be happy to use that to select this behavior. We're not going to change that to be the default.

Another option would be to have a Clojure CLI specific environment variable that you could set to do that (but you're going to have to take that action).

...