How to view a file written from an error during a Github action? - github

I'm trying to install a module using CPAN but get this error:
Run cpanm --force DB_File
cpanm --force DB_File
shell: /usr/bin/bash -e {0}
env:
PERL5LIB: /home/runner/work/Bio-STR-exSTRa/Bio-STR-exSTRa/local/lib/perl5:/home/runner/work/_actions/shogo82148/actions-setup-perl/v1/scripts/lib
--> Working on DB_File
Fetching http://www.cpan.org/authors/id/P/PM/PMQS/DB_File-1.858.tar.gz ... OK
Configuring DB_File-1.858 ... OK
! Installing DB_File failed. See /home/runner/.cpanm/work/1660633817.1777/build.log for details. Retry with --force to force install it.
Building and testing DB_File-1.858 ... FAIL
Error: Process completed with exit code 1.
How can I download or view the file /home/runner/.cpanm/work/1660633817.1777/build.log so I can diagnose the problem?
Github action YML file can be seen at https://github.com/bahlolab/Bio-STR-exSTRa/blob/master/.github/workflows/ci.yml.

You should take a look at GitHub artifacts:
https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts#uploading-build-and-test-artifacts
You can use that method to expose files as a downloadable resources.

Related

Installing a patch for a dependent module: cpanm still tries to install broken module after I have installed patched module manually

I am trying to install Net::SSH::Perl using cpanm (from perlbrew and perl version 5.30). The installation fails with:
$ cpanm Net::SSH::Perl
--> Working on Net::SSH::Perl
Fetching http://www.cpan.org/authors/id/S/SC/SCHWIGON/Net-SSH-Perl-2.14.tar.gz ... OK
Configuring Net-SSH-Perl-2.14 ... OK
==> Found dependencies: Crypt::Curve25519
--> Working on Crypt::Curve25519
Fetching http://www.cpan.org/authors/id/A/AJ/AJGB/Crypt-Curve25519-0.06.tar.gz ... OK
Configuring Crypt-Curve25519-0.06 ... OK
Building and testing Crypt-Curve25519-0.06 ... FAIL
! Installing Crypt::Curve25519 failed. See /home/hakon/.cpanm/work/1587758019.381709/build.log for details. Retry with --force to force install it.
! Installing the dependencies failed: Missing version info for module 'Crypt::Curve25519'
! Bailing out the installation for Net-SSH-Perl-2.14.
The problem with installing Crypt::Curve25519 is described in this issue. I downloaded the problematic module Crypt::Curve25519 and patched it:
git clone git#github.com:ajgb/crypt-curve25519.git
wget https://www.cpan.org/authors/id/S/SR/SREZIC/patches/Crypt-Curve25519-0.06-PR10-ANOTHERLINK.patch
cd crypt-curve25519
git apply ../Crypt-Curve25519-0.06-PR10-ANOTHERLINK.patch
perl Makefile.PL
make # No errors now
make test
make install
However, when I try again to install Crypt::Curve25519 it still tries to install the broken module from CPAN:
$ cpanm Net::SSH::Perl
--> Working on Net::SSH::Perl
Fetching http://www.cpan.org/authors/id/S/SC/SCHWIGON/Net-SSH-Perl-2.14.tar.gz ... OK
Configuring Net-SSH-Perl-2.14 ... OK
==> Found dependencies: Crypt::Curve25519
--> Working on Crypt::Curve25519
Fetching http://www.cpan.org/authors/id/A/AJ/AJGB/Crypt-Curve25519-0.06.tar.gz ... OK
Configuring Crypt-Curve25519-0.06 ... OK
Building and testing Crypt-Curve25519-0.06 ... FAIL
! Installing Crypt::Curve25519 failed. See /home/hakon/.cpanm/work/1587758833.382749/build.log for details. Retry with --force to force install it.
! Installing the dependencies failed: Missing version info for module 'Crypt::Curve25519'
! Bailing out the installation for Net-SSH-Perl-2.14.
How can I make cpanm use the installed patch instead (i.e. skip installation of Crypt::Curve25519 since it is already installed)?
The problem seems to be missing VERSION information in the module. By adding a line
our $VERSION = 0.06;
to the top of the file lib/Crypt/Curve25519.pm and then reinstall, and then installing cpanm Net::SSH::Perl worked fine (it accepted the patched installation and did not try to download the broken version).
Here is the patch I used to lib/Crypt/Curve25519.pm:
diff --git a/lib/Crypt/Curve25519.pm b/lib/Crypt/Curve25519.pm
index 686b706..d9c2b3d 100644
--- a/lib/Crypt/Curve25519.pm
+++ b/lib/Crypt/Curve25519.pm
## -1,4 +1,5 ##
package Crypt::Curve25519;
+our $VERSION = 0.06;
#ABSTRACT: Generate shared secret using elliptic-curve Diffie-Hellman function
use strict;
There's a few things to check:
cpanm knows where to find your patched version.
The patched version has a version that's higher than the one on CPAN. The module idea in CPAN assumes that you always want the latest, so ensure that yours is.
You don't want to install a patched module at the standard location because you don't want a cpan client to overwrite it.
Some other things that can work:
Force install the module and ignore the failures (cpanm has a --notest feature). The CPAN version is still installed, but that doesn't matter.
Have your patched version in a separate directory that's at the front of #INC so your program finds it first. This effectively hides the CPAN version.

