1

i want to install perl modules on my Mac. i am using the bundled perl that comes with MAMP Pro (but this also won't work for the installed Perl in /usr/bin/perl)

i can't install modules, as the binary libs are not code signed. i wanted to install DBI and after that DBD::mysql. have installed DBI, the files are created, also for example

./site_perl/5.24.0/darwin-thread-multi-2level/auto/DBI/DBI.bundle
./site_perl/5.24.0/darwin-thread-multi-2level/Bundle/DBI.pm

but when i try to install DBD::mysql i got the message

can't load '/Applications/MAMP/Library/lib/perl5/site_perl/5.24.0/darwin-thread-multi-2level/auto/DBI/DBI.bundle' for module DBI: dlopen(/Applications/MAMP/Library/lib/perl5/site_perl/5.24.0/darwin-thread-multi-2level/auto/DBI/DBI.bundle, 1): no suitable image found.  Did find:
    /Applications/MAMP/Library/lib/perl5/site_perl/5.24.0/darwin-thread-multi-2level/auto/DBI/DBI.bundle: code signature in (/Applications/MAMP/Library/lib/perl5/site_perl/5.24.0/darwin-thread-multi-2level/auto/DBI/DBI.bundle) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed. at /Applications/MAMP/Library/lib/perl5/5.24.0/darwin-thread-multi-2level/DynaLoader.pm line 197.

problem seems to be that the compiled binary libs are not code signed and so not accepted by MAC OSX

Markus
  • 21
  • 2
  • See also [DBD::mysql::INSTALL](https://metacpan.org/pod/DBD::mysql::INSTALL). You said you installed DBI, so is this only a problem with `DBD::mysql` ? – Håkon Hægland Aug 26 '20 at 18:36
  • no, it is not a problem with the general installation of DBD::mysql. I know how to install perl Modules, compile binaries etc. – Markus Aug 27 '20 at 08:10
  • But still `DBI` installed fine, but `DBD::mysql` does not? – Håkon Hægland Aug 27 '20 at 08:12
  • I tried now to install `DBD::mysql` on MacOS Catalina 10.15.5 using `perlbrew` perl version 5.30.1 and `make test` fails with `Can't load '/Users/hakonhaegland/perl/install-cpan-modules/DBD-mysql-4.050/blib/arch/auto/DBD/mysql/mysql.bundle' for module DBD::mysql: dlopen(/Users/hakonhaegland/perl/install-cpan-modules/DBD-mysql-4.050/blib/arch/auto/DBD/mysql/mysql.bundle, 2): Library not loaded: @rpath/libmysqlclient.21.dylib`. I am looking into it – Håkon Hægland Aug 27 '20 at 08:26
  • See also [Cannot install DBD::mysql on Mac](https://stackoverflow.com/q/60985369/2173773). Seems like the guy in that post managed to install it.. – Håkon Hægland Aug 27 '20 at 08:27
  • thanxs. but i think the problem is a more genaral thing with mac osx catalina and gatekeeper and codesigning. i don't have the problem that the installation or make failes because of missing libraries. they are all there. the problem is, that the generated *.bundle files (libs like .so on linux?) can't be loaded as they are not signed and gatekeeper seems to refuse the use of those files. – Markus Aug 27 '20 at 09:27
  • FYI I was able to install `DBD::mysql` now (perlbrew, perl 5.30.1). The only issue was running `make test` which for some reason erased the `DYLD_LIBRARY_PATH` environment variable (I am looking into it). If I ran the test like this: `perl -MExtUtils::Command::MM "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t` instead all tests passed. Can you try install the module with `perlbrew` and see if you get the same signing issue? – Håkon Hægland Aug 27 '20 at 22:16
  • Seems like `DYLD_LIBRARY_PATH` is being erased for child processes of `make`, see [this](https://stackoverflow.com/q/63629878/2173773) question for more information. – Håkon Hægland Aug 28 '20 at 09:54
  • For problems with DBD::mysql on Catalina see: https://stackoverflow.com/questions/53590645/library-not-loaded-rpath-libmysqlclient-21-dylib-reason-image-not-found-djang This worked for me: sudo ln -s /usr/local/mysql/lib/libmysqlclient.21.dylib /usr/local/lib/libmysqlclient.21.dylib sudo ln -s /usr/local/mysql/lib/libssl.1.1.dylib /usr/local/lib/libssl.1.1.dylib sudo ln -s /usr/local/mysql/lib/libcrypto.1.1.dylib /usr/local/lib/libcrypto.1.1.dylib – RickJansen Nov 07 '20 at 12:13

0 Answers0