👋 I'm down a bit of a rabbit hole -- let me explain first where I'm coming from and then my quick proposal
I am building a docker image which intentionally does not provide a writable home directory -- but instead provides a bunch of writable $XDG_... directories. I've noticed that cpan uses this module to determine where to write its configuration on first startup but File::HomeDir->my_data is always returning the home directory
I can work around this by installing xdg-user-dirs manually, or providing a placeholder executable by the same name -- but I don't think that executable should be necessary at all since most modern posixlikes support the XDG "standard"
personally, I would like to see the FreeDeskptop implementation be the default on posixlikes but that might be too aggressive of a change -- perhaps a more middle ground would be to have the default Unix implementation respect the $XDG_* variables even if the xdg-user-dirs executable isn't present (since it's kind of rare to install this in a docker image, even if you want the functionality)
the directories from xdg-user-dirs are also easily derivable without running the xdg-user-dir subprocess -- since they're specified: https://wiki.archlinux.org/title/XDG_user_directories
👋 I'm down a bit of a rabbit hole -- let me explain first where I'm coming from and then my quick proposal
I am building a docker image which intentionally does not provide a writable home directory -- but instead provides a bunch of writable
$XDG_...directories. I've noticed thatcpanuses this module to determine where to write its configuration on first startup butFile::HomeDir->my_datais always returning the home directoryI can work around this by installing
xdg-user-dirsmanually, or providing a placeholder executable by the same name -- but I don't think that executable should be necessary at all since most modern posixlikes support the XDG "standard"personally, I would like to see the FreeDeskptop implementation be the default on posixlikes but that might be too aggressive of a change -- perhaps a more middle ground would be to have the default Unix implementation respect the
$XDG_*variables even if thexdg-user-dirsexecutable isn't present (since it's kind of rare to install this in a docker image, even if you want the functionality)the directories from
xdg-user-dirsare also easily derivable without running thexdg-user-dirsubprocess -- since they're specified: https://wiki.archlinux.org/title/XDG_user_directories