Building and testing HTTP-Proxy-0.304

I use sudo cpanm to test and install Perl dependencies.
I am stuck on the line
building and testing HTTP-Proxy-0.304
but I cannot continue the compilation.
Of course I made a Perl Makefile.pl to see the dependencies that are missing. I also tried a cpan install HTTP-Proxy and I also have a cpanm error
Failed test '302 => 302 Server
I also commented out the proxy line in the Makefile.pl the cpanm turn on but the compilation make and make test crashes.
Where does this message blocking on the proxy come from and how can I install this dependency via cpanm or cpan?
In both cases use of sudo cpanm and cpan install ... I get a timeout or it gets stuck on this step that's all. He does not go further
the problem referenced on the website like rt.cpan.org and others show that the HTTP service: Proxy blocks the continuation of the programs. The solution I found is to run the command
sudo sudo cpanm . -v --notest then a sudo cpanm . -v
and with this everything works. We avoid to pass in the tests and then we launch the standard command. It's ok so

--force command in perl will install modules for sure? [duplicate]

This question already has an answer here:
Dmake file error with Math::TrulyRandom module
(1 answer)
Closed 6 years ago.
I tried installing [Math::TrulyRandom][1] a random (versus pseudo random) number generator, and on cpan.org, there is only the source code available. My first attempt of installing it was a failure, and then told me to use the --force so that it will be installed the second time. My second time is a failure as well. Can someone explain if I used the --force command correctly, or if there is another way to install Math::TrulyRandom? Thanks in advance.
C:\Users\Jlinne\Documents> cpanm Math::TrulyRandom
--> Working on Math::TrulyRandom
Fetching http://www.cpan.org/authors/id/G/GA/GARY/Math-TrulyRandom-1.0.tar.gz ... OK
Configuring Math-TrulyRandom-1.0 ... OK
Building and testing Math-TrulyRandom-1.0 ... FAIL
! Installing Math::TrulyRandom failed. See C:\Users\Jlinne\.cpanm\work\1476406246.12316\build.log for details. Retry with --force to force install it.
C:\Users\Jlinne\Documents> cpanm --force Math::TrulyRandom
--> Working on Math::TrulyRandom
Fetching http://www.cpan.org/authors/id/G/GA/GARY/Math-TrulyRandom-1.0.tar.gz ... OK
Configuring Math-TrulyRandom-1.0 ... OK
Building and testing Math-TrulyRandom-1.0 ... FAIL
! Installing Math::TrulyRandom failed. See C:\Users\Jlinne\.cpanm\work\1476406259.5096\build.log for details. Retry with --force to force install it.
I also tried this, but I do not understand what this means (eg. the second to last line of code):
C:\Users\Jlinne\.cpanm\work\1476412047.4284\Math-TrulyRandom-1.0>exit
Building Math-TrulyRandom-1.0 failed.
You can s)kip, r)etry, e)xamine build log, or l)ook ? [s] e
FAIL
! You don't seem to have a PAGER :/
Building Math-TrulyRandom-1.0 failed.
Output:
C:\Users\Jlinne\Documents> cpanm Math::TrulyRandom
--> Working on Math::TrulyRandom
Fetching http://www.cpan.org/authors/id/G/GA/GARY/Math-TrulyRandom-1.0.tar.gz ... OK
Configuring Math-TrulyRandom-1.0 ... OK
Building and testing Math-TrulyRandom-1.0 ... FAIL
! Installing Math::TrulyRandom failed. See C:\Users\Jlinne\.cpanm\work\1476549822.10400\build.log for details. Retry with --force to force install it.
C:\Users\Jlinne\Documents> cpanm --prompt Math::TrulyRandom
--> Working on Math::TrulyRandom
Fetching http://www.cpan.org/authors/id/G/GA/GARY/Math-TrulyRandom-1.0.tar.gz ... OK
Configuring Math-TrulyRandom-1.0 ... OK
Building and testing Math-TrulyRandom-1.0 ... Building Math-TrulyRandom-1.0 failed.
You can s)kip, r)etry, e)xamine build log, or l)ook ? [s] l
Entering C:/Users/Jlinne/.cpanm/work/1476549847.11132/Math-TrulyRandom-1.0 with C:\WINDOWS\system32\cmd.exe
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.
C:\Users\Jlinne\.cpanm\work\1476549847.11132\Math-TrulyRandom-1.0>perl Makefile.PL
Generating a dmake-style Makefile
Writing Makefile for Math::TrulyRandom
Writing MYMETA.yml and MYMETA.json
C:\Users\Jlinne\.cpanm\work\1476549847.11132\Math-TrulyRandom-1.0>nmake
'nmake' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\Jlinne\.cpanm\work\1476549847.11132\Math-TrulyRandom-1.0>
It likely failed in the building phase and not the testing phase. The --force option just allows cpanm to ignore the results of tests. You should also almost never use --force. Use --prompt instead, and then choose the look option when prompted. Once it drops you in the build directory, run perl Build.pl or perl Makefile.PL (whichever the module uses). Look for and, if you can, fix them. If you can't fix them, ask about them on SO. If it creates a makefile, then run nmake. Look for errors, etc. Then run nmake test. Look for errors, etc. Once all of that works, exit the shell and you will be returned to the prompt. Chose retry and it should install.
You could also just look at the build log and see what went wrong: C:\Users\Jlinne.cpanm\work\1476406259.5096\build.log
I also just noticed you are using MS Windows, are you sure you have a valid build environment (ie nmake is installed, you have a C compiler, etc)?

