Issue running make on a postgres database - postgresql

I'm running this on msys2 64 bit MINGW65 shell.
I ran
$source/configure --host=x86_64-w64-mingw32 --prefix=$dist && make
and everything until the make runs properly. After getting the make issue and trying to tinker with the issue spot I keep running make for the same issue below.
Then when I run make on the folder.
it's running fine until it hits this part
make[2]: Leaving directory '/c/builds/build/REL_11_8/src/backend/utils'
make -C storage/lmgr lwlocknames.h lwlocknames.c
make[2]: Entering directory '/c/builds/build/REL_11_8/src/backend/storage/lmgr'
'/usr/bin/perl' /c/builds/source/src/backend/storage/lmgr/generate-lwlocknames.pl
/c/builds/source/src/backend/storage/lmgr/lwlocknames.txt
unable to parse lwlocknames.txt at /c/builds/source/src/backend/storage/lmgr/generate-
lwlocknames.pl line 36, <$lwlocknames> line 8.
make[2]: *** [Makefile:33: lwlocknames.h] Error 255
make[2]: Leaving directory '/c/builds/build/REL_11_8/src/backend/storage/lmgr'
make[1]: *** [Makefile:137: storage/lmgr/lwlocknames.h] Error 2
make[1]: Leaving directory '/c/builds/build/REL_11_8/src/backend'
make: *** [src/Makefile.global:372: submake-generated-headers] Error 2
In the generate-lwlocknames.pl
there is the following line that it's obviously triggering it.
But I don't know why it's triggering it or how to fix it.
I need to compile this build in order to be able to get the dll files for an extension for windows machine that is running postgres.
while (<$lwlocknames>)
{
chomp;
# Skip comments
next if /^#/;
next if /^\s*$/;
die "unable to parse lwlocknames.txt"
unless /^(\w+)\s+(\d+)$/;
(my $lockname, my $lockidx) = ($1, $2);
die "lwlocknames.txt not in order" if $lockidx < $lastlockidx;
die "lwlocknames.txt has duplicates" if $lockidx == $lastlockidx;
while ($lastlockidx < $lockidx - 1)
{
++$lastlockidx;
printf $c "%s \"<unassigned:%d>\"", $continue, $lastlockidx;
$continue = ",\n";
}
printf $c "%s \"%s\"", $continue, $lockname;
$lastlockidx = $lockidx;
$continue = ",\n";
print $h "#define $lockname (&MainLWLockArray[$lockidx].lock)\n";
}

After rerunning it a few more times it finished successfully. No changes were made to the files or methodology.

It looks like you are building with the Perl that comes with MinGW.
However, the PostgreSQL documentation is pretty clear on that point:
The following additional products are required to build PostgreSQL. Use the config.pl file to specify which directories the libraries are available in.
[...]
ActiveState Perl
ActiveState Perl is required to run the build generation scripts. MinGW or Cygwin Perl will not work. It must also be present in the PATH. Binaries can be downloaded from https://www.activestate.com (Note: version 5.8.3 or later is required, the free Standard Distribution is sufficient).

Related

Couldn't execute ESQL.EXE to determine the ESQL/C libraries

I am building perl 5.30 from source code. I successfully build perl.
Now i am trying to build DBD::Informix with my perl.
All the esql test compiled successfully but its failing when going for library.
perl Makefile.pl
The error which i am facing on console is
"
Determining which Informix libraries etc to use... MZÉ$#: not found
£èE°êE°δèM°Ç┴êM°δδ¡╢ò≥√  ╢äΦ·  ïMïü╞╟à⌠√  ╕╟ñäG╟¿äGí╝⌐F╕╟î║G╟î║G╟î║G╟⌠çG╕çφïM∞╛QëUⁿïE⌠QïR ╨┌GtBïM∞╛QâΓâ·t3ïE∞╛Hâßâ∙t$ïU∞╛BâαthLâ∙:
not found jh₧%  Φî╧  âδïUΦâΩ: not found"
The code which giving error is :
"my $esqlscript = (-f $esql) ? $esql : "$ID/bin/esql";
my $libs = `$Perl -pe 's/^\\s*exec/echo/' $esqlscript | sh -s -- -o pseudonym $esqlc_flags dbd::ix.o` || die "Couldn't execute $esqlscript to determine the ESQL/C libraries\n";
Note: I am using Informix client SDK 3.50."
Any help would be appreciable.Thanks

