Problems with DBD::Pg on MacBook Air w/M1 chip

adamwizon via dbd-pg <[email protected]> Sun, 22 Nov 2020 20:25:16 -0500
Newsgroups gmane.comp.db.postgresql.dbdpg
Message-ID <[email protected]>
--Apple-Mail=_021B1DC5-3DAB-453D-B758-6C552842B24D
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8

I am running Postgres 12.5 on Mac OS X Big Sur 11.0.01 and Perl 5.28.2.

When I try to build the DBD::Pg module, the =E2=80=98make test=E2=80=99 =
fails on what looks like the SIP problem.  Using the install_name_tool =
fix does not work, or at least I can not get it to work because I think =
the libpg.5.dylib does not seem to be in the bundle.

I am not fluent enough to fix the problem and I may be describing this =
error inaccurately.  The DBD::Pg version is 3.14.2.  I installed DBI =
version 1.643 and I looks like it installed properly. =20

Here is the error from =E2=80=98make test=E2=80=99 on DBD:Pg. =20
-------------------------------------------------
make test
"/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Pg.bs =
blib/arch/auto/DBD/Pg/Pg.bs 644
PGINITDB=3D"/Library/PostgreSQL/12/bin/initdb" PERL_DL_NONLAZY=3D1 =
"/usr/bin/perl" "-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 ............ 1/3=20
#   Failed test 'use DBD::Pg;'
#   at t/00basic.t line 18.
#     Tried to use 'DBD::Pg'.
#     Error:  Can't load 'blib/arch/auto/DBD/Pg/Pg.bundle' for module =
DBD::Pg: dlopen(blib/arch/auto/DBD/Pg/Pg.bundle, 0x0002): open("", =
O_RDONLY) failed with errno=3D2 at =
/System/Library/Perl/5.28/darwin-thread-multi-2level/DynaLoader.pm line =
197.
#  at t/00basic.t line 18.
# Compilation failed in require at t/00basic.t line 18.
# BEGIN failed--compilation aborted at t/00basic.t line 18.
# CCFLAGS: q[ -g -pipe -fno-strict-aliasing -fstack-protector-strong =
-DPERL_USE_SAFE_PUTENV -DPGLIBVERSION=3D120005 -DPGDEFPORT=3D5432]
# INC: q[-I/Library/PostgreSQL/12/include =
-I/Library/Perl/5.28/darwin-thread-multi-2level/auto/DBI]
# LIBS: [q[-L/Library/PostgreSQL/12/lib -lpq -lm]]
# If the error mentions libpq.so, please see the troubleshooting section =
of the README file
Bailout called.  Further testing stopped:  Cannot continue without =
DBD::Pg
FAILED--Further testing stopped: Cannot continue without DBD::Pg
make: *** [test_dynamic] Error 255

---------------------------------------------------


Looks like a library path error, but the fix that has been previously =
posted (see below) did not work with my paths fixed from the example =
below.

[sudo install_name_tool -change \
	libpq.5.dylib /Library/PostgreSQL/11/lib/libpq.5.dylib \
    ~/perl5/lib/perl5/darwin-thread-multi-2level/auto/DBD/Pg/Pg.bundle
]=

