Open xpusostomos opened 1 month ago
What is $^O on Cygwin?
Try editing Makefile.PL and comment out this line:
https://github.com/bucardo/dbdpg/blob/455943ef13e9760585cdc1da7ab27fa6762b0faf/Makefile.PL#L53
and the matching close brace on line 57.
$^O on cygwin is "cygwin".
I take it that I have to git clone from here to do what you suggest. I seem to get some other issues building that, I'll have to find some time to play with it.
@xpusostomos wrote:
I take it that I have to git clone from here to do what you suggest.
No, you can just edit the Makefile.PL file in the CPAN distribution. It looks like you're using the "cpan" command to install? If so, then at the "cpan" prompt, type "look DBD::Pg" and then it will give you a shell in cpan's DBD::Pg installation directory. Then just edit the Makefile.PL file as I previously suggested and "perl Makefile.PL" and "make" and "make test".
Hmm... make test does this:
#
# ^"C^:^\Program^ Files^\PostgreSQL^\15^\bin^\pg^_ctl^" -D /c/Users/chris/.cpan/build/DBD-Pg-3.18.0-8/dbdpg_test_database/data -l logfile start
#
#
t/01connect.t .......... skipped: Connection to database failed, cannot continue testing
Can't use an undefined value as a subroutine reference at /usr/share/perl5/5.40/TAP/Harness.pm line 612.
make: *** [Makefile:988: test_dynamic] Error 255
I guess it's trying to create a database to test... I'm not sure why it asks me to run a database server, I have one running all the time... or what its requirements or assumptions are to create a database and connect to it..
... anyway, I did a make install, which seemed to work... and back in cpan I did install DBD::Pg and it said
Reading '/c/Users/chris/.cpan/Metadata'
Database was generated on Fri, 27 Sep 2024 03:52:39 GMT
DBD::Pg is up to date (3.18.0).
So that sounds good, however... when I try and run a perl pg program...
install_driver(Pg) failed: Can't locate DBD/Pg.pm in @INC (you may need to install the DBD::Pg module) (@INC entries checked: /usr/local/lib/perl5/site_perl/5.40/x86_64-cygwin-threads /usr/local/share/perl5/site_perl/5.40 /usr/lib/perl5/vendor_perl/5.40/x86_64-cygwin-threads /usr/share/perl5/vendor_perl/5.40 /usr/lib/perl5/5.40/x86_64-cygwin-threads /usr/share/perl5/5.40) at (eval 5) line 3.
Perhaps the DBD::Pg perl module hasn't been fully installed,
or perhaps the capitalisation of 'Pg' isn't right.
Available drivers: DBM, ExampleP, File, Gofer, Mem, Proxy, Sponge.
at ./lib/database.pl line 56.
so cpan seems to think it's installed, but perl seems to think it isn't.
Without seeing the output of your "make install", which you haven't provided, it's impossible to diagnose what your problem is.
So do "make install" again and pay closer attention to where it's being installed?
I get an error installing DBD::Pg on cygwin...
Since postgres is installed in C:/Program Files, a path with a space in it, and the error says "gcc warning Files/PostgreSQL/15/include"... it looks like a classic case of shell variable not quoted, or something like that. BTW, C:/Program Files is the default install location for Postgres on Windows. I would imagine perhaps the error occurs on UNIX too if you happened to have it installed in a path with a space.