Skip Menu |

This queue is for tickets about the File-HomeDir CPAN distribution.

Report information
The Basics
Id: 88681
Status: rejected
Priority: 0/
Queue: File-HomeDir

People
Owner: Nobody in particular
Requestors: KENTNL [...] cpan.org
xenoterracide [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.00
Fixed in: (no value)



Subject: XDG Base Directory Specification
Date: Sat, 14 Sep 2013 10:11:35 -0500
To: bugs-file-homedir [...] rt.cpan.org
From: Caleb Cushing <xenoterracide [...] gmail.com>

On 2013-09-15 03:11:49, XENO wrote:
> please consider adding support for the following standard locations.
>
> http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
>
>

Actually, it *DOES* support it, its just not obvious, and its dependent on a specific system binary being present to trigger it.

The binary is called "xdg-user-dir"

If you don't have such a binary, it uses ::Unix , which uses non-xdg logic.

However, if you *DO* have such a binary, it uses ::FreeDesktop, which has all the xdg spec supported:

https://metacpan.org/source/ADAMK/File-HomeDir-1.00/lib/File/HomeDir/FreeDesktop.pm

Just this is incredibly not obvious from an end users perspective, and ... not all freedesktop systems have that binary installed. :(

I myself just today discovered one module I wrote, failed to find configuration data, because it was looking in all the wrong places.

Because for some reason, I had previously configured it in the presence of xdg-user-dir , so it use one set of paths, and then for some reason, that binary got uninstalled ( nothing in my system depended on it, so it got pruned ), resulting in File::HomeDir reverting to Unix behaviour.

Going to open a bug to request the documentation be improved with regard to this, because nothing in the docs presently indicates that will happen, only by source diving do you discover a hidden dependency that is changing behaviour.
 

Unless, if you want, we can re-purpose this one for that goal.

Added a bug with our downstream to get better integration.

The most obvious place downstream are likely to notice this for future maintainers are in Makefile.PL , if you can document there that there's a soft dependency on the xdg script which all freedesktop maintainers may want to install, that would help somewhat.

As to where it should be documented in File::HomeDir that you'll need such a utility to get XDG Homedir support, the FreeDesktop module would be a minimum, and somewhere in the main File::HomeDir documentation would be good too.

You basically want to be adding things that browser viewers / perldoc viewers will be able to find by grepping for XDG , FreeDesktop, or Linux. You don't have to list the things end users should install to get the script, but if you could list a few common ones that'd go far.

 

Subject: Re: [rt.cpan.org #88681] XDG Base Directory Specification
Date: Fri, 4 Oct 2013 09:47:19 -0500
To: bug-File-HomeDir [...] rt.cpan.org
From: Caleb Cushing <xenoterracide [...] gmail.com>
On Fri, Oct 4, 2013 at 1:11 AM, Kent Fredric via RT <bug-File-HomeDir@rt.cpan.org> wrote: Show quoted text
> Actually, it *DOES* support it, its just not obvious, and its dependent on a > specific system binary being present to trigger it. > > The binary is called "xdg-user-dir" > > If you don't have such a binary, it uses ::Unix , which uses non-xdg logic. > > However, if you *DO* have such a binary, it uses ::FreeDesktop, which has all > the xdg spec supported: > > https://metacpan.org/source/ADAMK/File-HomeDir-1.00/lib/File/HomeDir/FreeDesktop.pm > > Just this is incredibly not obvious from an end users perspective, and ... not > all freedesktop systems have that binary installed. :(
the spec doesn't require said binary AFAIK, so that's somewhat debatable. I certainly don't keep it installed. I can see how that binary would make supporting the spec /easier/. Show quoted text
> Going to open a bug to request the documentation be improved with regard to > this, because nothing in the docs presently indicates that will happen, only by > source diving do you discover a hidden dependency that is changing behaviour.
ultimately I think the behavior is wrong, (without source diving myself), if it's using the binary to actually determine where things are that should be documented and perhaps a "patches welcome" note to remove it. If it's simply a heuristic then it fails to meet the spec. I think it's fine to use this bug to request further documentation on the behavior, though I will continue to suggest that the behavior itself needs work (freedesktop should be default, with unix a fallback in the event of failure, IMO, though perhaps a bit of a check unix to see if file exists and migrate it logic is also needed) -- Caleb Cushing http://xenoterracide.com Calendar: https://www.google.com/calendar/embed?src=xenoterracide%40gmail.com&ctz=America/Chicago

On 2013-10-05 03:47:33, XENO wrote:

> ultimately I think the behavior is wrong, (without source diving
> myself), if it's using the binary to actually determine where things
> are that should be documented and perhaps a "patches welcome" note to
> remove it. If it's simply a heuristic then it fails to meet the spec.

Just the really annoying thing is if you use any other heuristic, you're going to meet the ire of people who have been silently using File::HomeDir on linux, where it operates in Unix mode, for the last 4+ years, and changing anything that grossly changes configuration paths for practically everything, magically, at the drop of a hat, is going to make a lot of people mad/confused.

It wouldn't be so bad if File::HomeDir was oriented so that people who had XDG support but files in UNIX paths would still have a working system, ie: If it had been standard that File::HomeDir returns a *list* of directories instead of a singular directory, then the FreeDesktop one could return ( $XDG_PATH, $UNIX_PATH ), and underlying tools would just work.

However, it doesn't, so we need a better approach.

 

Dear Caleb, I reviewed the discussion and even if you have very good arguments for new software, the arguments fail for legacy software. I keep it in mind when talking with Perl 6 people regarding porting importing Perl 5 modules (see https://www.perl.com/article/an-open-letter-to-the-perl-community/). You can hijack that attempt by creating a much better File::HomeDir for Perl 6 (and then I owe you a $beer).
Added some additional lines explaining the status quo.