How can I install module PDF::OCR2 in perl?

I am trying to fetch text from scanned PDF using perl, so I use PDF::OCR2 module in perl but I can not install this module,it is fail at installation of Image::OCR::Tesseract module, I am using CentOS7,here is my error during installation
one dependency not OK (Image::OCR::Tesseract); additionally test harness failed
/usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
reports LEOCHARRE/PDF-OCR2-1.21.tar.gz
Running make install
Appending installation info to /usr/lib64/perl5/perllocal.pod
LEOCHARRE/PDF-OCR2-1.21.tar.gz
sudo /usr/bin/make install -- OK
Failed during this command:
LEOCHARRE/PDF-OCR2-1.21.tar.gz : make_test NO one dependency not OK (Image::OCR::Tesseract); additionally test harness failed
I read it's installation guid,they suggested to install gcc-c++ and automake first and then run following commands
svn checkout http://tesseract-ocr.googlecode.com/svn/trunk/ tesseract-ocr
./runautoconf
mkdir build-directory
cd build-directory
../configure
make
make install
but it's url does not work
Is there any other way to install the module PDF::OCR2 successfully?
Tesseract, like many things has moved to github:
https://github.com/tesseract-ocr
You need to clone and build this software from here before trying to install the PDF::OCR2 module. Submit a ticket or a patch to update the INSTALL instructions.

How to install XML::Parser without expat-devel?