perl module Class::HPLOO v0.23 install issue #2

Having the exact issue as described at: perl module Class::HPLOO v0.23 install issue, I have attempted to correct the defined(#array) problem by editing to just (#array) and trying to rebuild the module. However I continue to get the return of:
$ make clean
$ perl Makefile.PL
$ make
$ make test: *** No rule to
make target `clean:'. Stop. Manifying 2 pod documents
PERL_DL_NONLAZY=1 "/opt/local/bin/perl5.26" "-Iblib/lib" "-Iblib/arch"
test.pl
1..42
# Running under perl version 5.026002 for darwin
# Current time local: Sun Aug 26 06:48:26 2018
# Current time GMT: Sat Aug 25 22:48:26 2018
# Using Test.pm version 1.26 not ok 1
# Failed test 1 in test.pl at line 9
# test.pl line 9 is: ok(!$#) ; Can't locate object method "new" via package "Foo" at test.pl line 11. make: *** [test_dynamic] Error 2
There are three issues with Class::HPLOO (which as I noted before, hasn't been updated since 2005) that make it fail with modern perls.
As discovered in the previous post,
the obsolete construct defined (#array) is used once in lib/Class/HPLOO.pm' and three times inlib/Class/HPLOO/Base.pm`. This construction has been prohibited since v5.22
The current directory (.) is no longer in #INC (as of v5.24, I think). So the lines in test.pl like
require "test/classtest.pm"
either all need to be rewritten as
require "./test/classtest.pm"
or an easier fix is to put
use lib '.';
at the top of the script.
There is a regular expression in lib/Class/HPLOO.pm, line 1077, with an "unescaped left brace"
$sub =~ s/(\S)( {) (\S)/$1$2\n$FIRST_SUB_IDENT $3/gs ;
{ is a regex metacharacter, and since v5.22 it has been illegal to use it in a context where it is not indicating a quantity. The fix, as the error message suggests, is to escape it.
$sub =~ s/(\S)( \{) (\S)/$1$2\n$FIRST_SUB_IDENT $3/gs ;
Make these three changes to the code you download from CPAN and the module should build on modern Perls. If you're feeling helpful, you can submit a bug report (linking to this post, if you want) or even a patch with an email to bug-Class-HPLOO#rt.cpan.org
come across this issue today, so I fixed it following the answer above. if anyone want to save some time.
I create a repo with the changes. https://github.com/swuecho/Class_HPLOO.git

Why does "Can not locate Debconf / Log.pm in #INC" issue? I just modified /usr/bin/perl into the perl that I installed

The system is Ubuntu. There is a perl in /usr/bin/, and is version is 5.18.2.
In this state, I tried to install many software by "sudo apt-get install **" and it was OK.
But a few days before, I installed a new perl in an other
directory(/share/Software/perl-5.26.0/bin/perl). And I remove the original perl then link the new perl to /use/bin/. The commands are:
sudo mv /usr/bin/perl /usr/bin/old/; (the old/ directory was make before)
sudo ln -s /share/Software/perl-5.26.0/bin/perl /usr/bin/perl
After that, I got the error informations when I install system software by apt-get. The error likes below:
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
debconf: Perl may be unconfigured (Can't locate Debconf/Log.pm in #INC (you may need to install the Debconf::Log module) (#INC contains: /share/Software/perl-5.26.0/lib/site_perl/5.26.0/x86_64-linux /share/Software/perl-5.26.0/lib/site_perl/5.26.0 /share/Software/perl-5.26.0/lib/5.26.0/x86_64-linux /share/Software/perl-5.26.0/lib/5.26.0) at (eval 1) line 4.
BEGIN failed--compilation aborted at (eval 1) line 4.
) -- aborting
Setting up doc-base (0.10.5) ...
Can't locate Debian/DocBase/Common.pm in #INC (you may need to install the Debian::DocBase::Common module) (#INC contains: /share/Software/perl-5.26.0/lib/site_perl/5.26.0/x86_64-linux /share/Software/perl-5.26.0/lib/site_perl/5.26.0 /share/Software/perl-5.26.0/lib/5.26.0/x86_64-linux /share/Software/perl-5.26.0/lib/5.26.0) at /usr/sbin/install-docs line 8.
BEGIN failed--compilation aborted at /usr/sbin/install-docs line 8.
Some software can be installed successfully, but some can not be.
If I put perl back to the previous, it is normal again. (That must be!)
Module "Debconf::Log" is located at /share/Software/perl-5.26.0/lib/perl5, but I can not find Debian/DocBase/Common.pm.
Path of /share/Software/perl-5.26.0/lib/perl5 is inside #INC of perl. Why it can not find it?
I even think that it is the problem when perl installed. I get below error when perl installed: ("make test")
Useless use of single ref constructor in void context at op/gv.t line 1191.
In file included from ../../../../perl.h:5644:0,
from ExtTest.xs:2:
ExtTest.c: In function ‘XS_ExtTest_constant’:
../../../../embed.h:691:40: warning: ‘pv’ may be used uninitialized in this function [-Wmaybe-uninitialized]
#define sv_setpvn(a,b,c) Perl_sv_setpvn(aTHX_ a,b,c)
^
ExtTest.xs:420:14: note: ‘pv’ was declared here
const char *pv;
^
In file included from ../../../../perl.h:5644:0,
from ExtTest.xs:2:
../../../../embed.h:691:40: warning: ‘iv’ may be used uninitialized in this function [-Wmaybe-uninitialized]
#define sv_setpvn(a,b,c) Perl_sv_setpvn(aTHX_ a,b,c)
^
ExtTest.xs:418:6: note: ‘iv’ was declared here
IV iv;
^
In file included from ../../../../perl.h:5644:0,
from ExtTest.xs:2:
ExtTest.c: In function ‘XS_ExtTest_constant’:
../../../../embed.h:691:40: warning: ‘pv’ may be used uninitialized in this function [-Wmaybe-uninitialized]
#define sv_setpvn(a,b,c) Perl_sv_setpvn(aTHX_ a,b,c)
^
ExtTest.xs:194:14: note: ‘pv’ was declared here
const char *pv;
^
In file included from ../../../../perl.h:5644:0,
from ExtTest.xs:2:
ExtTest.c: In function ‘XS_ExtTest_constant’:
../../../../embed.h:675:42: warning: ‘iv’ may be used uninitialized in this function [-Wmaybe-uninitialized]
#define sv_setiv_mg(a,b) Perl_sv_setiv_mg(aTHX_ a,b)
^
ExtTest.xs:166:6: note: ‘iv’ was declared here
IV iv;
^
# Failed test 'cp updated mtime'
# at t/cp.t line 26.
# '38'
# <=
# '1'
# Looks like you failed 1 test of 1.
Request to remove file /share/Software/perl-5.26.0-src/cpan/File-Temp/suffixOEXZVr.dat could not be completed since it is not there!
at t/mktemp.t line 75.
# parser guessed wrong encoding expected 'CP1252' got 'UTF-8'
# Failed test 'File 1 atime set correctly'
# at t/utime.t line 113.
# '37.684463262558'
# <
# '0.1'
# Failed test 'File 1 mtime set correctly'
# at t/utime.t line 114.
# '37.684463262558'
# <
# '0.1'
# Failed test 'File 2 atime set correctly'
# at t/utime.t line 118.
# '37.684463262558'
# <
# '0.1'
# Failed test 'File 2 mtime set correctly'
# at t/utime.t line 119.
# '37.684463262558'
# <
# '0.1'
# Looks like you failed 4 tests of 18.
Can't open copy1-87150: Permission denied at ../lib/File/Copy.t line 326.
# Looks like your test exited with 13 just after 366.
Failed 3 tests out of 2449, 99.88% okay.
### Since not all tests were successful, you may want to run some of
### them individually and examine any diagnostic messages they produce.
### See the INSTALL document's section on "make test".
### You have a good chance to get more information by running
### ./perl harness
### in the 't' directory since most (>=80%) of the tests succeeded.
### You may have to set your dynamic library search path,
### LD_LIBRARY_PATH, to point to the build directory:
### setenv LD_LIBRARY_PATH `pwd`:$LD_LIBRARY_PATH; cd t; ./perl harness
### LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd t; ./perl harness
### export LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH; cd t; ./perl harness
### for csh-style shells, like tcsh; or for traditional/modern
### Bourne-style shells, like bash, ksh, and zsh, respectively.
make: *** [test] Error 1
Each Perl is compiled with a few #INC directories where it will search for modules. The error message explains which directories are searched:
#INC contains:
/share/Software/perl-5.26.0/lib/site_perl/5.26.0/x86_64-linux
/share/Software/perl-5.26.0/lib/site_perl/5.26.0
/share/Software/perl-5.26.0/lib/5.26.0/x86_64-linux
/share/Software/perl-5.26.0/lib/5.26.0
This does not include the directories where APT has installed modules for Perl, e.g. under /usr/lib.
However, adding those directories will not help. Some modules are compiled for a specific Perl versions. You cannot upgrade Perl in-place, but would have to reinstall all modules. Since APT contains pre-built modules you cannot use modules installed via APT with a custom Perl.
Therefore: leave the system Perl because Ubuntu depends on its proper functioning. It is safe to install another Perl alongside, e.g. via perlbrew. It is safe to add a custom Perl to your PATH, e.g. via perlbrew switch. This will also fix a couple of additional environment variables that are required for a second Perl to work.

Padre complains about an SQLite database issue

I am starting with perl and wanted to install the IDE Padre on Ubuntu 14.04.
The answers in this question indicate that I simply can use apt-get:
sudo apt-get install padre
I also tried to install it with:
sudo cpan Padre
as indicated here.
However, when I run padre, it gives me the following error:
DBD::SQLite::db selectall_arrayref failed: attempt to write a readonly database at (eval 1905) line 41.
Perl exited with active threads:
1 running and unjoined
0 finished and unjoined
0 running and detached
And when I run it as root (sudo padre):
DBD::SQLite::db do failed: Safety level may not be changed inside a transaction at (eval 1905) line 37.
Perl exited with active threads:
1 running and unjoined
0 finished and unjoined
0 running and detached
padre --version shows me: Perl Application Development and Refactoring Environment 1.00, and my perl version is 5.18.2.
In the /usr/bin/padre script I do not see any reference to an SQLite database. Does anyone know how I can solve this issue?
Finally I found the solution in this bug report. In the file Locker.pm (in my system located in /usr/share/perl5/Padre) the following function (line 102) should be changed:
sub db_increment {
my $self = shift;
unless ( $self->{db_depth}++ ) {
Padre::DB->begin;
# ...
Padre::DB->pragma( synchronous => 0 );
}
return;
}
to:
sub db_increment {
my $self = shift;
unless ( $self->{db_depth}++ ) {
#...
Padre::DB->pragma( synchronous => 0 );
Padre::DB->begin;
}
return;
}
i.e. changing the order of Padre::DB->pragma and Padre::DB->begin.
This allowed me to start padre as root (sudo), and to fix this I had to change the owner of the Padre configuration. I changed the rights to my user using chown:
sudo chown -R myuser:myuser /.local/share/.padre/

Unable to install Image::ExifTool due to 'make test' hanging

I have a Netgear ReadyNAS NV+ on which I'm trying to do some things using perl.
Since the perl installation from the vendor is compiled without the uselargefiles-flag I've tried to compile/install my own version to run in parallell with the system one.
When I first tried to compile perl on the machine itself I ran into trouble as the system is lacking alot of regular system tools which prevents the Configure-script from running properly.
# ./Configure -des -Dprefix=$HOME/perl-5.16.2
First let's make sure your kit is complete. Checking...
./Configure: line 1986: split: command not found
cat: /root/dload/perl-5.16.2/UU/x??: No such file or directory
Locating common programs...
I don't know where 'comm' is, and my life depends on it.
Go find a public domain implementation or fix your PATH setting!
To get around that I installed and used this cross-compiler to build perl on another machine.
I could not figure out how to cross-compile using the standard configure-script from perl, so I used this.
After that I could just copy my new perl-folder onto the NAS and have thing like the following work:
# ~/sparc-perl-5.16.2/bin/perl -version
This is perl 5, version 16, subversion 2 (v5.16.2) built for sparc-linux
Copyright 1987-2012, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
# ~/sparc-perl-5.16.2/bin/perl -e 'print "A string!\n";'
A string!
So in some sense I feel I've been successful in my quest to get "my" perl working on the machine.
I get in trouble when I try to install extra modules though.
I've tried installing Image::ExifTool using cpanp (among others), but the installation never finishes.
Today I resorted to trying the installation manually.
wget http://search.cpan.org/CPAN/authors/id/E/EX/EXIFTOOL/Image-ExifTool-9.12.tar.gz
tar xzf Image-ExifTool-9.12.tar.gz
cd Image-ExifTool-9.12
~/sparc-perl-5.16.2/bin/perl Makefile.pl
make
All work as they're supposed to.
when I get to make test however it hangs indefinitely like so:
# make test
PERL_DL_NONLAZY=1 /root/sparc-perl-5.16.2/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/AFCP.t ...........
Looking at the running processes I think these are the ones representing the command:
# ps aux | grep per[l]
root 26187 0.5 0.7 12000 7808 pts/0 S+ 10:31 0:07 /root/sparc-perl-5.16.2/bin/perl -MExtUtils::Command::MM -e test_harness(0, 'blib/lib', 'blib/arch') t/AFCP.t t/AIFF.t t/APE.t t/ASF.t t/BigTIFF.t t/BMP.t t/CanonRaw.t t/Canon.t t/CanonVRD.t t/Casio.t t/DICOM.t t/DjVu.t t/DNG.t t/DV.t t/EXE.t t/ExifTool.t t/FLAC.t t/FlashPix.t t/Flash.t t/Font.t t/FotoStation.t t/FujiFilm.t t/Geotag.t t/GeoTiff.t t/GE.t t/GIF.t t/GIMP.t t/GPS.t t/HTML.t t/InDesign.t t/IPTC.t t/ITC.t t/Jpeg2000.t t/JVC.t t/Kodak.t t/KyoceraRaw.t t/Lang.t t/LNK.t t/M2TS.t t/Matroska.t t/MIE.t t/MIFF.t t/Minolta.t t/MP3.t t/MWG.t t/MXF.t t/Nikon.t t/Olympus.t t/OpenEXR.t t/Panasonic.t t/PDF.t t/Pentax.t t/PGF.t t/PhotoCD.t t/PhotoMechanic.t t/Photoshop.t t/PICT.t t/PNG.t t/PostScript.t t/PPM.t t/PSP.t t/QuickTime.t t/Radiance.t t/Real.t t/Ricoh.t t/RIFF.t t/RTF.t t/Sanyo.t t/Sigma.t t/Sony.t t/Unknown.t t/Vorbis.t t/Writer.t t/XMP.t t/ZIP.t
root 26189 1.7 0.0 0 0 pts/0 Z+ 10:31 0:24 [perl] <defunct>
This is completely consistent with what happens when I try the same installation using cpanp.
I guess I could just run make install and hope that it won't be to much of a problem that the test is unable to run/complete, but that makes me feel a bit uneasy. I'd much rather figure out what is wrong.
I also find it odd that the test hangs the way it does, I could accept that it fails, but that it just keeps running in a non-productive manner feels weird.
Since it is the first time I've built perl from source and the first time I've used a cross-compiler I would not be surprised to learn I've done something very wrong, any help identifying what is very welcome.
What am I doing wrong?
EDIT - compiling on the mahcine:
Figured out how to get the Configure script working natively on the machine.
Will try to build there to see if that will work better. It'll take some time though, the machine is slow.
To be able to run the configure script I needed:
GCC
apt-get install libc6-dev gcc gdb libtag1-dev uuid-dev
coreutils
apt-get install coreutils
-Dcc=gcc
./Configure -des -Dprefix=$HOME/perl-5.16.2 -Dcc=gcc
EDIT2 - compile failed:
Most shortlived success ever:
# make
`sh cflags "optimize='-O2'" perlmini.o` -DPERL_IS_MINIPERL -DPERL_EXTERNAL_GLOB perlmini.c
CCCMD = gcc -DPERL_CORE -c -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -Wall
In file included from perl.c:33:
perl.h:699: error: conflicting types for `syscall'
/usr/include/unistd.h:939: error: previous declaration of `syscall'
ake: *** [perlmini.o] Error 1
EDIT3 - testdriving fork:
Tried the following to verify that fork works as it should. I believe that the test is successful, but I've never tried fork before, so please let me know if I read the output wrong.
# cat test_forkwait.px
#!/root/sparc-perl-5.16.2/bin/perl
$pid = fork();
die if $pid < 0;
$SIG{CHLD} = sub { warn "SIGCHLD\n"; };
if($pid) {
$status = waitpid($pid, 0);
warn "wait status: $status\n";
} else {
warn "Child starting\n";
sleep 1;
warn "Child terminating\n";
}
# ./test_forkwait.px
Child starting
Child terminating
SIGCHLD
wait status: 29913
I'm a bit late with this comment, and don't have any ideas about your "make test" hang, but I wanted to point out the Image::ExifTool is pure Perl, so it does not require compilation. The install step is as simple as copying the distribution files to the proper directories.
Phil
Gave up on figuring out why the test fails. Ended up using the module anyways. Seems to work OK with my files.