--Apple-Mail=_021B1DC5-3DAB-453D-B758-6C552842B24D
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=utf-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; =
charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;" class=3D"">I =
am running Postgres 12.5 on Mac OS X Big Sur 11.0.01 and Perl =
5.28.2.<div class=3D""><br class=3D""></div><div class=3D"">When I try =
to build the DBD::Pg module, the =E2=80=98make test=E2=80=99 fails on =
what looks like the SIP problem. &nbsp;Using the install_name_tool fix =
does not work, or at least I can not get it to work because I think the =
libpg.5.dylib does not seem to be in the bundle.</div><div class=3D""><br =
class=3D""></div><div class=3D"">I am not fluent enough to fix the =
problem and I may be describing this error inaccurately. &nbsp;The =
DBD::Pg version is 3.14.2. &nbsp;I installed DBI version 1.643 and I =
looks like it installed properly. &nbsp;</div><div class=3D""><br =
class=3D""></div><div class=3D"">Here is the error from =E2=80=98make =
test=E2=80=99 on DBD:Pg. &nbsp;</div><div =
class=3D"">-------------------------------------------------</div><div =
class=3D""><div style=3D"margin: 0px; font-stretch: normal; font-size: =
10px; line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); =
background-color: rgba(255, 255, 255, 0.85);" class=3D""><span =
style=3D"font-variant-ligatures: no-common-ligatures" class=3D"">make =
test</span></div><div style=3D"margin: 0px; font-stretch: normal; =
font-size: 10px; line-height: normal; font-family: Monaco; color: =
rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85);" =
class=3D""><span style=3D"font-variant-ligatures: no-common-ligatures" =
class=3D"">"/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- =
Pg.bs blib/arch/auto/DBD/Pg/Pg.bs 644</span></div><div style=3D"margin: =
0px; font-stretch: normal; font-size: 10px; line-height: normal; =
font-family: Monaco; color: rgb(16, 16, 16); background-color: rgba(255, =
255, 255, 0.85);" class=3D""><span style=3D"font-variant-ligatures: =
no-common-ligatures" =
class=3D"">PGINITDB=3D"/Library/PostgreSQL/12/bin/initdb" =
PERL_DL_NONLAZY=3D1 "/usr/bin/perl" "-MExtUtils::Command::MM" =
"-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, =
'blib/lib', 'blib/arch')" t/*.t</span></div><div style=3D"margin: 0px; =
font-stretch: normal; font-size: 10px; line-height: normal; font-family: =
Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, =
0.85);" class=3D""><span style=3D"font-variant-ligatures: =
no-common-ligatures" class=3D"">t/00_signature.t ....... skipped: Set =
the environment variable TEST_SIGNATURE to enable this =
test</span></div><div style=3D"margin: 0px; font-stretch: normal; =
font-size: 10px; line-height: normal; font-family: Monaco; color: =
rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85);" =
class=3D""><span style=3D"font-variant-ligatures: no-common-ligatures" =
class=3D"">t/00basic.t ............ 1/3&nbsp;</span></div><div =
style=3D"margin: 0px; font-stretch: normal; font-size: 10px; =
line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); =
background-color: rgba(255, 255, 255, 0.85);" class=3D""><span =
style=3D"font-variant-ligatures: no-common-ligatures" class=3D""># =
&nbsp; Failed test 'use DBD::Pg;'</span></div><div style=3D"margin: 0px; =
font-stretch: normal; font-size: 10px; line-height: normal; font-family: =
Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, =
0.85);" class=3D""><span style=3D"font-variant-ligatures: =
no-common-ligatures" class=3D""># &nbsp; at t/00basic.t line =
18.</span></div><div style=3D"margin: 0px; font-stretch: normal; =
font-size: 10px; line-height: normal; font-family: Monaco; color: =
rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85);" =
class=3D""><span style=3D"font-variant-ligatures: no-common-ligatures" =
class=3D""># &nbsp; &nbsp; Tried to use 'DBD::Pg'.</span></div><div =
style=3D"margin: 0px; font-stretch: normal; font-size: 10px; =
line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); =
background-color: rgba(255, 255, 255, 0.85);" class=3D""><span =
style=3D"font-variant-ligatures: no-common-ligatures" class=3D""># =
&nbsp; &nbsp; Error:&nbsp; Can't load 'blib/arch/auto/DBD/Pg/Pg.bundle' =
for module DBD::Pg: dlopen(blib/arch/auto/DBD/Pg/Pg.bundle, 0x0002): =
open("", O_RDONLY) failed with errno=3D2 at =
/System/Library/Perl/5.28/darwin-thread-multi-2level/DynaLoader.pm line =
197.</span></div><div style=3D"margin: 0px; font-stretch: normal; =
font-size: 10px; line-height: normal; font-family: Monaco; color: =
rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85);" =
class=3D""><span style=3D"font-variant-ligatures: no-common-ligatures" =
class=3D"">#&nbsp; at t/00basic.t line 18.</span></div><div =
style=3D"margin: 0px; font-stretch: normal; font-size: 10px; =
line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); =
background-color: rgba(255, 255, 255, 0.85);" class=3D""><span =
style=3D"font-variant-ligatures: no-common-ligatures" class=3D""># =
Compilation failed in require at t/00basic.t line 18.</span></div><div =
style=3D"margin: 0px; font-stretch: normal; font-size: 10px; =
line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); =
background-color: rgba(255, 255, 255, 0.85);" class=3D""><span =
style=3D"font-variant-ligatures: no-common-ligatures" class=3D""># BEGIN =
failed--compilation aborted at t/00basic.t line 18.</span></div><div =
style=3D"margin: 0px; font-stretch: normal; font-size: 10px; =
line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); =
background-color: rgba(255, 255, 255, 0.85);" class=3D""><span =
style=3D"font-variant-ligatures: no-common-ligatures" class=3D""># =
CCFLAGS: q[ -g -pipe -fno-strict-aliasing -fstack-protector-strong =
-DPERL_USE_SAFE_PUTENV -DPGLIBVERSION=3D120005 =
-DPGDEFPORT=3D5432]</span></div><div style=3D"margin: 0px; font-stretch: =
normal; font-size: 10px; line-height: normal; font-family: Monaco; =
color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85);" =
class=3D""><span style=3D"font-variant-ligatures: no-common-ligatures" =
class=3D""># INC: q[-I/Library/PostgreSQL/12/include =
-I/Library/Perl/5.28/darwin-thread-multi-2level/auto/DBI]</span></div><div=
 style=3D"margin: 0px; font-stretch: normal; font-size: 10px; =
