CurtTilmes / perl6-libarchive

Raku bindings for libarchive
5 stars 2 forks source link

Error with Raku 2020 #1

Open JJ opened 4 years ago

JJ commented 4 years ago

libarchive13, as well as Archive::Libarchive::Raw, are installed. However;

===> Testing: Libarchive:ver<0.1>:auth<github:CurtTilmes>
[Libarchive] Cannot locate symbol '(null)' in native library '(null)'
[Libarchive]   in method setup at /home/jmerelo/.rakudobrew/moar-2020.01/install/share/perl6/core/sources/947BDAB9F96E0E5FCCB383124F923A6BF6F8D76B (NativeCall) line 298
[Libarchive]   in block  at /home/jmerelo/.rakudobrew/moar-2020.01/install/share/perl6/core/sources/947BDAB9F96E0E5FCCB383124F923A6BF6F8D76B (NativeCall) line 594
[Libarchive]   in method lib-version at /home/jmerelo/Code/forks/raku/perl6-libarchive/lib/Libarchive.pm6 (Libarchive) line 61
[Libarchive]   in block <unit> at t/02-simple-tar-memory.t6 line 5
[Libarchive] Cannot locate symbol '(null)' in native library '(null)'
[Libarchive]   in method setup at /home/jmerelo/.rakudobrew/moar-2020.01/install/share/perl6/core/sources/947BDAB9F96E0E5FCCB383124F923A6BF6F8D76B (NativeCall) line 298
[Libarchive]   in block  at /home/jmerelo/.rakudobrew/moar-2020.01/install/share/perl6/core/sources/947BDAB9F96E0E5FCCB383124F923A6BF6F8D76B (NativeCall) line 594
[Libarchive]   in method open at /home/jmerelo/Code/forks/raku/perl6-libarchive/lib/Libarchive/Write.pm6 (Libarchive::Write) line 109
[Libarchive]   in method new at /home/jmerelo/Code/forks/raku/perl6-libarchive/lib/Libarchive/Write.pm6 (Libarchive::Write) line 87
[Libarchive]   in block <unit> at t/03-simple-tar-file.t6 line 16
[Libarchive] No such format 'raw'
[Libarchive]   in method write-options at /home/jmerelo/Code/forks/raku/perl6-libarchive/lib/Libarchive/Write.pm6 (Libarchive::Write) line 186
[Libarchive]   in method open at /home/jmerelo/Code/forks/raku/perl6-libarchive/lib/Libarchive/Write.pm6 (Libarchive::Write) line 101
[Libarchive]   in method new at /home/jmerelo/Code/forks/raku/perl6-libarchive/lib/Libarchive/Write.pm6 (Libarchive::Write) line 87
[Libarchive]   in sub archive-encode at /home/jmerelo/Code/forks/raku/perl6-libarchive/lib/Libarchive/Filter.pm6 (Libarchive::Filter) line 48
[Libarchive]   in block <unit> at t/08-filter.t6 line 12
===> Testing [FAIL]: Libarchive:ver<0.1>:auth<github:CurtTilmes>
Aborting due to test failure: Libarchive:ver<0.1>:auth<github:CurtTilmes> (use --force-test to override)
CurtTilmes commented 4 years ago

Which OS are you doing this on?

I tried out 'jjmerelo/raku-test' (Thanks for that, BTW!)

I disabled testing for some of the dependencies since they depend on more stuff, but the tests for Libarchive itself worked fine:

docker run -it --entrypoint /bin/sh jjmerelo/raku-test
apk add libarchive
zef install --/test NativeHelpers::Callback Archive::Libarchive::Raw
zef install Libarchive
echo hello world | raku -e 'use Libarchive::Filter :gzip; gzip $*IN, $*OUT' | zcat

(I filed an issue on NativeHelpers::Callback -- should be able to install that without disabling testing.)

JJ commented 4 years ago

Ubuntu 16.04. After installing, downstream dependencies tested fine... Thanks for filing the issue.

CurtTilmes commented 4 years ago

Ok, I see the problem -- not sure how to address easily.

ubuntu 16.04 package libarchive13 is actually libarchive.so.13.1.2. Later ubuntus use libarchive.so.13.2.1 (or even later). While backward compatible (the symbols that are in each do the same things), there are a bunch of new symbols in 13.2.1 that are not in 13.1.2., so a bunch of functionality exported by Archive::Libarchive::Raw and used by Libarchive is just not available with the older library.

Easy solution I guess would just be to tighten up the version requirement for Archive::Libarchive::Raw to require the newer version, so it would just fail rather than appearing to work.

Much harder solution would be to go through the symbols and make each one contingent on the library it finds and selectively disable the right functionality (wrong functionality?) from by Archive::Libarchive::Raw and Libarchive.

So I know why you get the error you're getting, but I don't have a solution for you.

CurtTilmes commented 4 years ago

To see this more plainly, after installing Archive::Libarchive::Raw before doing anything with Libarchive, try to run this:

raku -M Archive::Libarchive::Raw -e 'say archive_version_details'

Under ubuntu 16.04, it give me the same error you experienced above.

JJ commented 4 years ago

Thanks for the effort anyway... I guess I could always install a newer version of the package, if it's available somewhere...

JJ commented 4 years ago
raku -M Archive::Libarchive::Raw -e 'say archive_version_details'
Cannot locate symbol '(null)' in native library '(null)'
  in method setup at /home/jmerelo/.rakudobrew/moar-2020.01/install/share/perl6/core/sources/947BDAB9F96E0E5FCCB383124F923A6BF6F8D76B (NativeCall) line 298
  in block  at /home/jmerelo/.rakudobrew/moar-2020.01/install/share/perl6/core/sources/947BDAB9F96E0E5FCCB383124F923A6BF6F8D76B (NativeCall) line 594
  in block <unit> at -e line 1