miyagawa / Carmel

CPAN Artifact Repository Manager
Other
138 stars 17 forks source link

Do not destroy log file #94

Closed KES777 closed 2 years ago

KES777 commented 2 years ago

# perl -I$PWD/ext2/lib/perl5/ ext2/bin/carmel install

Output:

! Configure failed for DB-Skip-1.132980. See /tmp/LdeEpQjTje/work/1656504871.49484/build.log for details.
Successfully installed JSON-4.07
...
# cat /tmp/LdeEpQjTje/work/1656504871.49484/build.log
cat: /tmp/LdeEpQjTje/work/1656504871.49484/build.log: No such file or directory

Details: https://github.com/miyagawa/cpanminus/issues/646#issuecomment-1169913137

miyagawa commented 2 years ago

While what you say is true, you should be encountering the same problem by trying to install DB::Skip with cpanm.

I can't reproduce the problem by the way, and the DB-Skip distribution doesn't seem to have any actual dependency, which leads me to believe that you have a problem with ExtUtils::MakeMaker and where to load it from.

miyagawa commented 2 years ago

Ah, I forgot about this -- you can pass PERL_FILE_TEMP_CLEANUP=0 environment variable to avoid destroying the temp dir. #21

KES777 commented 2 years ago

May you please document this. Also I do not expect log file is destroyed when error happened. This conflicts with See /tmp/LdeEpQjTje/work/1656504871.49484/build.log for details.

It is Ok to destroy log when build success.

KES777 commented 2 years ago

Sorry, probably I am too noisy already. But this message is really useless. The file was destroyed and there is nothing to see... Message should be something like: Rerun carmel with PERL_FILE_TEMP_CLEANUP=0 carmel install and then see /tmp/LdeEpQjTje/work/1656504871.49484/build.log for details. err... but for next run log file will be different =(

miyagawa commented 2 years ago

This is an edge case where your perl5 lib path is really screwed. Generally speaking, not every problem has to be self-serviceable. You can read the source code to find where the temp files are created and disable the deletion with an env variable, or search or open an issue here to get help, like i am offering right now.

Having said that, rather than changing the output, it'd be more straightforward to keep the temp directory around when install failed, so I'll do that in the future.