sergot / openssl

OpenSSL bindings for Perl 6
MIT License
14 stars 31 forks source link

Abort on macOS Catalina #77

Closed yusukebe closed 4 years ago

yusukebe commented 4 years ago

Tests are failed and aborted on my macOS Catalina.

macOS version:

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.15.3
BuildVersion:   19D76

Raku version:

$ raku --version
This is Rakudo version 2020.01 built on MoarVM version 2020.01.1
implementing Perl 6.d.

openssl version:

$ openssl version
OpenSSL 1.1.1d  10 Sep 2019

Install by zef:

$ zef install -v OpenSSL
===> Searching for: OpenSSL
===> Found: OpenSSL:ver<0.1.22>:auth<github:sergot> [via Zef::Repository::LocalCache]
===> Testing: OpenSSL:ver<0.1.22>:auth<github:sergot>
[OpenSSL] t/01-basic.t ...........
[OpenSSL] No subtests run
[OpenSSL] t/02-socket.t ..........
[OpenSSL] No subtests run
[OpenSSL] t/03-rsa.t .............
[OpenSSL] No subtests run
[OpenSSL] t/04-crypt.t ...........
[OpenSSL] Failed 10/11 subtests
[OpenSSL] t/05-digest.t ..........
[OpenSSL] Failed 5/5 subtests
[OpenSSL] t/06-digest-md5.t ......
[OpenSSL] Failed 1/1 subtests
[OpenSSL] t/07-version.t .........
[OpenSSL] Failed 9/9 subtests
[OpenSSL] t/10-client-ca-file.t ..
[OpenSSL] No subtests run
[OpenSSL] t/15-issue-36.t ........
[OpenSSL] No subtests run
[OpenSSL] Test Summary Report
[OpenSSL] -------------------
[OpenSSL] t/01-basic.t         (Wstat: 6 Tests: 0 Failed: 0)
[OpenSSL]   Non-zero wait status: 6
[OpenSSL]   Parse errors: No plan found in TAP output
[OpenSSL] t/02-socket.t        (Wstat: 6 Tests: 0 Failed: 0)
[OpenSSL]   Non-zero wait status: 6
[OpenSSL]   Parse errors: No plan found in TAP output
[OpenSSL] t/03-rsa.t           (Wstat: 6 Tests: 0 Failed: 0)
[OpenSSL]   Non-zero wait status: 6
[OpenSSL]   Parse errors: No plan found in TAP output
[OpenSSL] t/04-crypt.t         (Wstat: 6 Tests: 1 Failed: 0)
[OpenSSL]   Non-zero wait status: 6
[OpenSSL]   Parse errors: Bad plan.  You planned 11 tests but ran 1.
[OpenSSL] t/05-digest.t        (Wstat: 6 Tests: 0 Failed: 0)
[OpenSSL]   Non-zero wait status: 6
[OpenSSL]   Parse errors: Bad plan.  You planned 5 tests but ran 0.
[OpenSSL] t/06-digest-md5.t    (Wstat: 6 Tests: 0 Failed: 0)
[OpenSSL]   Non-zero wait status: 6
[OpenSSL]   Parse errors: Bad plan.  You planned 1 tests but ran 0.
[OpenSSL] t/07-version.t       (Wstat: 6 Tests: 0 Failed: 0)
[OpenSSL]   Non-zero wait status: 6
[OpenSSL]   Parse errors: Bad plan.  You planned 9 tests but ran 0.
[OpenSSL] t/10-client-ca-file.t (Wstat: 6 Tests: 0 Failed: 0)
[OpenSSL]   Non-zero wait status: 6
[OpenSSL]   Parse errors: No plan found in TAP output
[OpenSSL] t/15-issue-36.t      (Wstat: 6 Tests: 0 Failed: 0)
[OpenSSL]   Non-zero wait status: 6
[OpenSSL]   Parse errors: No plan found in TAP output
[OpenSSL] Files=9, Tests=1, 11 wallclock secs ( 0.03 usr  0.01 sys + 15.90 cusr  2.03 csys = 17.97 CPU)
[OpenSSL] Result: FAIL
===> Testing [FAIL]: OpenSSL:ver<0.1.22>:auth<github:sergot>
Aborting due to test failure: OpenSSL:ver<0.1.22>:auth<github:sergot> (use --force-test to override)

Run test:

$ git clone git@github.com:sergot/openssl.git
$ cd openssl
$ raku -Ilib t/01-basic.t
zsh: abort      raku -Ilib t/01-basic.t

Installing Perl 5 Net::SSLeay is successful on same environments.

vrurg commented 4 years ago

Try the following. If you install locally to your $HOME either from source or with rakudobrew and using any kind of ports – as I use MacPorts, for example - then find the lib dir where libmoar.dylib is located (say, ~/raku/lib, or ~/.rakudobrew/versions/moar-2020.01/install/lib). Then symlink all *.dylib from your ports lib directory into Rakudo's. I say 'all' just for simplicity.

Works for me.

The problem is in a security measure MacOS takes on dynamic libraries. Your binary can only load those which are either in system locations (i.e. /usr/lib, for example) or in a lib found in the same location where your executable is. For local installations of Rakudo it means it can't see .dylib from ports.

yusukebe commented 4 years ago

Oooooh, It works. I tried following instruction - I use homebrew:

$ ln -s /usr/local/Cellar/openssl@1.1/1.1.1d/lib/*.dylib ~/.rakudobrew/versions/moar-2020.01/install/lib

Thanks a lot!!