Skip to content

Xdg support: directories used for macOS #10398

Open
@AllanBlanchard

Description

@AllanBlanchard

Currently, XDG uses the same behavior for macOS and other Unix-like operating system. However, if one refers to the Apple Guidelines on directories organization, this should not be the case.

Xdg provides (I excluded home and runtime dir which are not important here):

  • XDG_DATA_HOME (as data_dir) -> ~/.local/share
  • XDG_CONFIG_HOME (as config_dir) -> ~/.config
  • XDG_CACHE_HOME (as cache_dir) -> ~/.cache
  • XDG_STATE_HOME (as state_dir) -> ~/.local/state

The macOS hierarchy is quite different and in fact, it is closer to the behavior that is currently implemented for Windows. As far as I understand the XDG standard and the Apple Documentation, we should have:

  • XDG_DATA_HOME (as data_dir) -> ~/Library/Application Support (W: LocalAppData)
  • XDG_CONFIG_HOME (as config_dir) -> ~/Library/Application Support (W: LocalAppData)
  • XDG_CACHE_HOME (as cache_dir) -> ~/Library/Application Support (W: LocalAppData)
  • XDG_STATE_HOME (as state_dir) -> ~/Library/Caches (W: InternetCache)

The main problem is that fixing this would basically break packages that use XDG. On the other side, it would improve compatibility with macOS tools (for example, automatic backups on macOS ignore ~/Library/Caches). Also, I am wondering what is the best way to detect that we use macOS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions