Skip Menu |
 

This queue is for tickets about the CPAN CPAN distribution.

Report information
The Basics
Id: 26886
Status: open
Priority: 0/
Queue: CPAN

People
Owner: Nobody in particular
Requestors: mf [...] mfedv.net
Cc:
AdminCc:

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



Subject: module build directories as tempdirs: better not
Date: Wed, 02 May 2007 13:48:37 +0200
To: bug-CPAN [...] rt.cpan.org
From: Matthias Ferdinand <mf [...] mfedv.net>
Download (untitled) / with headers
text/plain 1014b
Hello, in CPAN 1.9101 (probably since CPAN 1.90), the module build directories under $CPAN::Config->{'build_dir'} are created as temp dirs with names like Module-1.2-yf0Qrz/ Every invocation of CPAN::Module::get now creates a new extracted directory no matter how often that module has been unpacked before, which is wasting disk space. I guess it would be ok if an old existing build dir of the same name would be purged, avoiding a cluttered directory after unpacking, but the build directory name should stay the same across CPAN invocations. I am using a tool to automatically extract Changelogs from distribution files and send them as a mail report. For every invocation of that tool and every upgradeable module a new temp dir is created and never deleted. Together with a bug of not honoring $CPAN::Config->{'build_cache'} (see http://rt.cpan.org/Ticket/Display.html?id=26884 ) this has led to enormous build cache sizes (>500MB) and disk full conditions. Best regards Matthias Ferdinand
Subject: Re: [rt.cpan.org #26886] module build directories as tempdirs: better not
Date: Wed, 02 May 2007 20:58:07 +0200
To: bug-CPAN [...] rt.cpan.org
From: andreas.koenig.7os6VVqR [...] franz.ak.mind.de (Andreas J. Koenig)
Download (untitled) / with headers
text/plain 1.8k
Show quoted text
>>>>> On Wed, 02 May 2007 07:49:23 -0400, "mf@mfedv.net via RT" <bug-CPAN@rt.cpan.org> said:
Show quoted text
> in CPAN 1.9101 (probably since CPAN 1.90), the module build directories > under $CPAN::Config->{'build_dir'} are created as temp dirs with names like
Show quoted text
> Module-1.2-yf0Qrz/
Show quoted text
> Every invocation of CPAN::Module::get now creates a new extracted directory > no matter how often that module has been unpacked before, which is wasting > disk space.
But finally it is providing you the safety that you own this directory! Show quoted text
> I guess it would be ok if an old existing build dir of the same name would > be purged, avoiding a cluttered directory after unpacking, but the build > directory name should stay the same across CPAN invocations.
Maybe you have not yet discovered the power of build_dir_reuse? Otherwise I do not feel comfortable with going back to the previous lessez faire in the build_dir. I did introduce the use of File::Temp with a reason after all. Processes and even different perl versions may share the build_dir directory. If you set build_dir_reuse to a true value, you *will* reuse the same directory of every distro with the same perl. Let me know if this is what you're really looking for. Show quoted text
> I am using a tool to automatically extract Changelogs from distribution > files and send them as a mail report. For every invocation of that tool and > every upgradeable module a new temp dir is created and never deleted. > Together with a bug of not honoring $CPAN::Config->{'build_cache'} (see > http://rt.cpan.org/Ticket/Display.html?id=26884 ) this has led to enormous > build cache sizes (>500MB) and disk full conditions.
I agree that there should be a way to invoke the manager cleanup routine. Currently it is only invoked on new invocations of the shell. And not by batch jobs. Ahhh, I see, this is probably much closer to what you need, right? -- andreas
Subject: Re: [rt.cpan.org #26886] module build directories as tempdirs: better not
Date: Thu, 03 May 2007 00:25:50 +0200
To: bug-CPAN [...] rt.cpan.org
From: Matthias Ferdinand <mf [...] mfedv.net>
Download (untitled) / with headers
text/plain 2.1k
--On Mittwoch, Mai 02, 2007 15:01:22 -0400 "(Andreas J. Koenig) via RT" <bug-CPAN@rt.cpan.org> wrote: Show quoted text
> Maybe you have not yet discovered the power of build_dir_reuse?
Hello Andreas, no, build_dir_reuse was not set (and CPAN shell did not tell me about this variable as it dit e.g. at the time when auto_commit was introduced). When set to '1' (after "o conf init"), behaviour using my tool did not change initially, but I found a work around. basic operation of the changelog reader: $m=CPAN::Shell->expand("Module", "IO::Socket::SSL"); CPAN::Module::get($m); $f=$m->cpan_file; $d=CPAN::Shell->expand("Distribution", $f); $dir=CPAN::Distribution::dir($d); # look in $dir for Changes, Changelog, ChangeLog etc. ... this will give new temp dirs with every invocation. workaround: call CPAN::Module::get only if CPAN::Distribution::dir is not defined: $m=CPAN::Shell->expand("Module", "IO::Socket::SSL"); $f=$m->cpan_file; $d=CPAN::Shell->expand("Distribution", $f); if (!defined CPAN::Distribution::dir($d)) { CPAN::Module::get($m); } $dir=CPAN::Distribution::dir($d); # look in $dir for Changes, Changelog, ChangeLog etc. ... If this is the way it should have been written from the start, then this bug can be closed because it was mine and not yours and I apologize :-) Show quoted text
> may share the build_dir directory. If you set build_dir_reuse to a > true value, you *will* reuse the same directory of every distro with > the same perl. Let me know if this is what you're really looking for.
Yes, that does it. Show quoted text
> I agree that there should be a way to invoke the manager cleanup > routine. Currently it is only invoked on new invocations of the shell. > And not by batch jobs. Ahhh, I see, this is probably much closer to > what you need, right?
Not sure about that. Up to version 1.8802 and using $CPAN::Config->{'scan_cache'}='atstart', the build cache cleanup was triggered automatically just by using my changelog reader. I think it would not hurt if this behaviour was re-instated. Otherwise I would need to write code depending on CPAN version in the script. I guess this bug can be closed. Best regards Matthias
Subject: Re: [rt.cpan.org #26886] module build directories as tempdirs: better not
Date: Thu, 03 May 2007 01:49:39 +0200
To: bug-CPAN [...] rt.cpan.org
From: Matthias Ferdinand <mf [...] mfedv.net>
Download (untitled) / with headers
text/plain 249b
Hi, one more observation: (build_dir_reuse=1) 1st invocation: ... CPAN::Module::get($m) ... 2nd invocation: ... CPAN::Shell->install($name) ... In the 2nd invocation the build dir is not reused but a new one is created. Best regards Matthias


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.