line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); =
background-color: rgba(255, 255, 255, 0.85);" class=3D""><span =
style=3D"font-variant-ligatures: no-common-ligatures" class=3D""># LIBS: =
[q[-L/Library/PostgreSQL/12/lib -lpq -lm]]</span></div><div =
style=3D"margin: 0px; font-stretch: normal; font-size: 10px; =
line-height: normal; font-family: Monaco; color: rgb(16, 16, 16); =
background-color: rgba(255, 255, 255, 0.85);" class=3D""><span =
style=3D"font-variant-ligatures: no-common-ligatures" class=3D""># If =
the error mentions libpq.so, please see the troubleshooting section of =
the README file</span></div><div style=3D"margin: 0px; font-stretch: =
normal; font-size: 10px; line-height: normal; font-family: Monaco; =
color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, 0.85);" =
class=3D""><span style=3D"font-variant-ligatures: no-common-ligatures" =
class=3D"">Bailout called.&nbsp; Further testing stopped:&nbsp; Cannot =
continue without DBD::Pg</span></div><div style=3D"margin: 0px; =
font-stretch: normal; font-size: 10px; line-height: normal; font-family: =
Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, =
0.85);" class=3D""><span style=3D"font-variant-ligatures: =
no-common-ligatures" class=3D"">FAILED--Further testing stopped: Cannot =
continue without DBD::Pg</span></div><div style=3D"margin: 0px; =
font-stretch: normal; font-size: 10px; line-height: normal; font-family: =
Monaco; color: rgb(16, 16, 16); background-color: rgba(255, 255, 255, =
0.85);" class=3D""><span style=3D"font-variant-ligatures: =
no-common-ligatures" class=3D"">make: *** [test_dynamic] Error =
255</span></div></div><div class=3D""><br class=3D""></div><div =
class=3D"">---------------------------------------------------</div><div =
class=3D""><br class=3D""></div><div class=3D""><br class=3D""></div><div =
class=3D"">Looks like a library path error, but the fix that has been =
previously posted (see below) did not work with my paths fixed from the =
example below.</div><div class=3D""><br class=3D""></div><div =
class=3D"">[<span style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, =
0); white-space: pre-wrap;" class=3D"">sudo install_name_tool -change =
\</span></div><pre style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, =
0); word-wrap: break-word; white-space: pre-wrap;" class=3D"">	=
libpq.5.dylib /Library/PostgreSQL/11/lib/libpq.5.dylib \
    =
~/perl5/lib/perl5/darwin-thread-multi-2level/auto/DBD/Pg/Pg.bundle</pre><d=
iv class=3D"">]</div></body></html>=

--Apple-Mail=_021B1DC5-3DAB-453D-B758-6C552842B24D--