Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Where does CPAN store its build directories and logs under cygwin?

by Special_K (Monk)
on Jan 07, 2021 at 00:36 UTC ( #11126488=perlquestion: print w/replies, xml ) Need Help??

Special_K has asked for the wisdom of the Perl Monks concerning the following question:

On a Linux machine I'm using, there is a folder /home/user/.cpanm/work/ that contains a number of directories of the format ##########.#####, where each directory's name is a sequence of what appear to be arbitrary numbers. Each directory appears to correspond to a particular attempt to install something from CPAN and contains a subdirectory for each module whose install was attempted and a build.log file.

In my Strawberry Perl installation, these same folders exist in C:\Users\User\.cpanm\work.

Where are these directories stored in cygwin? I found /home/user/.local/share/.cpan, but cannot find any of the ##########.##### directories within that directory. Do I need to set some option to save these directories?

EDIT: It seems I was using cpanm on the Linux machine but cpan on cygwin and Strawberry Perl. It seems based on my searching that CPAN actually doesn't keep log files of each build attempt, whereas other build utilities such as CPANM do keep log files by default:

When cpan returns the dreaded "won't install without force"
cpan error messages

It looks like I'll need to install CPANM and start using that on the cygwin installation in order to preserve log files for each build.

Replies are listed 'Best First'.
Re: Where does CPAN store its build directories and logs under cygwin?
by kcott (Bishop) on Jan 07, 2021 at 02:35 UTC

    G'day Special_K,

    On my Cygwin installation, I believe the directory to which you're referring is ~/.cpan/build. When running cpan, o conf build_dir reports this directory. I installed Dancer2 (v0.300004) yesterday; I see a Dancer2-0.300004-0 directory in which there's Makefile.PL and friends.

    If you just run o conf, you'll see all options; possibly some which are closer to what you're currently looking for, or perhaps useful for future reference (e.g. cpan_home, keep_source_where, and so on).

    Take a look at "CPAN: CONFIGURATION" for more information about the terse listing you get from o conf.

    — Ken

      I do have the build directory, found here on my setup: /home/user/.local/share/.cpan/build It contains a folder for each attempted install of a module, as yours does. These folders do not contain any build logs, however. Do you know where the build logs are saved in your configuration? I'll have to spend some more time looking at the CPAN options (and comparing them to their values on my Linux machine) to see which one(s) might be relevant to my question.
        Do you know where the build logs are saved in your configuration?

        As a lazy bloke I would run cpan under strace capturing open() system calls and inspect the resulting logfile:

        $ strace -s4096 -o cpantrace.log -e open cpan $args

        That would give me a clue where which files are written.

        perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'

        I ran find ~ -name "build.log": no results returned.

        I've just noticed the "EDIT:" in your OP. It looks like you have your answer.

        For future reference, I get notified if you reply to one of my posts; I do not get a notification when you update one of your posts.

        — Ken

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://11126488]
Approved by LanX
Front-paged by Corion
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2021-04-21 12:20 GMT
Find Nodes?
    Voting Booth?

    No recent polls found