Home > Software engineering >  Issue running make on a postgres database
Issue running make on a postgres database

Time:11-25

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";
}

CodePudding user response:

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

CodePudding user response:

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