Skip Menu |

This queue is for tickets about the CPAN CPAN distribution.

Report information
The Basics
Id: 62986
Status: resolved
Priority: 0/
Queue: CPAN

People
Owner: Nobody in particular
Requestors: schmorp [...] schmorp.de
Cc:
AdminCc:

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



Subject: File::HomeDir 0.93 (maybe earlier) breaks CPAN
Date: Mon, 15 Nov 2010 02:06:51 +0100
To: bug-CPAN [...] rt.cpan.org
From: Marc Lehmann <schmorp [...] schmorp.de>
After upgrading to File::HomeDir 0.93, cpan suddenly told me I needed to do configuration again. The reason was found quickly: File::HomeDir apparently returns $HOME/.local/share as the directory to put the .cpan dir in, which means the correct location ($HOME/.cpan) is ignored. This is either a bug in the docs (which say File::HomeDir is only used on windows) AND in the cpan code OR a bug just in the cpan code: If cpan wishes to use the xdg basedir directories (a stupid idea, IMHO, changing the cpan directory location after a a decade or even more), then it would actually need to put the caches into the xdg cache directory ($HOME/.cache/cpan), not the data directory ($HOME/.local/share/.cpan), and arguably, the build directories are also cached files, not application data. Last not leats, config fiels would need to go to $HOME/.config. In my opinion, doing what the documentation claims (using File::HomeDir only on windows) would probably the best approach. Breaking each and every cpan unix install is not really sensible at this point, especially as CPAN doesn't even follow the xdg standard :) (Maybe somebody could convince the File::HomeDir maintainer to revert this, as many methods just croak because they are suddenly no longer supported, so apparently xdg doesn't map well on what File::HomeDir wants to know, but regardless, the real issue is in CPAN). -- The choice of a Deliantra, the free code+content MORPG -----==- _GNU_ http://www.deliantra.net ----==-- _ generation ---==---(_)__ __ ____ __ Marc Lehmann --==---/ / _ \/ // /\ \/ / schmorp@schmorp.de -=====/_/_//_/\_,_/ /_/\_\
Subject: Re: [rt.cpan.org #62986] File::HomeDir 0.93 (maybe earlier) breaks CPAN
Date: Sun, 14 Nov 2010 21:10:29 -0500
To: bug-CPAN [...] rt.cpan.org
From: David Golden <dagolden [...] cpan.org>
On Sun, Nov 14, 2010 at 8:07 PM, Marc Lehmann via RT <bug-CPAN@rt.cpan.org> wrote: Show quoted text
> After upgrading to File::HomeDir 0.93, cpan suddenly told me I needed to > do configuration again. > > The reason was found quickly: File::HomeDir apparently returns > $HOME/.local/share as the directory to put the .cpan dir in, which means > the correct location ($HOME/.cpan) is ignored. > > This is either a bug in the docs (which say File::HomeDir is only used on > windows) AND in the cpan code OR a bug just in the cpan code:
FWIW, I think I'm ready to see File::HomeDir pulled from CPAN.pm. This sort of thing bug has bitten before (Mac OSX, I think). The other option would be to have a series of fallbacks for where to find the config directory, I suppose. Andreas -- what do you think? -- David
With File::HomeDir we had nothing but trouble. I'll be a happy man when it is pulled out. We can leave it in for Windows users. See RT #17759 for how it came about that File::HomeDir was introduced (in revision e751349a). At that point in time I had the impression that File::HomeDir on UNIX will always return $HOME for my_data(). Clearly wrong expectations on my side. What I don't know is how OSX will be affected by the pull.
Subject: Re: [rt.cpan.org #62986] File::HomeDir 0.93 (maybe earlier) breaks CPAN
Date: Mon, 15 Nov 2010 13:32:59 +0100
To: Andreas Koenig via RT <bug-CPAN [...] rt.cpan.org>
From: Marc Lehmann <schmorp [...] schmorp.de>
On Sun, Nov 14, 2010 at 10:18:30PM -0500, Andreas Koenig via RT <bug-CPAN@rt.cpan.org> wrote: Show quoted text
> on UNIX will always return $HOME for my_data(). Clearly wrong > expectations on my side. What I don't know is how OSX will be affected > by the pull.
Seems File::HomeDir has custom implementations for darwin=osx, legacy mac os and windows. ($^O = darwin|MacOS|Win32), so maybe it should be used for those, for backwards compatibility. I also don't know how old this File::HomeDir change is, so there certainly will be breakage on some unix boxes where a newer version was in-use for a while. -- The choice of a Deliantra, the free code+content MORPG -----==- _GNU_ http://www.deliantra.net ----==-- _ generation ---==---(_)__ __ ____ __ Marc Lehmann --==---/ / _ \/ // /\ \/ / schmorp@schmorp.de -=====/_/_//_/\_,_/ /_/\_\
1.94_63 has the config option use_file_homedir which defaults to false on Unix. That way all users can turn it on or off and the defaults are sane. Thanks for the report
Ticket reopened. I have reverted the solution with use_file_homedir. It was not sufficient to address the problem. At the point in time when the config file is read to determine the value of use_file_homedir it may already be too late because F:HD may already have been involved in determining the location of the config file itself.
This has been fixed in 1.94_64 released to CPAN. Given a list of directories from File::HomeDir and $ENV{HOME}, CPAN will use the first that contains .cpan/CPAN/MyConfig.pm, otherwise the first that contains .cpan, otherwise, the first. This means that if there is an existing ~/.cpan, upgrading File::HomeDir will not change which directory is used. -- David