Skip Menu |

This queue is for tickets about the DBD-Pg CPAN distribution.

Report information
The Basics
Id: 131708
Status: resolved
Priority: 0/
Queue: DBD-Pg

People
Owner: Nobody in particular
Requestors: skeetabomb [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: BUG: 'cpan install DBD::Pg' fails looking for LIBPQ.dll
Date: Sat, 8 Feb 2020 17:58:29 +1100
To: bug-DBD-Pg [...] rt.cpan.org
From: "Stephen Dennis (Gmail)" <skeetabomb [...] gmail.com>
Hi, I posted this bug on metacpan, and someone was kind enough to redirect me to you, though I am not 100% sure it is solely a DBD::Pg bug. My original post is here: https://github.com/metacpan/metacpan-web/issues/2266 But here is the full thread again: ============================================================================================== * troogyt <https://github.com/troogyt> * commented 1 hour ago <https://github.com/metacpan/metacpan-web/issues/2266#issue-561974903> Cannot install DBD::Pg using cpan as every time it looks for LIBPQ.dll it cannot find it. I ran Sysinternals Process Monitor and can see it appears to be looking for LIBPQ.dll in the wrong place: "C:\Program Files (x86)\Common Files\Oracle\Java\javapath_target_3326048396\LIBPQ.dll" I have no idea why java has anything to do with this, but I definitely do have PostgreSQL 12 installed and LIBPQ.dll is located here: "C:\Program Files\PostgreSQL\12\bin\libpq.dll" I think the CPAN installer must be compiling the directory path using incorrect input variables or something. CPAN console output: Show quoted text
cpan> install DBD::Pg
Running install for module 'DBD::Pg' TURNSTEP/DBD-Pg-3.10.4.tar.gz Has already been unwrapped into directory C:\Perl64\cpan\build\DBD-Pg-3.10.4-0 TURNSTEP/DBD-Pg-3.10.4.tar.gz Has already been prepared TURNSTEP/DBD-Pg-3.10.4.tar.gz Has already been made Running make test "C:\Perl64\bin\perl.exe" -MExtUtils::Command::MM -e cp_nonempty -- Pg.bs blib\arch\auto\DBD\Pg\Pg.bs 644 "C:\Perl64\bin\perl.exe" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib\lib', 'blib \arch')" t/*.t t/00_signature.t ....... skipped: Set the environment variable TEST_SIGNATURE to enable this test t/00basic.t ............ 2/3 # Failed test 'use DBD::Pg;' # at t/00basic.t line 17. # Tried to use 'DBD::Pg'. # Error: Can't load 'C:\Perl64\cpan\build\DBD-Pg-3.10.4-0\blib\arch/auto/DBD/Pg/Pg.dll' for module DBD::Pg: load_file:The specified mod ule could not be found at C:/Perl64/lib/DynaLoader.pm line 194. # at t/00basic.t line 17. # Compilation failed in require at t/00basic.t line 17. # BEGIN failed--compilation aborted at t/00basic.t line 17. # CCFLAGS: q[ -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -DPERL_TEXTMODE_SCRIPTS -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fwrapv -fno-strict-aliasing -mms-bitfields -DPGLIBVERSION=120001 -DPGDEFPORT=5432] # INC: q[-I"C:/PROGRA~1/POSTGR~1/12/include" -IC:\Perl64\lib\auto\DBI] # LIBS: [q[-L"C:/PROGRA~1/POSTGR~1/12/lib" -lpq -lm -L"C:/PROGRA~1/POSTGR~1/12/lib/ms" -lsecur32]] Bailout called. Further testing stopped: Cannot continue without DBD::Pg FAILED--Further testing stopped: Cannot continue without DBD::Pg dmake.exe: Error code 255, while making 'test_dynamic' TURNSTEP/DBD-Pg-3.10.4.tar.gz C:\Perl64\site\bin\dmake.exe test -- NOT OK //hint// to see the cpan-testers results for installing this module, try: reports TURNSTEP/DBD-Pg-3.10.4.tar.gz Failed during this command: TURNSTEP/DBD-Pg-3.10.4.tar.gz : make_test NO Show quoted text
cpan>
------------------------------ Error Dialog Box: [image: image] <https://user-images.githubusercontent.com/41710820/74079205-4a40f480-4a88-11ea-9b68-d3fa7a8cb6d5.png> ------------------------------ Also tried: cpan DBD::Pg but with same result. I then set all the environment variables that appeared relevant, and according to both https://metacpan.org/source/TURNSTEP/DBD-Pg-3.10.4/README and the pg_env.bat file: user@computer C:\Users\user Show quoted text
>set | findstr "PG POSTG"
PGDATA=C:\Users\user\Documents\DB PGDATABASE=postgres PGLOCALEDIR=C:\Program Files\PostgreSQL\12\share\locale PGPORT=5432 PGUSER=postgres POSTGRES_HOME=C:\Program Files\PostgreSQL\12 POSTGRES_INCLUDE=C:\Program Files\PostgreSQL\12\include POSTGRES_LIB=C:\Program Files\PostgreSQL\12\lib However, contrary to https://metacpan.org/source/TURNSTEP/DBD-Pg-3.10.4/README I have no idea how to run these, as I cannot find them and the README assumes the reader both knows what they are and has them installed: pexports libpq.dll > libpq.def dlltool -dllname libpq.dll --def libpq.def --output-lib ..\lib\libpq.a It is not clear to me whether this is an issue with Perl itself, or cpan.exe, or PostgreSQL, or some combination of the 3. All I want to do is get Perl scripts managing my Postgres DB... please help :-/ [image: @Grinnz] <https://github.com/Grinnz> Contributor * Grinnz <https://github.com/Grinnz> * commented 1 hour ago <https://github.com/metacpan/metacpan-web/issues/2266#issuecomment-583706637> The bug tracker for DBD::Pg is at https://rt.cpan.org/Public/Dist/Display.html?Name=DBD-Pg. [image: @troogyt] <https://github.com/troogyt> Author * troogyt <https://github.com/troogyt> * commented 4 minutes ago <https://github.com/metacpan/metacpan-web/issues/2266#issuecomment-583709333> Thank you. I will email bug details to them. TG … <https://github.com/metacpan/metacpan-web/issues/2266#> [image: @troogyt] <https://github.com/troogyt> Author * troogyt <https://github.com/troogyt> * commented 1 minute ago <https://github.com/metacpan/metacpan-web/issues/2266#issuecomment-583709482> A little more info on the problem: [image: image] <https://user-images.githubusercontent.com/41710820/74080628-25557d00-4a9a-11ea-8c5e-87bcbab90d85.png> ============================================================================================= I have also added the additional ENV variables mentioned in the README: user@computer C:\Users\user Show quoted text
>set DB
DBI_DSN=dbi:Pg:dbname=testdb DBI_PASS=<OBFUSCATED> DBI_USER=postgres Many thanks, *troogyt*

Message body is not shown because it is too large.

Thanks for the report: I have no idea offhand what is going on, but will try to dig into it later. For now, don't worry about the test database (testdb) or things like the port as we are not getting far enough to even use those.
Subject: Re: [rt.cpan.org #131708] BUG: 'cpan install DBD::Pg' fails looking for LIBPQ.dll
Date: Sun, 9 Feb 2020 13:54:36 +1100
To: bug-DBD-Pg [...] rt.cpan.org
From: "Stephen Dennis (Gmail)" <skeetabomb [...] gmail.com>

Message body is not shown because it is too large.

Message body is not shown because it is too large.

Subject: Re: [rt.cpan.org #131708] BUG: 'cpan install DBD::Pg' fails looking for LIBPQ.dll
Date: Sun, 9 Feb 2020 14:02:42 +1100
To: bug-DBD-Pg [...] rt.cpan.org
From: "Stephen Dennis (Gmail)" <skeetabomb [...] gmail.com>

Message body is not shown because it is too large.

Message body is not shown because it is too large.

Any chance you could make a documentation patch to help out other Windows users? The README.win32 file could really use some attention, but I'm strictly *nix at this point in life.
Subject: Re: [rt.cpan.org #131708] BUG: 'cpan install DBD::Pg' fails looking for LIBPQ.dll
Date: Tue, 31 Mar 2020 14:15:49 +1100
To: bug-DBD-Pg [...] rt.cpan.org
From: "Stephen Dennis (Gmail)" <skeetabomb [...] gmail.com>
Hi Greg, I must confess I have never actually done that before as I am not strictly a programmer - this would be my first time, so I am not 100% sure of how to do it. I would gladly do it if I knew how, but I am an infant when it comes to professional development tools, techniques and source code repository management. Where the existing METACPAN README page for DBD::Pg (here <https://metacpan.org/source/TURNSTEP/DBD-Pg-3.10.5/README>) reads: ------------------------------ ------------------------------ ------------------------------ ... * Strawberry Perl issues: You'll need to create a .a library from the .dll before running the Makefile.PL, by running pexports and dlltool as shown below, within the C:\Program Files\PostgreSQL\8.3\bin directory: pexports libpq.dll > libpq.def dlltool -dllname libpq.dll --def libpq.def --output-lib ..\lib\libpq.a Then you'll need to set the required environment: set PATH=C:\PROGRA~1\PostgreSQL\8.3\bin;%PATH% set DBI_DSN=dbi:Pg:dbname=testdb set DBI_USER=*PostgreSQL username* set DBI_PASS=*PostgreSQL password* set POSTGRES_HOME=C:/PROGRA~1/PostgreSQL/8.3 set POSTGRES_INCLUDE=C:/PROGRA~1/PostgreSQL/8.3/include set POSTGRES_LIB=C:/PROGRA~1/PostgreSQL/8.3/lib Note that the username and password are the ones for PostgreSQL, NOT the ones for the Windows account that the PostgreSQL installer creates to run the service safely. ... ------------------------------ ------------------------------ ------------------------------ I think changing it to this would help: ------------------------------ ------------------------------ ------------------------------ ... * Strawberry Perl issues: You'll need to create a .a library from the .dll before running the Makefile.PL, by running pexports and dlltool as shown below, within the C:\Program Files\PostgreSQL\8.3\bin directory: C:\Windows\> C:\MinGW\bin\pexports libpq.dll > libpq.def C:\Windows\> C:\MinGW\bin\dlltool -dllname libpq.dll --def libpq.def --output-lib "C:\Program Files\PostgreSQL\12\lib\libpq.a" pexports and dlltool are included with MinGW - Minimalist Gnu for Windows, found here: https://osdn.net/projects/mingw/releases/ Once you have installed MinGW you can install pexports and dlltool as follows: C:\Windows\> C:\MinGW\bin\mingw-get.exe install pexports C:\Windows\> C:\MinGW\bin\mingw-get.exe install dlltool Then you'll need to set the required environment: set PATH=C:\PROGRA~1\PostgreSQL\8.3\bin;%PATH% set DBI_DSN=dbi:Pg:dbname=testdb set DBI_USER=*PostgreSQL username* set DBI_PASS=*PostgreSQL password* set POSTGRES_HOME=C:/PROGRA~1/PostgreSQL/8.3 set POSTGRES_INCLUDE=C:/PROGRA~1/PostgreSQL/8.3/include set POSTGRES_LIB=C:/PROGRA~1/PostgreSQL/8.3/lib Note that the username and password are the ones for PostgreSQL, NOT the ones for the Windows account that the PostgreSQL installer creates to run the service safely. ... ------------------------------ ------------------------------ ------------------------------ Kind regards, Steve On Tue, 24 Mar 2020 at 02:40, Greg Sabino Mullane via RT < bug-DBD-Pg@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=131708 > > > Any chance you could make a documentation patch to help out other Windows > users? The README.win32 file could really use some attention, but I'm > strictly *nix at this point in life. > >
Thank you! I've applied the changes in 386750fb1bb915e9fb3232bd5b78f3a7de869446