XML::Parser fails to build on a quite fresh 64-bit Debian box. After issuing cpan XML::Parser, cpan fails with lots of errors about Expat.c and Expat.xs:
[...]
Expat.xs:2182: error: ‘CallbackVector’ has no member named ‘skip_until’
Expat.c: In function ‘XS_XML__Parser__Expat_Do_External_Parse’:
Expat.c:2904: error: ‘XML_Parser’ undeclared (first use in this function)
Expat.c:2904: error: expected ‘;’ before ‘parser’
Expat.xs:2194: error: ‘parser’ undeclared (first use in this function)
make[1]: *** [Expat.o] Error 1
make[1]: Leaving directory `/root/.cpan/build/XML-Parser-2.41-rpV6ok/Expat'
make: *** [subdirs] Error 2
TODDR/XML-Parser-2.41.tar.gz
/usr/bin/make -- NOT OK
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible
Message at the start of the output explains that expat-devel is needed for building.
Expat must be installed prior to building XML::Parser and I can't find
it in the standard library directories. Install 'expat-devel' package with your
OS package manager. See 'README'.
But expat-devel is not in Debian repository.
Is it possible to get over this without need to build/install expat from source?
The package you want to install is named libexpat1-dev. You could also just install libxml-parser-perl via apt-get. Or if you really want to install via CPAN try installing the Debian packages dependencies first via apt-get build-dep libxml-parser-perl.
libexpat1-dev contains both libexpat and expat.h, which are both mentioned in the message as well:
If expat is installed, but in a non-standard directory, then use the
following options to Makefile.PL:
EXPATLIBPATH=... To set the directory in which to find libexpat
EXPATINCPATH=... To set the directory in which to find expat.h
Installing libexpat1-dev seems to solve the problem:
$ aptitude install libexpat1-dev
There is always the manual method - to build/install expat from source.
(This example shows installing to an alternative location for XAMPP | LAMPP)
Download from:
http://sourceforge.net/projects/expat/files/expat/
tar zxf /[where-ever]/expat-2.1.0.tar.gz -C /tmp
cd /tmp/expat-2.1.0
/opt/lampp/bin/perl ./configure --prefix=/opt/lampp LDFLAGS=-L/opt/lampp/lib
make
make install
http://search.cpan.org - search for and download - XML::Parser
tar zxf /[where-ever]/XML-Parser-2.41.tar.gz -C /tmp
cd /tmp/XML-Parser-2.41
/opt/lampp/bin/perl ./Makefile.PL EXPATLIBPATH=/opt/lampp/lib EXPATINCPATH=/opt/lampp/include
make
make test
make install
Work like a charm in Ubuntu 15.04. The only thing that I need is install Perl XML Parser with:
sudo apt-get install libxml-parser-perl
And following the instructions here, I was able to import successfully all my ratings into Rhythmbox. Now, the only work that I need to do is create again the smart play lists, that is nothing compared with my entire libray ratings.
Today I had the same issue wanting to complile the new GIMP 2.9.4 beta on OSX 10.8 and the aid of homebrew.
First install perl
brew install perl
Then the XML::Parser module by going into the perl shell with
perl -MCPAN -e shell
And inside the shell install XML::Parser by typing
install XML::Parser
Exit shell
exit
Now, verify it has been installed successfully. If everything is ok, you will not see an error.
perl -e "require XML::Parser"
If the ./configure still fails missing XML::Parser, then intltools is not using the perl you have installed. Looking at the script tells me it does the test with $INTLTOOL_PERL -e "require XML::Parser". Trying a echo $INTLTOOL_PERL gave out nothing, so the magic is to set it with
export $INTLTOOL_PERL=perl
Now run ./configure again.
None of the above methods worked for me. I had the right environment variables setup but they were somehow not picked up by cpanm that I use to install perl modules. Expat was also installed.
Here is what I did to overcome the same problem that OP is reporting.
This is very close to what #LadyBuzz suggested.
Download the XML::Parser from cpan.org
Extract the tarball into directory and descend to it.
Open the Makefile.pl and edit the first lines to actually have the absolute paths to both: EXPATLIBPATH and EXPATINCPATH
Save the Makefile.pl, go up one level and create a new tarball with the Makefile.pl that you just edited.
Execute cpanm on the newly created tarball.
This resulted in successful installation of the module.